Ben Pfaff [Fri, 4 Apr 2008 23:17:46 +0000 (16:17 -0700)]
Implement OpenFlow statistics in switches and in dpctl.
This has two notable omissions. First, only at most 4k of flow statistics
are reported. Second, aggregate statistics are not yet supported. Both
of these are fairly easily fixable, just not fixed yet.
Ben Pfaff [Thu, 3 Apr 2008 18:40:16 +0000 (11:40 -0700)]
Break data_hello and control_hello messages into multiple messages.
We want to allow multiple OpenFlow connections to a switch, so that
dpctl and other management tools can also connect to a switch that
is connecte to the controller. These tools will want to fetch the
information in the data_hello message, but currently this can only
be done by sending a control_hello message, which changes the
switch configuration state. So breaking the hello messages up into
multiple different messages, only some of which affect configuration
state, cures the problem.
Also, clean up the kernel datapath a bit, by adding helper functions
for allocating and resizing Generic Netlink messages that encapsulate
OpenFlow messages.
Ben Pfaff [Fri, 4 Apr 2008 23:20:28 +0000 (16:20 -0700)]
Allow secchan to listen for management connections also.
This is needed in the userspace switch code also. That
change is implemented in later change "Send replies to
OpenFlow requests only to the sender". Really that part
of the change should be moved into this one, but intervening
changes are intertwined enough with the same code to
make that difficult.
Ben Pfaff [Fri, 28 Mar 2008 21:12:15 +0000 (14:12 -0700)]
Get rid of mac.h, migrating its users to packets.h.
As a consequence, this fixes tests for multicast and local Ethernet
addresses, which formerly tested for the high bits but should
have tested for the low bits of the first octet.
Justin Pettit [Sun, 30 Mar 2008 08:41:42 +0000 (01:41 -0700)]
- Fixed endian issue with action type. Thanks, Ben!
- Removed BUG() call that could be maliciously/accidentally triggered by a faulty controller.
- Switched from __constant_htons to htons, which seems preferred.
Ben Pfaff [Fri, 28 Mar 2008 00:34:05 +0000 (17:34 -0700)]
Set l4 pointer properly in buffers that contain IP options.
The important part of this change is handling of IP options. The
rest is intended to ensure that packet->l3 and packet->l4 never
point outside the valid range of a packet in the presence of a
minimum-length Ethernet frame. Other code (particularly in forward.c)
assumes that if the IP protocol is TCP or UDP, then packet->l4 points
to a tcp_header or udp_header. Whether this is a good idea is
debatable--it probably warrants clean-up, at least--but that what's
there now.
Ben Pfaff [Thu, 27 Mar 2008 22:16:19 +0000 (15:16 -0700)]
Add the ability to connect to a vconn asynchronously.
Until now, vconn_connect() has always completed the connection
synchronously, blocking as necessary. In the userspace
switch, we want to be able to continue forwarding packets even
if the connection to the controller drops. Thus, this change set
that makes that possible.
The approach taken is perhaps more ambitious than needed, as it
actually adds a new high-level mechanism for polling on arbitrary
file descriptors. This necessitates quite a bit of change to
each of the userspace programs that use vconns, but it also has
the effect of simplifying them. The new structure of these programs
is a lot less fragile than the old one (which tended to end up
livelocking or hanging when something wasn't quite right), so it
seems like the changes are worth it.
Ben Pfaff [Thu, 27 Mar 2008 21:30:21 +0000 (14:30 -0700)]
Add 1024-bit Diffie-Hellman parameters to vconn-ssl.
1024-bit Diffie-Hellman is somewhat weak, but I haven't been able to
figure out how to make OpenSSL use longer Diffie-Hellman keys than that.
If this isn't available, OpenSSL doesn't let connections proceed.
This change should be reverted when we figure out how to make OpenSSL
use longer Diffie-Hellman keys.
Ben Pfaff [Thu, 27 Mar 2008 21:28:01 +0000 (14:28 -0700)]
Make vlog preserve errno.
This means that adding logging to code disturbs the program's state
as little as possible. This is a precautionary measure, not in response
to any particular bug.
Ben Pfaff [Thu, 13 Mar 2008 00:12:58 +0000 (17:12 -0700)]
Fix backoff.
Until now, if the secure channel connected to a controller, then it would
not back off at all from re-connecting. Therefore, if something causes
the secure channel to disconnect quickly after connecting to a controller,
then we could get storms of attempted connections.
This commit causes the secure channel to back off exponentially from
connection attempts regardless of the reason for disconnection, preventing
such storms.