Commit Graph
44 Commits
Author SHA1 Message Date
Ben Pfaff a662402bac Improve the error message when vconn gets an unexpected version. 2008-10-31 14:09:53 -07:00
Ben Pfaff 949a799037 Fix vconn_transact() bug introduced in commit 65ac65a6d2,
"Improve the command interface so that it sends back acks or errors."

Oops.  That was dumb.

Thanks to Justin for reporting the problem.
2008-10-30 10:38:03 -07:00
Ben Pfaff 6b617bac12 Move exported headers to include/openflow, private headers to lib/.
This makes it easier to install the headers, or to use them directly from
another software package with -I$(openflow)/include, without invading
the top-level include file namespace.
2008-10-29 15:15:45 -07:00
Ben Pfaff 65ac65a6d2 Improve the command interface so that it sends back acks or errors. 2008-10-28 12:46:18 -07:00
Ben Pfaff a948b96315 New routine ofpbuf_put_zeros() to simplify a common code sequence. 2008-10-14 13:31:09 -07:00
Justin Pettit 1489ca2657 Add support for vendor-defined and variable-length actions.
Allow vendors to define their own actions.  Actions were originally fixed-
length, which was a bit constraining.  Actions now contain a length field,
which gives them more flexibility.
2008-10-03 16:44:13 -07:00
Ben Pfaff cb91e6efc1 Avoid assertion failure connecting to unsupported remove OpenFlow host.
After increasing the length of an OpenFlow buffer, we need to update the
length in the OpenFlow header.
2008-09-24 09:44:08 -07:00
Ben Pfaff 84f7d34079 Make it easier to bootstrap the PKI for SSL connections in OpenFlow. 2008-09-16 16:06:45 -07:00
Ben Pfaff f593e3ab70 Merge branch "partner", to simplify partner integration. 2008-09-15 15:31:36 -07:00
Ben Pfaff 9c1b16772c Implement OFPT_HELLO simple version negotiation. 2008-09-15 14:29:53 -07:00
Ben Pfaff 553dfa572d Break passive vconns out into separate pvconn routines and data structures.
There really was nothing in common between the active and passive vconns.
This arrangement makes more sense.
2008-09-15 14:29:53 -07:00
Ben Pfaff 9bf3d9301e Zero out otherwise uninitialized padding in make_unbuffered_packet_out().
Found with valgrind.
2008-09-09 14:12:57 -07:00
Ben Pfaff 9e7df18a42 vconn: New function vconn_get_name(). 2008-09-08 10:05:13 -07:00
Ben Pfaff eb0341e711 Rename utility functions to avoid partner namespace conflicts. 2008-09-04 13:53:27 -07:00
Ben Pfaff 5549180a54 Rename struct buffer to struct ofpbuf.
Fixes namespace conflict for partner development.
2008-09-04 13:53:26 -07:00
Ben Pfaff b5e16b0723 Respin "Make vconns keep track of their names and include them in log messages."
This time, leave out the segfaults.
2008-09-04 09:47:05 -07:00
Justin Pettit af04b055a7 Revert "Make vconns keep track of their names and include them in log messages."
This reverts commit a39a2431c1.
2008-09-03 17:43:30 -07:00
Ben Pfaff a39a2431c1 Make vconns keep track of their names and include them in log messages. 2008-09-02 14:28:22 -07:00
Ben Pfaff ab43666b20 vlog: Apply rate-limiting everywhere it seems warranted. 2008-08-26 13:25:21 -07:00
Ben Pfaff 9630e41005 Implement subnet mask matching in OpenFlow. 2008-08-18 14:26:50 -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 37dc29f930 Make vconn_open() consistently set *vconnp to NULL on failure.
Fixes issue #80.
2008-08-07 15:37:44 -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 d7f1e2b535 Drop controller-bound traffic that arrives on the controller's port.
Before, if a hub connected a number of OpenFlow switches and the controller,
then in-band control traffic from one of the OpenFlow switches would be
seen by each of the other switches and forwarded up to the controller as
an ofp_packet_in message.  That message would then be seen by all of the
other OpenFlow switches and also forwarded, and so on in an infinite loop.

This change prevents this situation by keeping secchan from forwarding
ofp_packet_in messages for a packet destined to the controller that
arrives on the port where the controller is located.

This code has at least two weaknesses.  First, if the controller's port
changes, then the flows set up to drop packets will not be deleted.  This
should not be a major problem: if this inadvertently kills a switch's
connection to the controller, then the switch will realize it after it
stops receiving data and re-connect.  Its new connection will have new
flow data and therefore its packets will not be dropped.

Second, the notion of the "controller's port" does not take into account
the possibility of loops in the network topology.  We need spanning tree
protocol for that.
2008-08-07 10:10:11 -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 b803dfadd1 vconn: Allow vconns to delegate to underlying implementations. 2008-07-30 15:43:57 -07:00
Ben Pfaff 17778ffd72 Verify OpenFlow version number in vconn_recv(). 2008-07-23 17:04:15 -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 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 2dc0a37b6b vconn: Add assertions to vconn_send() to check consistency of outgoing messages. 2008-07-18 14:16:40 -07:00
Ben Pfaff 1297ff43df vconn: Add new function vconn_transact() and use it to simplify dpctl.c. 2008-07-18 14:16:38 -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 809743618e New function vconn_get_ip().
The secchan needs to know the IP address of the peer so that it can
handles ARP requests from the controller by itself.
2008-07-18 13:23:23 -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 5aca80fab9 Add --max-idle option to secchan and controller. 2008-06-26 09:26:50 -07:00
Justin Pettit d1d2f3f321 - On flow entries with wildcards, match priority field when doing a "strict" delete.
- Remove group_id from flow entries.
- Show priority when print flow mod messages.
2008-04-29 15:00:28 -07:00
Ben Pfaff f6cae73ec3 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.
2008-04-04 16:22:40 -07:00
Ben Pfaff a14c841f32 Factor out printing the list of available vconns. 2008-04-04 16:22:23 -07:00
Ben Pfaff 8240e9cdc7 Make vconn log all incoming and outgoing OpenFlow packets at debug level. 2008-04-04 16:20:55 -07:00
casado 3f0201adb5 Update copyright on all non-GPL files 2008-03-27 20:12:18 -07:00
Ben Pfaff a9111b6015 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.
2008-03-27 17:50:33 -07:00
Ben Pfaff cf6207b610 Support SSL in secchan and controller. 2008-03-13 15:17:45 -07:00
Martin Casado 468e00132f Initial import 2008-03-04 13:12:53 -08:00