Commit Graph
100 Commits
Author SHA1 Message Date
Ben Pfaff 3eeebb50aa Pass --enable-snat to configure for datapath module also. 2008-11-03 16:26:51 -08:00
Ben Pfaff 8872d86328 Make COMMANDS option in openflow-switch defaults file work.
The setting was being accidentally ignored, so commands like "reboot", etc.
would not work at all.
2008-11-03 10:45:38 -08:00
Ben Pfaff f314a833ae Add libncurses5-dev as build dependency for openflow. 2008-10-31 14:14:22 -07:00
Ben Pfaff b5a4509474 Implement log rotation in openflow-switch. 2008-10-31 14:09:53 -07:00
Ben Pfaff 02074909ec Make secchan log to file by default. 2008-10-31 14:09:53 -07:00
Ben Pfaff 77d9bc9026 Add /var/log/openflow directory to openflow-common.
This ensures that every system with OpenFlow packages will have this
directory available for logging.
2008-10-31 14:09:53 -07:00
Ben Pfaff ca7265a956 Send openssl output to logfile on "ofp-pki self-sign" also. 2008-10-31 14:09:53 -07:00
Ben Pfaff bceb2c3912 Don't make ofp-pki --log option relative to log directory.
That behavior may have made sense, but it was too surprising.
2008-10-31 14:09:53 -07:00
Ben Pfaff 8dee5029d8 Put ofp-pki logfile in log directory instead of in pki directory.
This should fix problems with trying to log on a machine that doesn't have
openflow-pki installed (because such machines didn't have the pki
directory).  Every machine needs the log directory.
2008-10-31 14:09:53 -07:00
Ben Pfaff 2e424547ff Fix openflow-datapath-source bugs added in "Simplify debian/rules..." commit. 2008-10-31 14:09:53 -07:00
Ben Pfaff aaab8d4cf0 Add settings for switch netmask and gateway for in-band mode to init script.
Previously we supported setting a switch IP address but not those
parameters, which are obviously required also.
2008-10-31 14:09:53 -07:00
Ben Pfaff 4f76bd3121 Add extension hooks to debian/rules. 2008-10-31 14:09:53 -07:00
Ben Pfaff 480d4a9a7b Move ofp-switch-config into new package openflow-switch-config.
This reduces the openflow-switch package's number of dependencies, making
it easier to install.
2008-10-31 14:09:53 -07:00
Ben Pfaff a662402bac Improve the error message when vconn gets an unexpected version. 2008-10-31 14:09:53 -07:00
Ben Pfaff 6fc8bc9f20 In openflow-switch init script, correct secchan option name. 2008-10-31 14:09:53 -07:00
Ben Pfaff 77171d02d6 In openflow-switch init script, do not re-load openflow_mod if already loaded. 2008-10-31 14:09:53 -07:00
Ben Pfaff 3e2e9b420b Ignore openflow-pki-server directory. 2008-10-31 14:09:53 -07:00
Ben Pfaff b1822e1ff8 Add missing header file to datapath/Modules.mk.
This fixes the generated Debian openflow-datapath-source package.
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 42992b0468 Simplify debian/rules by adding new openflow-datapath-source.install file. 2008-10-30 10:24:36 -07:00
Ben Pfaff 686cd5c3d8 Break HTTP parts of openflow-pki package into new openflow-pki-server package. 2008-10-30 10:24:02 -07:00
Ben Pfaff 60bcda0381 Fix support for out-of-band control in Debian switch init script.
Not tested.
2008-10-29 16:19:43 -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 69133a6b68 Fix parsing of logging options in OpenFlow controller.
Oops.
2008-10-29 13:46:34 -07:00
Ben Pfaff a657b91410 Add "self-sign" command to ofp-pki. 2008-10-29 11:27:57 -07:00
Ben Pfaff 1e777f3381 Fix typo in manpage. 2008-10-29 10:30:36 -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 4fee3e8e11 Delete ununsed file Make.vars. 2008-10-27 16:37:00 -07:00
Ben Pfaff bf3e778844 Add a warning when secchan is invoked with a controller specified as the datapath. 2008-10-27 15:13:11 -07:00
Ben Pfaff b2aec952c7 Add Nicira extension for remote command execution. 2008-10-27 12:58:27 -07:00
Ben Pfaff de5caa4906 Change the secchan "hook" mechanism to be easier to add new callbacks. 2008-10-27 12:58:27 -07:00
Ben Pfaff 9abe7b6f19 Fix typo in default switch config. 2008-10-27 12:58:27 -07:00
Ben Pfaff 18d534b64e Break secchan into multiple files, to make it more maintainable. 2008-10-24 09:43:44 -07:00
Ben Pfaff 7d596723be Controller need not run as root now that we don't use a port below 1024. 2008-10-23 14:22:49 -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 f793b541e2 Introduce logdir (typically /var/log/openflow, by default /usr/local/var/log/openflow). 2008-10-23 14:07:01 -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 49fc472b29 Consistently use AM_CPPFLAGS, not AM_CFLAGS, for -D and -I options. 2008-10-23 10:58:24 -07:00
Ben Pfaff 9246d121a9 Enable SNAT in Debian packages. 2008-10-23 10:58:24 -07:00
Ben Pfaff 73a6f2fbc2 Avoid making Emacs think that this file contains a local variable list. 2008-10-23 10:58:24 -07:00
Ben Pfaff 8478ab12fe Add support for bootstrapping the CA certificate to the Debian packaging. 2008-10-23 10:58:24 -07:00
Ben Pfaff 8c111bc04c No need to pass -DVERSION=... to C compiler: Autoconf puts it into config.h. 2008-10-23 10:58:24 -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 6a8600f5db Add support for packaging openflowext. 2008-10-21 16:31:50 -07:00
Ben Pfaff 016e02cfe7 Avoid leaving Makefile.am and configure.ac slightly modified by boot.sh.
(This turned out to be more annoying than I expected.)
2008-10-17 16:15:34 -07:00
Ben Pfaff 3f43245fa5 Add missing Debian package dependency.
openflow-pki needs ofp-pki, which is openflow-common.

Thanks to Teemu for reporting the problem.
2008-10-17 10:12:17 -07:00
Ben Pfaff cb8737bb72 Modify Makefile.am and configure.ac only if they actually change.
Touching them unnecessarily causes Git to think they changed even if
their contents are the same.
2008-10-17 10:07:21 -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 a01f68212f Fix boot.sh behavior when OpenFlow extensions are not available. 2008-10-16 15:54:52 -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 f248de356e Fix typo in manpage. 2008-10-16 13:46:06 -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 4a7706ed49 secchan: Make sure fail-open doesn't drop the first messages from connection.
Fail-open mode is entered or left in a secchan "periodic" callback, which
may not be called immediately after the connection to the controller
actually comes up.  This can cause the fail-open local-packet CB to
locally handle messages from the datapath and drop them, causing the
controller to think that it's being ignore and drop the connection.

Thanks to Dan for raising the issue.
2008-10-15 15:46:48 -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 0949dc379b secchan: Log switch datapath id at startup. 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 83319dfc65 secchan: Remove unhelpful STP-related log message. 2008-10-14 13:31:09 -07:00
Ben Pfaff 11a8137e64 secchan: Increase max number of local_cbs to accommodate STP. 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
Ben Pfaff e26574fdd9 No problum any more. 2008-10-14 10:17:00 -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
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
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
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
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
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
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