Commit Graph
142 Commits
Author SHA1 Message Date
Ben Pfaff b3b28afb7b Use signal-based timekeeping functions throughout the source base. 2008-08-12 15:21:30 -07:00
Ben Pfaff 3f683b32c8 Initialize the timetracking module in each userspace program.
Also, use time_alarm() instead of the POSIX alarm() function, because
alarm() interferes with time_alarm().
2008-08-12 15:21:30 -07:00
Ben Pfaff 7bee00fad9 Implement OpenFlow hard timeouts.
This updates the OpenFlow protocol version and changes the names of
structure members, so any software that uses OpenFlow will need to be
updated to match.
2008-08-07 15:19:31 -07:00
Ben Pfaff 874bb0cbc1 Fix uninitialized struct member in userspace table-linear. 2008-08-07 13:29:10 -07:00
Ben Pfaff 7462f2e8bd Fix bug in clearing unsupported switch flags.
We need to keep the flags we support, not drop them.
2008-08-07 13:29:10 -07:00
Ben Pfaff 8effb451eb Don't allow unsupported flags to be set in the switch. 2008-08-07 10:34:37 -07:00
Ben Pfaff eca2aeb329 Implement OFPC_FRAG_DROP fragment handling policy. 2008-08-07 10:34:37 -07:00
Ben Pfaff 2a6dc4f319 Reduce redundancy in datapath code. 2008-08-07 10:34:37 -07:00
Ben Pfaff 844a4678aa Maintain userspace switch configuration in host byte order.
This makes it easier to work with and makes the code more like the
kernel switch.
2008-08-07 10:23:06 -07:00
Ben Pfaff 6ca5840e48 Fix memory leak when OFPP_TABLE is used for a packet that matches no flow. 2008-08-07 10:23:06 -07:00
Justin Pettit 5caaf64f20 Properly track table match counts. 2008-08-06 01:58:15 -07:00
Ben Pfaff bab6bdbe58 vconn: Implement Unix domain socket vconn.
These are useful for local management connections because, unlike TCP
sockets, they are subject to regular file system permissions.
2008-07-30 15:45:21 -07:00
Ben Pfaff 17778ffd72 Verify OpenFlow version number in vconn_recv(). 2008-07-23 17:04:15 -07:00
Ben Pfaff 8f1f1132e5 Make set_pidfile() easier to use. 2008-07-22 13:56:26 -07:00
Ben Pfaff 4d7977d636 Don't unnecessarily link against -lresolv and -ldl.
Eliminates warnings given by dpkg-shlibdeps when building Debian
packages.
2008-07-21 15:45:35 -07:00
Ben Pfaff f730dded18 Move Autoconf's macro definitions into config.h.
This makes "make" output slightly more readable.
2008-07-21 15:05:53 -07:00
Ben Pfaff f24230f9d9 Drop use of libtool for libraries.
libtool was needed when NOX was directly linking against libopenflow.
Since it doesn't do that anymore, we can drop its use (and that makes
OpenFlow configure and build slightly faster).
2008-07-21 15:05:53 -07:00
Ben Pfaff 5fc6464527 Don't explicitly link against libdl.
There is no need to add -ldl explicitly to each program's LDADD, because
the configure test for dladdr does that for us.
2008-07-21 15:05:53 -07:00
Ben Pfaff 6e1d7e4254 Only link programs that need it against OpenSSL.
This keeps vlogconf, in particular, from being linked against OpenSSL,
which in turn keeps the Debian package build tools from complaining that
the openflow-common package shouldn't need to depend on OpenSSL but does
because of the spurious library link.
2008-07-21 15:05:53 -07:00
Ben Pfaff 1b6df17a65 Make facility and level optional in -v, --verbose options.
This makes it easier to set a given module to maximum verbosity,
as is often useful for debugging.
2008-07-18 14:16:40 -07:00
Ben Pfaff d838ee2e03 vconn: Make errors in vconn names non-fatal errors.
This prevents bad vconn names obtained via discovery from killing
the secure channel.
2008-07-18 14:16:40 -07:00
Ben Pfaff 4d90ee6aef vconn: Add utility functions make_openflow() and update_openflow_length().
Use these functions to simplify code that creates and sends
OpenFlow packets.
2008-07-18 14:08:18 -07:00
Ben Pfaff ab6f9e079b Add new --max-backoff option to secchan and switch programs.
One use case is when NOX is running on localhost, in which case waiting
for the full default backoff interval is unnecessary and undesirable.

Also changes default maximum backoff to 15 seconds (from 60).
2008-07-18 14:07:03 -07:00
Ben Pfaff e334e4e0e7 rconn: Add new max_backoff argument to rconn_new().
This allows the caller more control over reconnection backoff.
2008-07-18 14:07:03 -07:00
Ben Pfaff 2afec34627 netdev: Add ability to permanently set device flags. 2008-07-18 13:55:12 -07:00
Ben Pfaff e55d52c988 netdev: Add argument to netdev_open() to specify Ethernet type to capture.
This is needed by the controller, which wants to listen only for
OpenFlow discovery BPDUs on its network devices.

Also, update all existing callers.
2008-07-18 13:42:38 -07:00
Ben Pfaff 7470a21307 packets: Move IP checksum functionality into new csum.c, csum.h. 2008-07-18 13:42:38 -07:00
Ben Pfaff a304614f57 Prevent switch implementations from complaining about echo-reply messages.
Thanks to Reid Price <reid@nicira.com> for reporting the issue (which
only caused spurious warning messages).
2008-07-15 12:43:59 -07:00
Ben Pfaff bebf175930 Make the secure channel and controller send out keepalives.
It can happen that the secure channel thinks that it is connected
to the controller, but in fact the connection has dropped.  For
example, a switch intermediate between the secure channel and the
controller could have a flow inserted, due to a malfunction, that
causes packets in one direction or the other to be dropped.  When
this happens, the Linux kernel's TCP implementation will continue
retransmitting packets for somewhere between 13 and 30 minutes,
depending on the connection's retransmission timeout (according
to linux/Documentation/networking/ip-sysctl.txt) with the default
Linux settings.

We want to detect the lost connection and re-connect much faster
than that.  We use OpenFlow echo request and reply messages: if
no message is received from the controller for N seconds, we
send out an echo request.  If no reply (actually, any message at
all) is received for an additional N seconds, then we assume
that the connection has been lost, and reconnect.
2008-07-01 11:14:45 -07:00
Ben Pfaff 258f32a084 Respond to echo requests in OpenFlow implementations.
Nothing yet sends such requests.  This is preparation for their
use in following commits.
2008-07-01 10:51:50 -07:00
Ben Pfaff 7225d06a78 Add utility functions for generating random numbers, and use where appropriate. 2008-07-01 10:51:47 -07:00
Justin Pettit 94998b6261 Don't allow adding a flow entry with an output port of OFPP_NONE. 2008-06-30 21:41:46 -07:00
Justin Pettit 4196aaf17e Fix extraction of flow data from match structure.
This brings the user-space switch in-line with fixes that were previously
made to the kernel one.  The main problem was that when wildcards are used
some of the fields that follow should also be wildcarded.
2008-06-26 11:48:50 -07:00
Justin Pettit df5df460f0 Fix a couple of problems when modifying VLAN tags. 2008-06-26 11:48:50 -07:00
Ben Pfaff 07f8d9645c Bring manpages and usage messages up-to-date. 2008-06-13 13:30:39 -07:00
Ben Pfaff fe867d8d71 Add --detach and --pidfile options to daemons. 2008-06-13 13:03:51 -07:00
Justin Pettit 8c0321d913 Have the switch list all the stats types it support in the capabilities field.
Thanks to Brandon for pointing this out.
2008-06-12 20:40:02 -07:00
Ben Pfaff 9446ee791c Move manpages from man directory to next to their programs. 2008-06-09 11:01:46 -07:00
Ben Pfaff 23e054dcb6 New functions for getting and setting network device flags.
This allows us to open network devices without bringing them up
and setting them for promiscuous mode, which will be useful in the
secchan for in-band communication.
2008-05-28 10:46:54 -07:00
Ben Pfaff 6b8436f66b Expose device IP addresses through netdev.
This will be useful for the secure channel later.
2008-05-28 10:46:54 -07:00
Ben Pfaff 735683ac61 Move netdev from switch to lib.
This is in preparation for the secure channel wanting to access
network devices.
2008-05-28 10:46:54 -07:00
Ben Pfaff 253d1704aa Always do exact-match on undefined flow fields, so that such flows can be in table-hash. 2008-05-28 09:58:22 -07:00
Justin Pettit 03addaad57 Don't try to use the IP addresses from ARP packets when matching. 2008-05-10 00:45:06 -07:00
Justin Pettit 3cf996b4cd Zero-out invalid fields when extracting a "match" and transforming it into a "flow".
When the controller wishes to add a flow entry to the switch, it sends a request with a description of matching flows in a "match".  The switch was adding these exactly as described into the flow tables.  However, when packets arrived, all invalid fields (e.g., the TCP/UDP ports in a non-TCP/UDP packet) are set to zero.  If the rule being added by the controller had not set these invalid fields to zero, the packets would never match.  We now zero out these fields when extracing a "match".

-- Reported by Brandon H. --
2008-05-09 11:24:04 -07:00
Justin Pettit 5f4a12ce38 Implement the OFPP_ALL virtual port.
-- Reported by Brandon H. --
2008-05-09 11:24:04 -07:00
Ben Pfaff c8e4cbbd3a Treat flows without any wildcards as maximum priority.
Otherwise, we give the table implementations the opportunity to screw up
by distinguishing between two flows without wildcards but with apparently
different priorities that are required to be treated as the same priority.
2008-05-07 15:23:45 -07:00
Ben Pfaff bbf5f5607f When deleting flows, only insist on matching priority with strict matching.
(The code before this change would only ever delete flows if strict
matching was turned on.)
2008-05-07 15:23:45 -07:00
root a6c34acd7a Clean-up some compiler warnings related to printing numbers. 2008-05-05 18:49:10 -07:00
Justin Pettit 7d780b0571 Fix typo in comment. 2008-05-02 21:53:15 -07:00
Ben Pfaff f7bf3916ff Implement aggregate flow statistics in kernel and userspace switches. 2008-05-02 16:58:33 -07:00