Commit Graph

104 Commits

Author SHA1 Message Date
Ben Pfaff e9ab3dbf6d Make -P or --pidfile keep programs from running if already running. 2008-08-28 13:17:16 -07:00
Ben Pfaff ab43666b20 vlog: Apply rate-limiting everywhere it seems warranted. 2008-08-26 13:25:21 -07:00
Justin Pettit f1c6daebf3 Send PORT_STATUS messages on port and link changes. Add ability to remotely enable and disable a port through the PORT_MOD message. 2008-08-22 12:47:54 -07:00
Justin Pettit b5348aef10 Initialize the table structures to zero. 2008-08-19 17:06:10 -07:00
Justin Pettit 3be2832bf4 Fix problem where packets never matched in hash table and flows always added regardless of whether they currently exist. 2008-08-18 22:23:03 -07:00
Ben Pfaff 15938f6d22 Don't compare wildcards, nw_src_mask, nw_dst_mask fields in hash table.
They should always compare equal, so there's no point in wasting the
time.
2008-08-18 14:26:50 -07:00
Ben Pfaff 9630e41005 Implement subnet mask matching in OpenFlow. 2008-08-18 14:26:50 -07:00
Justin Pettit d6a1e67a8d Add stats message that allows querying description of components in OpenFlow. 2008-08-16 09:43:05 -07:00
Justin Pettit b41a6a0a6d Added new interface statistics. 2008-08-14 23:12:37 -07:00
Justin Pettit 0226bbc742 Switch to new packet-out format and add OFPP_IN_PORT.
The original packet-out format allowed multiple actions to be specified for
buffered packets, but only a destination port for messages including data.
This change makes packet-out more consistent by allowing multiple actions
regardless of how the packet is stored.

This change also disallows sending packets through the incoming port without
explicitly using the OFPP_IN_PORT virtual port.
2008-08-14 00:07:18 -07:00
Ben Pfaff 69abd4346d Prevent the secchan from dying due to SIGPIPE.
Fix for bug #88.
2008-08-12 16:21:45 -07:00
Ben Pfaff 903d0940fb Drop rconn's responsibility for limiting the tx queue.
Now it helps clients track the number of in-flight messages, but lets the
clients do the limiting themselves.  This will come in handy for packet-in
rate limiting (in an upcoming commit), in which we want to track in-flight
packet-in messages separately from other in-flight messages.
2008-08-12 15:21:30 -07:00
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