Wednesday, October 26, 2016

FAUCET users list

G√ČANT have kindly set up a new email list for FAUCET users:

https://lists.geant.org/sympa/info/faucet-users



Monday, October 24, 2016

FAUCET V1.2 released

FAUCET V1.2 has just been released, with some important bugfixes when using the version 2 config format (and if you haven't already migrated from v1, you should migrate now as v1 is no longer supported).

FAUCET V1.2 also includes experimental distributed switching support (distributed switching will continue to develop further).

Thursday, October 20, 2016

Experimental stacking and distributed switching support

FAUCET can now do - experimentally - distributed switching.

This means that you can connect a bunch of FAUCET switches together, in an arbitrarily complex topology, and FAUCET will make them behave like one switch.

Many non-SDN switches support "stacking", which uses (usually) proprietary cables to achieve the same end. In FAUCET, they are just Ethernet connections. We administratively declare which connection goes where, and we nominate a switch to be at the root of the topology (by giving it a priority of 1 - in the future we will support more complex ideas).

In this version, distributed switching is very simple - all switches are programmed using an SPF algorithm. There is no need for a spanning tree protocol, because the controller has global visibility and complete control over all the switches. There is no load balancing implemented (yet) and we rely on Ethernet link status for failure detection at the edges (and only at the edges).

However, because FAUCET is open source, we can easily add other algorithms - for example to load balance based on Ethernet destination address. We can also be more clever about link failure detection (for example, we can inject test traffic to detect when a link has been configured on the wrong port).

The following configuration is for the simplest possible layout (two switches, one link).

vlans:
    100:
        name: "avlan"
dps:
    f1:
        dp_id: 0x1
        hardware: 'Open vSwitch'
        stack:
            priority: 1
        interfaces:
            1:
                native_vlan: 100
            2:
                native_vlan: 100
            3:
                native_vlan: 100
            4:
                stack:
                     dp: f2
                     port: 4
    f2:
        dp_id: 0x2
        hardware: 'Open vSwitch'
        interfaces:
            1:
                native_vlan: 100
            2:
                native_vlan: 100
            3:
                native_vlan: 100
            4:
                stack:
                     dp: f1
                     port: 4


Thursday, October 13, 2016

Running FAUCET as a systemd controlled service in Ubuntu 16

Ubuntu 16 pushes us towards systemd (https://wiki.ubuntu.com/SystemdForUpstartUsers) to manage services. In a recent installation I used this process to have FAUCET run as a service and have it automatically start on boot. 

There's more than one way to do this (in particular, you can systemd to directly start FAUCET as the correct user, rather than via sudo). We're also working on making this easier.

1. Create a user to run FAUCET as. On my system, I created a user "faucet". 

# useradd faucet

2. Install FAUCET itself. You have a few choices - here are two (pip is the easiest; the git clone will get you the latest development version).
  • pip
# pip install ryu-faucet
  • git
# cd /home/faucet/
# git clone https://github.com/REANNZ/faucet

3. Identify the root of the FAUCET installation faucet.py is in your installation. 

# find / -name faucet.py
/home/faucet/faucet/src/ryu_faucet/org/onfsdn/faucet/faucet.py

In my case, it's /home/faucet/faucet

4. Create a file,/etc/default/faucet,  containing the following. Substitute in the correct values for your FAUCET installation path, and where you want your config files and logs. Don't forget that the log files will need to be writable by the faucet user, so make sure there's a directory faucet can write to.

# path to Ryu manager (likely local)
RYU_MANAGER=/usr/local/bin/ryu-manager
# user to run FAUCET as (must already exist)
FAUCET_USER=faucet
# directory containing FAUCET application code
FAUCET_APP_DIR=/home/faucet/faucet/src/ryu_faucet/org/onfsdn/faucet
# file containing Gauge's custom ryu.conf
FAUCET_RYU_CONF=/home/faucet/faucet/src/cfg/etc/ryu/ryu.conf
# host address FAUCET controller should listen on for OpenFlow switch
FAUCET_LISTEN_HOST=10.0.0.1
# TCP port FAUCET controller should listen on for OpenFlow switch
FAUCET_LISTEN_PORT=6636
# location of FAUCET's configuration file.
FAUCET_CONFIG=/etc/faucet/faucet.yaml
# where FAUCET should log to (directory must exist and be writable by FAUCET_USER)
FAUCET_LOG=/var/log/faucet/faucet.log
# where FAUCET should log exceptions to (directory must exist as above)
FAUCET_EXCEPTION_LOG=/var/log/faucet/faucet_exception.log

5. Create another file, /home/faucet/start-faucet.sh, that will start FAUCET (and don't forget to make it executable):

#!/bin/bash
DEFAULTFILE=/etc/default/faucet
. $DEFAULTFILE
export FAUCET_CONFIG
export FAUCET_LOG
export FAUCET_EXCEPTION_LOG
sudo -E -u $FAUCET_USER $RYU_MANAGER --config-file=$FAUCET_RYU_CONF --ofp-listen-host=$FAUCET_LISTEN_HOST --ofp-tcp-listen-port=$FAUCET_LISTEN_PORT $FAUCET_APP_DIR/faucet.py

6. Create the last file, /etc/systemd/system/faucet.service that defines the FAUCET service:

[Unit]
description="FAUCET OpenFlow switch controller"
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/home/faucet/start-faucet.sh
Restart=always

[Install]
WantedBy=multi-user.target

7. Enable the systemd-networkd-wait-online.service service. This has systemd wait for the network to come up, before trying to start FAUCET:

# systemctl enable systemd-networkd-wait-online.service

8. Enable the FAUCET service you just created:

# systemctl enable faucet

9. Start FAUCET and view its status:

# systemctl start faucet
# systemctl status faucet