Commit Graph

74 Commits

Author SHA1 Message Date
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 70cb7e7e05 Fix typo in comment. 2008-07-08 18:48:29 -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 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 5aca80fab9 Add --max-idle option to secchan and controller. 2008-06-26 09:26:50 -07:00
Ben Pfaff fe867d8d71 Add --detach and --pidfile options to daemons. 2008-06-13 13:03:51 -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 b2f43905ea Make in-band communication work. 2008-05-28 10:46:54 -07:00
Ben Pfaff 59ba307325 Make the OFPP_LOCAL port work in the kernel OpenFlow implementation. 2008-05-28 10:46:54 -07:00
Ben Pfaff 711c48de9d Break MAC learning out of controller into library.
This is preparation for use of MAC learning in the secure channel.
2008-05-28 10:46:54 -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
Justin Pettit f8704c4470 Mark the "vlan_eth_header" struct as packed, because it's getting padded on some architectures.
-- Reported by GigaFin --
2008-05-06 22:20:58 -07:00
Justin Pettit 2f009daf82 Clean-up OpenFlow main header a bit. 2008-05-04 21:05:51 -07:00
Ben Pfaff f7bf3916ff Implement aggregate flow statistics in kernel and userspace switches. 2008-05-02 16:58:33 -07:00
Ben Pfaff 4f5b4efc54 Send actions as part of flow statistics messages. 2008-05-02 10:58:53 -07:00
Ben Pfaff 2e12784892 Add max_idle field to flow stats messages. 2008-05-02 10:58:52 -07:00
Justin Pettit 917160e384 - Add priority to flow expiration messages.
- Clear contents of "pad" field port status messages.
2008-05-01 17:11:29 -07:00
Ben Pfaff 3b9c97ee01 Implement new statistics format in kernel and userspace switches.
This change really cuts the muster!
2008-05-01 17:04:44 -07:00
Ben Pfaff 9e6949d69f Drop prototype for function that does not exist. 2008-05-01 17:02:31 -07:00
Ben Pfaff 4c411bcb40 New utility function xmemdup(). 2008-05-01 17:02:31 -07:00
Justin Pettit 66b5c90376 - Add support for OpenFlow error message type.
- Ensure OpenFlow messages fit in 16-bit length field.
2008-04-30 17:38:03 -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 3ee68a5b11 Fix openflow.h compilation with GCC 2.95.
Necessary because older Linux 2.4 releases will only compile with GCC 2.95.
2008-04-29 10:19:36 -07:00
Ben Pfaff b73abcfdc3 Add missing NLM_F flags constants (oops). 2008-04-28 14:16:57 -07:00
Ben Pfaff 9b97611f42 Fix typo in comment. 2008-04-28 13:52:27 -07:00
Justin Pettit 44e9d4f5fc Clean-up related to supporting priorities...mostly suggestions from Ben. 2008-04-26 14:27:32 -07:00
Justin Pettit bfe3b4df89 - Add support for flow entry priorities.
- Fix "flow-add" action for dpctl.
2008-04-26 14:08:41 -07:00
Ben Pfaff 9b45107fb7 Improve list traversal macros.
Make LIST_FOR_EACH[_SAFE] variable take logically correct value upon loop termination.

Also, add regression tests for linked list routines, to ensure that this
change does not break code.

Also, add new macro LIST_FOR_EACH_REVERSE.
2008-04-26 14:03:16 -07:00
Ben Pfaff a3505dd08f Add missing header to Makefile.am. 2008-04-26 09:13:31 -07:00
Ben Pfaff c5f976a78f Get rid of build dependency on netlink-related headers from Linux 2.6.
This fixes userspace program build problems on top of systems with
Linux 2.4 headers.
2008-04-24 16:29:53 -07:00
Justin Pettit fc2925fecf Add priority field to flow_mod...code to support this forthcoming. 2008-04-21 18:13:42 -07:00
Justin Pettit 95a73db4c2 Mark structures as packed that cause alignment problems on architectures like ARM. 2008-04-21 13:46:36 -07:00
Justin Pettit 0d3a0643c4 Switch from "stat" to "stats" everywhere. 2008-04-16 15:38:25 -07:00
Justin Pettit 541d0fee0d - Keep datapath config in host-byte order (and fix a couple of bugs related to this).
- Fix type for "get config" replies.
2008-04-16 14:09:27 -07:00
Justin Pettit 17c21631d5 Use new OpenFlow protocol versioning scheme. 2008-04-16 10:39:21 -07:00
Justin Pettit d485c3f0ce Finish removing references to the MAC table. 2008-04-15 13:42:35 -07:00
Ben Pfaff 6f8d45bf7d Merge remote branch 'repo/master' into stats
Conflicts:

	datapath/table-mac.c
2008-04-15 09:57:38 -07:00
Ben Pfaff d2552c15f3 Make table_id in OpenFlow messages 8 bits, since 255 should be enough.
Suggested by Justin.
2008-04-15 09:56:46 -07:00
Ben Pfaff 0a1a667973 Make duration in ofp_flow_stats a 32-bit quantity (instead of 16).
Otherwise duration is capped at under 24 hours.

Suggested by Justin.
2008-04-15 09:56:41 -07:00
Justin Pettit e28564c5fa Add support for OFPP_TABLE virtual port. 2008-04-11 17:40:05 -07:00
Justin Pettit 0a9024a2d7 Changes based on feedback from GigaFin. 2008-04-10 15:50:25 -07:00