Commit Graph
587 Commits
Author SHA1 Message Date
Justin Pettit a835cab0ea Return error message when a flow can't be added due to full tables.
When a flow cannot be added to any tables because they are full, send
a message with type OFPET_FLOW_MOD_FAILED and code OFPFMFC_ALL_TABLES_FULL.
2008-10-13 17:49:45 -07:00
Justin Pettit 96c809cc51 Allow SNAT to build on older (2.6.15) and new (2.6.26) kernels. 2008-10-13 15:45:07 -07:00
Justin Pettit 14c0252da7 When sending error messages, set the length properly. 2008-10-13 14:52:47 -07:00
Ben Pfaff bb7c717c31 rconn: Never report being in failure mode while connected.
Change e10dfcf35, "rconn: Be pickier about what constitutes a successful
connection," caused rconn to consider the connection to have failed even
when we are actually connected until one of several message types was
received.  Unfortunately, that meant that "fail open" would intercept and
discard all messages sent by the controller until one of those messages
was received.  Thus, the controller would never receive a reply to its
feature_request, assume that the connection was busted, and disconnect.
This happened forever, of course.

Fixes bug #242.

Thanks to Reid for reporting this and Dan for help in diagnosis.
2008-10-13 13:56:26 -07:00
Ben Pfaff 0b99d8d4be rconn: Improve log message when peer closes connection. 2008-10-13 13:51:50 -07:00
Justin Pettit 48edfb7cf9 Remove OFPT_TABLE reference. 2008-10-12 00:46:52 -07:00
Justin Pettit 94f287969d Add support for Source-NAT to Linux 2.6 datapaths.
To enable SNAT, run configure with the "--enable-snat" flag.  This has
only been tested with the 2.6.23 kernel...more diverse testing will follow.
Documentation and a cleaner build setup will also be in a future check-in.
2008-10-11 00:30:02 -07:00
Justin Pettit 9073578e38 Free sk_buffs with kfree_skb() instead of just kfree(). 2008-10-10 15:06:43 -07:00
Ben Pfaff e10dfcf357 rconn: Be pickier about what constitutes a successful connection.
When secchan is configured to "fail open" after failing to connect to
a controller for a period of time, it needs a heuristic for what
constitutes a successful connection.  Until now, that heuristic was
simply that when it received an OpenFlow message from the controller
(any OpenFlow message), it considered the connection successful.

However, this is no longer good enough, because NOX performs
admission control on connections after sending a number of OpenFlow
messages, in particular after doing OpenFlow version negotiation and
requesting the switch features (and receiving the reply).  Thus, this
commit adjusts the heuristic by only considering certain OpenFlow
messages to demonstrate that admission control checks have passed and
thus that the connection should be considered successful.

As a fallback, any connection that persists for 30 seconds or longer is
also considered successful.

An alternate and complementary approach (that this commit does not
implement) would be to use an OpenFlow error message to indicate why
the connection is closing.

Fixes bug #239.
2008-10-10 10:13:12 -07:00
Ben Pfaff d7da8505f2 Fix inaccurate log message. 2008-10-10 09:56:13 -07:00
Ben Pfaff 8cfc2d6f69 Update documentation to talk about userspace datapath. 2008-10-09 15:53:05 -07:00
Ben Pfaff a6a94c514f Remove secchan dependence on Netlink for connecting to the datapath. 2008-10-09 15:53:05 -07:00
Ben Pfaff cd13e4cbc5 Make rconn_disconnect() a no-op if already disconnected. 2008-10-09 15:53:05 -07:00
Ben Pfaff 6ef891ae6b New function stp_set_bridge_id() to change the bridge ID of a running STP. 2008-10-09 15:53:05 -07:00
Ben Pfaff b253101bd6 New function dhclient_get_netdev(). 2008-10-09 15:53:05 -07:00
Ben Pfaff 80a28d9455 Implement dhclient_destroy().
This function has always been prototyped in dhcp-client.h, but it had
no users and never got implemented.
2008-10-09 15:53:05 -07:00
Ben Pfaff 3bcc21747f Add support for TAP virtual network devices in netdev. 2008-10-09 15:53:05 -07:00
Ben Pfaff e4e4a6be82 Fix use-after-free error.
rconn_destroy() decrements the n_queued counters that are set up by
rconn_send(), so we need to destroy the rconn before we destroy anything
that used it.

(This system is more error-prone than I imagined.)
2008-10-09 15:53:05 -07:00
Justin Pettit 4d0a329652 Unconditionally set skb->dev in dp_set_origin.
If an invalid port index was used in dp_set_origin, the value of skb->dev
was left unchanged.  This change causes skb->dev to be set to NULL in those
circumstances.  This makes Packet Out and Add Flow messages that use a
buffer id behave like Packet Out without a buffer id.
2008-10-06 15:51:06 -07:00
Justin Pettit dece4bacae Properly set in_port in skb for Flow Mod messages.
When a buffer id is placed in a Flow Mod message, the actions are expected to
be executed against the referenced packet.  The kernel implementation was
not setting the input device to what the controller was telling it to use.
Thanks to Natasha for catching this.
2008-10-06 15:14:52 -07:00
Ben Pfaff f669a5fcc7 In ofp_packet_to_string(), make tcpdump print Ethernet headers also. 2008-10-06 09:52:37 -07:00
Ben Pfaff 1374258f0a Add explanatory comment to make_unix_socket(). 2008-10-06 09:52:30 -07:00
Ben Pfaff 6de5998363 No longer necessary to obtain Ethernet header in netdev_send(). 2008-10-06 09:49:15 -07:00
Ben Pfaff 7e5e638ede New function get_unix_name_len() to simplify code. 2008-10-06 09:44:45 -07:00
Ben Pfaff 0c7eb69007 Make ofp_error() preserve the value of errno. 2008-10-06 09:44:45 -07:00
Ben Pfaff 82b05cb81e Random Ethernet addresses should be private and should not be multicast. 2008-10-06 09:44:45 -07:00
Ben Pfaff 33ec3ab0c8 Fix typo in comment. 2008-10-06 09:44:45 -07:00
Ben Pfaff 22956af80b Fix typo in comment. 2008-10-06 09:44:45 -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
Justin Pettit 650e15903c Properly allocate flow action blocks in user-space switch.
The user-space switch was allocating blocks to hold actions in flows that
did not include the action header.
2008-09-30 14:19:47 -07:00
Justin Pettit 6530561934 Show OpenFlow wire version when pretty printing features reply.
This allows easy detection of version number with "dpctl show".
2008-09-26 15:28:41 -07:00
Justin Pettit 0fab7c69ae Remove kernel datapath unit tests.
The tests haven't been seeing much love and are suffering from bit-rot at
this point.  We're removing them, since we have other ways to test at
this point.
2008-09-26 14:58:33 -07:00
Justin Pettit a3f9fd8581 Added missing header file. 2008-09-26 13:20:29 -07:00
Justin Pettit 06e22ff0fe Modify VLAN actions to support setting both VID and priority.
Stripping VLANs is now done through the OFPAT_STRIP_VLAN action (i.e., you
don't specify a magic value in the generirc VLAN action).  Also, it is now
possible to modify the priority bits associated with the VLAN tag through
the OFPAT_SET_VLAN_PCP action.  The OFPAT_SET_DL_VLAN has been renamed to
OFPAT_SET_VLAN_VID.
2008-09-25 15:00:38 -07:00
Ben Pfaff 4eec1e41ce Remove unused, obsolete attributes from OpenFlow netlink protocol. 2008-09-24 14:09:00 -07:00
Ben Pfaff a53f52b256 Fix typo in comment. 2008-09-24 12:43:23 -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 e24bd9bcb7 Disable STP in secchan by default (but let --stp enable it). 2008-09-23 15:47:33 -07:00
Justin Pettit edf6b85346 Initial checkin of OpenFlow specification LaTeX source.
This version of the specification does not reflect the current checked in
version of OpenFlow.  Checkins that follow should bring them in-line.  The
TeX version of the spec was produced by Brandon Heller.
2008-09-23 15:35:00 -07:00
Ben Pfaff 6a774239db stp: Turn off STP on ports that are disabled or have no link.
Fixes a problem that a port that is disabled via "ifconfig down" does
not come back up properly when it is brought back up again with "ifconfig
up", if STP is enabled.
2008-09-23 11:24:53 -07:00
Justin Pettit a52b6f66fd Cleanup printing of ofp_port_mod a bit. 2008-09-23 11:22:03 -07:00
Ben Pfaff a846b3519b stp: Increase hello time to 2 seconds.
An STP advertisement is sent after every expiry of the hello timer, so
this reduces STP advertisements to once every 2 seconds.

Once a second seemed like too often.

Suggested by Justin.
2008-09-23 09:51:00 -07:00
Justin Pettit 666a53b7f7 Make sure to set 'port_no' in ofp_port_mod messages. 2008-09-22 18:01:39 -07:00
Justin Pettit 77c8eed5b4 First cut of pretty printer of ofp_port_mod messages. 2008-09-22 17:59:50 -07:00
Justin Pettit 902b816539 Fix some old references to OFPPFL_ in comments. 2008-09-22 17:48:06 -07:00
Justin Pettit 9da88ee2ad Modify OpenFlow commands related to ports to be more expressive.
This new OpenFlow message format provides a cleaner interface and greater
detail and control over ports.  It is now possible to see what features
the switch's port is currently configured as having, what it's advertising,
and what it's capable of handling.  It is also possible to return the
features advertised by the port's peer.
2008-09-22 15:18:22 -07:00
Ben Pfaff 35e701d77a Drop port_watcher support for editing ports.
This was only needed for STP, which doesn't need it anymore.
2008-09-19 17:07:47 -07:00
Ben Pfaff 512f02d405 Get rid of per-port STP implemented bits, by reducing OFPP_MAX to 255.
802.1D Spanning Tree Protocol supports a maximum of 255 ports per bridge,
but OpenFlow supported 256, so 1 port had to not implement STP.  This
gets rid of the problem by reducing the maximum number of ports to 255.
2008-09-19 17:07:47 -07:00
Justin Pettit 1400bbb7eb Use device notifier in Linux kernel switch for detecting port status changes.
To report on link status and whether a port is administratively enabled or
disabled, the reference switches poll.  This change uses the Linux kernel's
device notification system, so that polling isn't necessary.
2008-09-19 16:10:28 -07:00
Ben Pfaff 55ecbead39 Add the ability to disable the STP implementation. 2008-09-19 15:37:53 -07:00