Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
$ git clone http://github.com/aaronoroson/SteroidOpenFlowService.git
$ cd SteroidOpenFlowService
$ git submodule init
$ git submodule update
$ cd sos-agent
$ sudo apt-get install clang uuid-dev libxml2-dev -y
$ make

Installing Open vSwitch

At this point, the agent code has been compiled and is ready to go. Before we can use it with the controller, we need to also install Open vSwitch (OVS) on the agent machine. The purpose of OVS is to perform packet header rewrite operations not currently possible on hardware switches.

...

Code Block
languagebash
$ sudo apt-get install pkg-config autoconf automake linux-libc-dev libtool libssl-dev linux-headers-`uname -r` -y
$ sudo wget http://openvswitch.org/releases/openvswitch-2.3.2.tar.gz
$ sudo tar -xvzf openvswitch-2.3.2.tar.gz
$ cd openvswitch-2.3.2
$ ./boot.sh
$ ./configure --with-linux=/lib/modules/`uname -r`/build
$ make
$ sudo make install
$ sudo make modules_install
$ sudo modprobe openvswitch
$ sudo mkdir -p /usr/local/etc/openvswitch/
$ sudo ovsdb-tool create /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema

Running Open vSwitch

The following will need to be started in order to use OVS:

...

These should always be run prior to attempting to use OVS. Without these prerequisite commands, OVS will likely report an error stating something along the lines of "unable to connect to database."

Configuring the Open vSwitch Bridge

The agent code running on the agent machine will communicate with devices on the data plane via an OVS bridge. This will allow us to exert control over the packets traversing to and from the agent. We can use OVS's virtual switch control program to instantiate a bridge:

...

Then, we can set the DPID of the OVS bridge to something that's easier to remember. This is not required; however, it makes it easier to reason with the topology and to debug if necessary. Note that this same DPID should be used when configuring the controller with this agent bridge.

Code Block
languagebash
$ ovs-vsctl set bridge br_ovs other-config:datapath-id=0011223344556677

...

Code Block
languagebash
$ sudo route -n

Running the Agent Software

After all the prior steps are complete, the agent code is ready to run! Running it is very straightforward:

...