This is an implementation of the OpenState switch based on the OpenFlow 1.3 softswitch developed by CPdQ and available at https://github.com/CPqD/ofsoftswitch13. For any information about OpenState please check the home page of the project at http://www.openstate-sdn.org/.
This is an OpenFlow 1.3 compatible user-space software switch implementation. The code is based on the Ericsson TrafficLab 1.1 softswitch implementation, with changes in the forwarding plane to support OpenFlow 1.3.
The following components are available in this package:
ofdatapath
: the switch implementationofprotocol
: secure channel for connecting the switch to the controlleroflib
: a library for converting to/from 1.3 wire formatdpctl
: a tool for configuring the switch from the console
These instructions have been tested on Ubuntu 12.04. Other distributions or versions may need different steps.
For Ubuntu 14.04, please check @castroflavio solution: How to compile on Ubuntu 14.04
The switch makes use of the NetBee library to parse packets, so we need to install it first.
-
Install the following packages:
$ sudo apt-get install cmake libpcap-dev libxerces-c2-dev libpcre3-dev flex bison pkg-config autoconf libtool libboost-dev
-
Download and unpack the source code from: http://www.nbee.org/download/nbeesrc-jan-10-2013.zip
$ wget http://www.nbee.org/download/nbeesrc-jan-10-2013.zip $ unzip nbeesrc-jan-10-2013.zip $ cd nbeesrc-jan-10-2013
2.1 If you're running Ubuntu 14.04, before compiling and installing NetBee you need to downgrade the version of bison shipping with your version of Ubuntu:
```
$ wget -nc http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/bison_2.5.dfsg-2.1_amd64.deb \
http://de.archive.ubuntu.com/ubuntu/pool/main/b/bison/libbison-dev_2.5.dfsg-2.1_amd64.deb
$ sudo dpkg -i bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
$ rm bison_2.5.dfsg-2.1_amd64.deb libbison-dev_2.5.dfsg-2.1_amd64.deb
```
-
Create the build system
$ cd src $ cmake .
-
Compile
$ make
-
Add the shared libraries built in
/nbeesrc/bin/
to your/usr/local/lib
directory$ sudo cp ../bin/libn*.so /usr/local/lib
-
Run
ldconfig
$ sudo ldconfig
-
Put the contens of folder
nbeesrc/include
in the/usr/include
$ sudo cp -R ../include/* /usr/include/
Run the following commands in the ofsoftswitch13
directory to build and install everything:
$ ./boot.sh
$ ./configure
$ make
$ sudo make install
-
Start the datapath:
$ sudo udatapath/ofdatapath --datapath-id=<dpid> --interfaces=<if-list> ptcp:<port>
This will start the datapath, with the given datapath ID, using the interaces listed. It will open a passive TCP connection on the given port. For a complete list of options, use the
--help
argument. -
Start the secure channel, which will connect the datapath to the controller:
$ secchan/ofprotocol tcp:<switch-host>:<switch-port> tcp:<ctrl-host>:<ctrl-port>
This will open TCP connections to both the switch and the controller, relaying OpenFlow protocol messages between them. For a complete list of options, use the
--help
argument.
You can send requests to the switch using the dpctl
utility.
-
Check the flow statistics for table 0.
$ utilities/dpctl tcp:<switch-host>:<switch-port> stats-flow table=0
-
Install a flow to match IPv6 packets with extension headers hop by hop and destination and coming from port 1.
$ utilities/dpctl tcp:<switch-host>:<switch-port> flow-mod table=0,cmd=add in_port=1,eth_type=0x86dd,ext_hdr=hop+dest apply:output=2
-
Add a meter:
$ utilities/dpctl tcp:<switch-host>:<switch-port> meter-mod cmd=add,meter=1 drop:rate=50
-
Send flow to meter table
$ utilities/dpctl tcp:<switch-host>:<switch-port> flow-mod table=0,cmd=add in_port=1 meter:1
For a complete list of commands and arguments, use the --help
argument.
The dpctl
utility has some limitations at the moment:
- No support for OXM masks
- No support for multipart messages
- Some set_field action fields are not present
Please submit your bug reports, fixes and suggestions as pull requests on GitHub, or by contacting us directly.
OpenFlow 1.3 Software Switch is released under the BSD license (BSD-like for code from the original Stanford switch).
This project is supported by Ericsson Innovation Center in Brazil. Maintained by CPqD in technical collaboration with Ericsson Research.
Contributions:
Zoltán Lajos Kis, ofsoftswitch 1.1 implementation and guidance for OpenFlow spec related subjects.
Jean Tourrilhes, lots of critical memory bug fixes on table features.
Khai Nguyen Dinh and Thanh Le Dinh, contributions on meter features.
Rich Lane, added the right compiler linker.
yu-iwata, fixed flow deletion without matchin out_port.
Yuval Adler, bug fixes related to matching on vlan and ethertype.
Hiroyasu OHYAMA, correct URL of NetBee Library.
...
"Your name here" -- please, let us know if we forgot to add your name to the list of contributors!
E-mail: Eder Leao Fernandes (ederleaofernandes at gmail . com)