Commit Graph
667 Commits
Author SHA1 Message Date
Ben Pfaff ebf2794ba9 Answer ARP requests from controller directly in secchan.
With in-band control, it can happen that the controller needs to send
out an ARP request to find out the MAC address of the switch.  These
packets are sent as broadcasts, so the secure channel will attempt to
send them back to the controller as ofp_packet_in messages.  Of course,
that won't work, because the controller won't be able to respond to
the ofp_packet_in (because it needs the MAC address of the switch to
do so).

This commit makes the secure channel recognize broadcast ARP packets
that originate from the controller and flood them without passing them
back up to the controller.
2008-07-18 13:23:23 -07:00
Ben Pfaff f81c152daf New function eth_addr_is_zero(). 2008-07-18 13:23:23 -07:00
Ben Pfaff a92ae5b340 New function netdev_arp_lookup().
The secchan needs to handle ARP requests from the controller itself, so
it has to translate the controller's IP address into a MAC address to
allow it to match those packets on dl_src.  (OpenFlow doesn't allow us
to look into ARP packets and match on the encapsulated IP addresses, so
this is the best we can do.)
2008-07-18 13:23:23 -07:00
Ben Pfaff 4532f9cdfb New function rconn_get_ip(). 2008-07-18 13:23:23 -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 e88c18152d Assert on structure sizes in openflow.h.
This causes the build to fail if structures are not the sizes that we
expect.
2008-07-17 09:47:25 -07:00
Ben Pfaff b993fa9c2b Adjust OpenFlow to have same structure layout on 32- and 64-bit platforms.
Pointed out by "Brandon Heller" <brandon.heller@gmail.com>.
2008-07-17 09:47:25 -07:00
Ben Pfaff 21bcd54543 Include date and time in vlog messages. 2008-07-16 15:31:38 -07:00
Ben Pfaff 4f0f7b0316 Add "probe" command to dpctl. 2008-07-15 13:03:33 -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 70cb7e7e05 Fix typo in comment. 2008-07-08 18:48:29 -07:00
Ben Pfaff d6ef9d8ade Fix typo in comment. 2008-07-03 14:11:03 -07:00
Ben Pfaff 18349ee8d6 Fix segfault when SSL_connect or SSL_accept reports an error. 2008-07-01 14:17:41 -07:00
Ben Pfaff 16e4361bd7 Announce fail-open mode more aggressively in secchan.
Without this change, the secure channel announces that it is
entering or exiting fail-open mode only when an OpenFlow
message actually arrives from the local datapath.  Thus,
when no packets arrive on any switch port, the secchan
never enters fail-open mode.  Functionally, this makes no
difference, because there are no packets to switch anyhow
in that case, but it makes the log harder to interpret
since it's unclear whether the controller connection is
actually up.

With this change, the secure channel announcing that it is
entering or exiting fail-open mode is not tied to receiving
a packet on a switch port.  Thus, the log is easier to
interpret.
2008-07-01 11:15:15 -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 88df6edbfa Drop "benchmark" netlink message and "benchmark-nl" dpctl command.
The new OFPT_ECHO_REQUEST and OFPT_ECHO_REPLY OpenFlow messages
have the same functionality and are more general (in that they
are not Netlink-specific).
2008-07-01 10:59:04 -07:00
Ben Pfaff b1411b9c75 Add "benchmark" command to work like "benchmark-nl" with echo requests.
Suggested by Justin.
2008-07-01 10:59:04 -07:00
Ben Pfaff 94b1e7a7de Add "ping" command to dpctl for testing echo requests.
Also may be useful for latency testing.
2008-07-01 10:51:50 -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
Ben Pfaff c44bef2f6e Fix -v, --verbose options to userspace programs.
Now providing an argument to these options works as documented.
2008-07-01 10:51:47 -07:00
Ben Pfaff 85008ef693 Fix typo in user message. 2008-07-01 10:51:47 -07:00
Ben Pfaff 210b2ad921 Fix commit 8bdd107e0 (jiffies linking error) when not running on Red Hat.
From David Erickson <derickso@stanford.edu>.
2008-07-01 09:02:59 -07:00
Justin Pettit 34d507b6a6 Improve flow handling in dpctl.
This makes the handling of defining and printing actions more consistent in
dpctl.  The flow portion of the output of "dump-flows" can now be used as the
input of "add-flows".  Flows can be added on the command line with the new
"add-flow" command.
2008-06-30 23:05:14 -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 91cfc8f5dc Don't allow adding a flow entry with an output port of OFPP_NONE. 2008-06-30 21:41:46 -07:00
David Erickson 8bdd107e04 Fixed a linking collision where jiffies have been backported to kernel
2.6.18-53 which is included in CENTOS 5.1.
2008-06-30 20:27:00 -07:00
Ben Pfaff 89d08b1a17 Modified the naming scheme for hardware tables.
Because of historical string munging during the kernel build process
if you named your hardware table hwtable-something, when it was built
the filename would look appropriate, but the actual module info would change
the internal name to be hwtable_something, thus after an insmod with the filename
you could not perform an rmmod with the same filename. As a result
the naming scheme has been changed to hwtable_NAME, NAME being the hardware
the table supports.

Further, include files in the hardware table should be prefixed with the
folder name, e.g. #include "hwtable_NAME/my_header.h".

Based on commits from David Erickson <derickso@stanford.edu>.
2008-06-26 16:21:18 -07:00
Ben Pfaff f68ad8aecb Don't special-case broadcast packets in in-band mode.
Before, in in-band mode, the secure channel would flood all flows
destined for the broadcast destination when not connected to a
controller.  The rationale was that this allowed for ARP replies
to be forwarded to the local port, so that the secure channel
could obtain the Ethernet address of the controller.  But this
is a false rationale: ARP replies are unicast to the requester,
not broadcast. (Frames unicast to the local port are always handled
by the secure channel.)

Also, even if it were a correct rationale, it would not help in
at least one case: if the controller's Ethernet address has expired
from the ARP cache, but the secure channel's TCP connection to
the controller is still connected, then the secure channel attempt
to ARP would fail, since the broadcast ARP reply would not be
handled by the secure channel (since the secure channel thought
that it was still connected).
2008-06-26 11:52:44 -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 5aca80fab9 Add --max-idle option to secchan and controller. 2008-06-26 09:26:50 -07:00
Justin Pettit 58dc4ead3b Fix VLAN modification action in kernel switch.
A number of errors were uncovered when we actually tried playing with VLAN tags on real traffic.  This fixes endian, sk_buff, and other issues.  Unrelated to VLAN tagging, this also protects some printk calls with net_ratelimit.
2008-06-25 23:22:39 -07:00
Justin Pettit cb5f13f1b9 Add printing of all supported action types. 2008-06-24 16:48:55 -07:00
Ben Pfaff bc96a226a9 Drop "send_openflow_skb: send failed: -3" warning.
This message appeared in the normal course of OpenFlow usage when
a packet arrived on an OpenFlow interface and no secure channel
was running, or if packets arrived too fast for the secure channel
to process them.  It confused more people than it assisted, so drop
it.
2008-06-23 14:08:37 -07:00
Ben Pfaff 62fd5fc447 Implement Debian-based packaging and deployment infrastructure. 2008-06-13 13:36:00 -07:00
Ben Pfaff 07f8d9645c Bring manpages and usage messages up-to-date. 2008-06-13 13:30:39 -07:00
Ben Pfaff 24ff8279e7 Allow priority to be specified in dpctl del-flows command. 2008-06-13 13:30:39 -07:00
Ben Pfaff 72223f2a8b Make flow specifications more general in dpctl:
- More special port names.
- Allow fields to be comma-separated, for use on command line.
- Allow ANY as a synonym for *, to avoid globbing on command line.
2008-06-13 13:30:34 -07:00
Ben Pfaff fe867d8d71 Add --detach and --pidfile options to daemons. 2008-06-13 13:03:51 -07:00
Ben Pfaff e0763dc037 Set fail-open explicitly as default.
It was the default accidentally before, because FAIL_OPEN happened
to have the value 0.
2008-06-13 10:16:58 -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
Justin Pettit 3df9750d38 Fix identification of SNAP packets.
The result of the memcmp that checks whether the OUI is all zeroes was the reverse of what it should have been.  This checkin also removes the masking of the least signficant bit from SAP checks, since it's not need for checking SNAP.

Thanks to Masa and Brandon for catching this.
2008-06-12 20:07:11 -07:00
Ben Pfaff 4a513559a8 Fix "NOHZ: local_softirq_pending 08" message.
Only call netif_rx within an interrupt.
Outside an interrupt, netif_rx_in has to be used.
2008-06-10 14:41:04 -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 494917a9ee Add "fail open" feature to secchan. 2008-06-09 10:35:49 -07:00
Ben Pfaff 7b351ea076 Factor learning switch out of controller into library.
This prepares for adding "fail-open" support to the secchan, which
will require the secchan to act as a learning switch.
2008-06-09 10:27:49 -07:00
Ben Pfaff 8f4da69c16 Only log unprocessed packets in the controller if debugging enabled.
Otherwise OFP_FLOW_EXPIRED messages tend to swamp the console after
a while.
2008-06-09 10:27:49 -07:00
Ben Pfaff 6787fab28f Fix "waiting for of0 to become free" message on deldp.
Thanks to Murphy for help debugging this.
2008-06-05 13:38:09 -07:00
Ben Pfaff 2f90b053c1 Delete unneeded line. 2008-06-04 16:14:39 -07:00