Commit Graph
290 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 b4518e78a0 New function netdev_set_etheraddr(). 2008-10-29 13:46:54 -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 b2aec952c7 Add Nicira extension for remote command execution. 2008-10-27 12:58:27 -07:00
Ben Pfaff 9795d7d750 Update manpages to mention new --log-file option.
Move vlog option descriptions into a separate file lib/vlog.man that
is substituted into manpages.

Get rid of individual rules for substituting most files in favor of
a single suffix rule.  Unfortunately this loses the (Emacs-specific)
read-only markings but it simplifies the makefiles.
2008-10-23 14:07:26 -07:00
Ben Pfaff b6eb6bc746 vlog: Add ability to log to an arbitrary file, and following related changes:
* New command-line options for configuring log files, hence:
  - Centralized vlog usage messages.
* New vlogconf action for reopening log files.
* New vlogconf support for specifying a target by pidfile.
2008-10-23 14:07:25 -07:00
Ben Pfaff 278ae88d5f Create rundir, logdir, pkidir at install time. 2008-10-23 14:07:25 -07:00
Ben Pfaff ddbf6040e3 Make pkidir, rundir, logdir modifiable from "configure" command line.
Make "make" behave properly when these are changed by re-running
"configure", by putting their definitions into a generated file that
depends on Makefile.
2008-10-23 14:07:25 -07:00
Ben Pfaff 7014135d8b vlog: Avoid calling any function if nothing will be logged. 2008-10-23 11:09:02 -07:00
Ben Pfaff be0ea769dd Make the format of vlog messages user-configurable. 2008-10-23 11:08:23 -07:00
Ben Pfaff c07c7f5e9e New functions xvasprintf() and strlcpy() and macro va_copy(). 2008-10-23 10:59:42 -07:00
Ben Pfaff 7a7b8e4878 New functions ds_put_uninit(), ds_put_char_multiple(). 2008-10-23 10:59:22 -07:00
Ben Pfaff 26d6b159f3 Make it possible to open more than one vlog client socket at a time. 2008-10-23 10:58:24 -07:00
Ben Pfaff 1f5d2de065 Fix lib/dhparams.c build failure fallout from earlier build system changes. 2008-10-17 09:52:37 -07:00
Ben Pfaff b50bbdf27d Centralize daemon option processing and usage. 2008-10-16 16:16:36 -07:00
Ben Pfaff 61f3824892 Delete trailing whitespace in vlog-socket.c 2008-10-16 13:51:53 -07:00
Ben Pfaff 40a6fb4e18 Hardcode path to tcpdump as /usr/sbin/tcpdump.
Otherwise it won't be found when run as non-root because such users
typically don't have /usr/sbin in $PATH.  (We use tcpdump in a fashion
that doesn't require root privilege.)
2008-10-16 13:48:09 -07:00
Ben Pfaff 4fbcabe104 Revamp build system to make it easier to integrate openflowext. 2008-10-16 11:11:59 -07:00
Ben Pfaff 37c94b45fd Rework STP implementation in controller.
Before, we tried to use the port configuration bits to implement STP; e.g.
if a port was in LISTEN state we turned off sending and receiving frame
other than BPDUs.  Unfortunately this interacts very badly with in-band
control: when the switch connects to the controller, it can be connected
to the controller over a port that is not in FORWARD, and so then the
controller disabled that port, and the connection eventually dropped when
an echo request/reply failed to get through.

Now, we implement STP by querying the flows on the switch and killing
off the ones that STP does not allow.  This works much better because,
although we still kill off the in-band control connection, the in-band
hook in secchan is then able to resurrect it.

--no-stp is still the default since this has not been tested very much.
2008-10-14 16:48:47 -07:00
Ben Pfaff 2c5272bc28 Set DHCP maximum retransmission timeout to 3 seconds in secchan.
This should help discovery complete faster, especially with hops across
multiple OpenFlow switches to the controller.
2008-10-14 16:14:13 -07:00
Ben Pfaff a1aa580282 dhcp-client: Log DHCP messages at higher priority.
Logging DHCP messages sent or received with priority DBG made it hard
to see what was happening.  So log them at priority WARN, but also make
them less verbose at that level since seeing the whole message is not
too useful most of the time.
2008-10-14 16:14:13 -07:00
Ben Pfaff 4040288732 dhcp-client: Fix computation of timeouts.
The "min_timeout" variable maintained by the DHCP client is measured
in seconds from the time the state was entered, but dhclient_wait()
was interpreting it as seconds from now.  This made the DHCP client wait
much longer than necessary in some cases.
2008-10-14 16:14:13 -07:00
Ben Pfaff a948b96315 New routine ofpbuf_put_zeros() to simplify a common code sequence. 2008-10-14 13:31:09 -07:00
Ben Pfaff 4a4424a739 Support up to 0xff00 ports in OpenFlow, without changing the implemented max. 2008-10-14 10:53:27 -07:00
Justin Pettit 4528f887d1 Fix dereference of previously freed data.
Thanks to Masa et al. for catching this.
2008-10-13 23:37:46 -07:00
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
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 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
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 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 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 33ec3ab0c8 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 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 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 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
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