Views
SC09 Demo Reference code
From OpenFlow Wiki
Contents |
Checkout and Installation
This code is being distributed to serve as reference for those interested in applying OpenFlow to circuit switches - particularly hybrid Ethernet/TDM switches. It is NOT meant to re-create the SC09 demo. For that you would need Ciena's CoreDirector switches and their implementation of OpenFlow in their switch OS (or equivalent switches and implementations from other vendors).
The name of the application is Variable Bandwidth Packet Links (or vbpl). It comes packaged with changes to a version of Nox that understands circuit switches (or rather, extensions to the OpenFlow protocol for circuit switches). To checkout vbpl, run
git clone git://gitosis.stanford.edu/vbpl.git nox cd nox git checkout -b vbpl origin/vbpl
If you wish to complie, you would need to install some packages if you have not previously installed NOX (see noxrepo for detailed instructions)
apt-get install autoconf automake1.10 g++-4.2 gcc-4.2 libboost-dev libtool pkg-config \
libboost-filesystem-dev libpcap-dev libssl-dev make python-dev \
python-twisted swig libxerces-c2-dev libboost-serialization-dev \
python-mako libboost-test-dev openssl python-simplejson python-openssl \
libsqlite3-dev
compile in the usual way
./boot.sh ./configure --with-python=`which python2.5` cd src make
To start the controller with the vbpl app, from the src directory
./nox_core -v -i ptcp:6655 vbpl
Your controller is now waiting for switches to register!
Code Overview
Application
The application source code can be found in here: From the src directory
cd nox/coreapps/vbpl
vbpl.hh contains struct declarations for packet and circuit flows as well as the virtual port used to map packet flows to circuit flows. It also contains structs for switch and link elements which make up a switch and topology database respectively. Finally it contains the definition of the Vbpl class.
vbpl.cc implements the member functions of the Vbpl class. Note that since Nox is an event-based system, the vbpl application is basically a set of event handlers for normal OpenFlow events such as datapath_join, datapath_leave, packet_in and port_stats.
vbpl_config.hh presents some configurable parameters for the application and also statically defines the network topology (topo-discovery is coming soon).
vbpl_gui.hh and vbpl_gui.cc use parts of LAVI to talk to the demo GUI front-end (which uses ENVI). The ENVI code for the vbpl app is not included- so we don't discuss this further.
Nox
We do not use a lot of the in-built NOX modules like discovery, topology and routing. We do however use the basic NOX event engine. So the changes to NOX are minimal. The main changes are in
src/include/openflow/openflow/openflow.h
This file defines the OpenFlow protocol and includes extensions to support circuit switching.
Additional changes have been made to NOX's concept of a switch port. The circuit switch ports extend the strcut used for packet switch ports - i.e. ofp_phy_port. These changes can be found in
src/include/port.hh
Lastly for development and debugging support, NOX's in-built pgen feature (packetgen) was used and modified to emulate messages and responses from a hybrid Ethernet/TDM switch. See
src/include/packetgen.hh src/lib/packetgen.cc
To use this feature, start NOX with the following command from the src directory
./nox_core -v -i ptcp:6655 -i pgen:1 vbpl
