When configuring SOS, all the switches – whether hardware or software – must be connected to a central Floodlight controller. This controller is equipped with an SOS module that communicates with the four switches and with the SOS agents themselves. The following is a general guide to configure the SOS controller.
Gotchas
- Prior to setting up the controller, consider how you are going to connect each switch to it. The control plane needs to be reliable and accessible to both the switches and the controller itself. A common solution is to host the controller on a public IP using a GENI VM. This will work in most all cases – just point each switch to this public controller IP. An alternative is to use port forwarding on a known and accessible public IP to forward all OpenFlow control plane traffic to the real location of the controller.
- The controller, although relatively stable, is still under development. In between SOS runs/trials/tests, it is recommended you restart the controller.
- At present, the controller does not take into account the capabilities of any hardware switch. As such, flow matches and actions might need to be tweaked in order to ensure use of the switch hardware forwarding path. Conveying this information in a dynamic way is a known problem across the board in OpenFlow and still does not have a foolproof solution. OpenFlow 1.3 introduced table features messages, which allows the switch to inform the controller about most of the capabilities and requirements of each of its flow tables. This feature was recently introduced to Floodlight in late spring 2015 and to OVS around the same time. It has not been extended to SOS yet.
Downloading, Installing, and Running
The SOS controller is hosted on GitHub as a special extended version of Floodlight and can be cloned using git. In a Linux terminal, get the source code:
$ git clone https://github.com/rizard/SOSForFloodlight.git -b sos-13
Then, install any Floodlight prerequisites:
$ sudo apt-get install build-essential default-jdk ant python-dev eclipse
Check to make sure the correct Java version is installed. If it is not, then you need to install Java 7 as appropriate for your machine.
$ java -version
After the prerequisites are installed, change directories into the cloned repository, and build the controller:
$ cd SOSForFloodlight $ ant $ sudo mkdir /var/lib/floodlight $ sudo chmod 777 /var/lib/floodlight
Lastly, you can run the controller at any time by executing the compiled JAR file:
$ java -jar target/floodlight.jar
If you would like to develop or run the controller within Eclipse, refer to these instructions.
To kill the controller (e.g. to stop and restart it), which is simply a Java process, use your favorite way of killing processes.
Setting SOS Module Parameters
The present version of the SOS module in the controller is not very intelligent and thus requires setting some configuration variables prior to running the controller. These variables will define for the controller SOS agent addresses, ports, and other SOS config options.
The file of interest is referred to as floodlightdefault.properties and is located here.
The first large chunk of the file defines a list of modules as a floodlight.modules variable that will be loaded and run when the controller starts up. We want SOS to be run, so make sure the following line is in the list:
net.floodlightcontroller.sos.SOS,\
This will tell the controller to load the SOS module in addition to the rest in the list. Note that the trailing ,\ is only required if the module is not the last one in the list. As an example, notice that without any modification to floodlightdefault.properties, the Floodlight web interface module, last in the list, is missing the comma and backslash. (Also note that net.floodlightcontroller.sos.SOS should be in another properties file that defines the module's existence – this has been done for you though.)
After instructing the SOS module to load with the rest of the Floodlight modules, we need to modify the SOS module's parameters, which are also in floodlightdefault.properties as:
net.floodlightcontroller.sos.SOS.agent-msg-port = 9998 net.floodlightcontroller.sos.SOS.agent-tcp-port = 9877 net.floodlightcontroller.sos.SOS.controller-mac = 00:26:b9:75:1d:45 net.floodlightcontroller.sos.SOS.controller-ip = 192.168.1.5 net.floodlightcontroller.sos.SOS.buffer-size = 512 net.floodlightcontroller.sos.SOS.queue-capacity = 2000 net.floodlightcontroller.sos.SOS.parallel-tcp-sockets = 64 net.floodlightcontroller.sos.SOS.flow-timeout = 15 net.floodlightcontroller.sos.SOS.dst-client-sw-port = 2 net.floodlightcontroller.sos.SOS.src-agent-mac = 02:b0:b6:91:cb:89 net.floodlightcontroller.sos.SOS.src-agent-ip = 10.10.1.2 net.floodlightcontroller.sos.SOS.src-agent-sw-port = 1 net.floodlightcontroller.sos.SOS.src-agent-ovs-port = 1 net.floodlightcontroller.sos.SOS.dst-agent-mac = 02:6b:11:90:99:05 net.floodlightcontroller.sos.SOS.dst-agent-ip = 10.10.2.2 net.floodlightcontroller.sos.SOS.dst-agent-sw-port = 1 net.floodlightcontroller.sos.SOS.dst-agent-ovs-port = 1 net.floodlightcontroller.sos.SOS.src-ntwk-switch-dpid = 00:00:00:00:00:00:00:11 net.floodlightcontroller.sos.SOS.dst-ntwk-switch-dpid = 00:00:00:00:00:00:00:22 net.floodlightcontroller.sos.SOS.src-agent-switch-dpid = 00:00:00:00:00:00:11:11 net.floodlightcontroller.sos.SOS.dst-agent-switch-dpid = 00:00:00:00:00:00:11:22 net.floodlightcontroller.sos.SOS.src-ntwk-sw-port = 3 net.floodlightcontroller.sos.SOS.dst-ntwk-sw-port = 3
The first block of parameters from agent-msg-port to flow-timeout consist mostly of performance-tuning knobs that do not need to be changed under ordinary circumstances. The buffer-size, queue-capacity, and parallel-tcp-sockets parameters are directly related to SOS agent CPU and memory utilization. They can be tuned (raised or lowered) if the agents experience instability, which could be a sign of insufficient hardware resources.
The second small block consists of just a single parameter to configure the destination client called dst-client-sw-port. This is the in-network switch port, which is either an OVS or the physical switch. To set this parameter, ask yourself, "Where (on what switch port number) is the agent machine plugged into the OpenFlow network?"
The third and fourth blocks of parameters define the source and destination agent addresses and locations in the network. We'll use the source agent as an example, but the same settings can be tweaked for the destination agent as well. The src-agent-mac and src-agent-ip variables define the MAC and IP addresses of the source agent, respectively. This is the MAC and IP of the agent machine's network interface used to route traffic into and out of the OpenFlow network. These addresses should belong to the OVS's LOCAL port, exposed as the name you assigned the OVS bridge and visible in ifconfig. Next, there are parameters to set the agent location in the network. The src-agent-sw-port defines, just as was done for the destination client, the location of the source agent in the network. Likewise, src-agent-ovs-port defines the port number leading out of the agent towards the OpenFlow network. This will be the port number of the ethernet interface attached as a port to the OVS bridge.
Lastly, we have a final block of parameters for configuring the datapath IDs (DPIDs) of the involved switches – the in-network physical switches or OVS's and the in-agent OVS's. The src- and dst-ntwk-switch variables set the DPIDs of the in-network switches, while the src- and dst-agent-switch-dpid variables set the OVS DPIDs in each agent. All four of these allow Floodlight to determine the role of each switch upon connection to the controller. The remaining parameters, src- and dst-ntwk-sw-port are the physical switch or OVS ports that lead into the network core. In an SOS deployment, there is a source LAN, a destination LAN, and a black box network in the middle, which is undefined in so long as it is a (logical) layer 2 network. The switch ports from the source and destination side LANs of the SOS deployment leading into this black box should be used here.