First download Floodlight controller. You may simply download a Floodlight virtual machine (VM) from http://www.projectfloodlight.org/download/.
Alternatively, you may download the source code archive from Floodlight and build it:
$ wget https://github.com/floodlight/floodlight/archive/v1.2.zip
Many open source Java projects such as OpenDaylight and ONOS are built using Apache Maven. You may install Maven in Ubuntu/Debian based systems using the following command:
$ sudo apt-get install maven
Floodlight requires Apache Ant in addition to Apache Maven for its build. You may install Ant using the following command:
$ sudo apt-get install ant
Maven requires Java for its execution. The preceding command will install Java as well. However, if you choose to install Maven by other means, make sure that Java is also correctly installed in your computer prior to installing Maven. Floodlight requires Java 8 for its execution.
Extract the Floodlight ZIP and go to the floodlight-1.2 directory:
$ unzip https://github.com/floodlight/floodlight/archive/v1.2.zip $ cd floodlight-1.2
Now proceed to build Floodlight using Ant:
$ ant Buildfile: /home/pradeeban/programs/floodlight-1.2/build.xml init: [mkdir] Created dir: /home/pradeeban/programs/floodlight-1.2/
target/bin [mkdir] Created dir: /home/pradeeban/programs/floodlight-1.2/
target/bin-test [mkdir] Created dir: /home/pradeeban/programs/floodlight-1.2/
target/lib [mkdir] Created dir: /home/pradeeban/programs/floodlight-1.2/
target/test compile: [javac] Compiling 527 source files to /home/pradeeban/programs/
floodlight-1.2/target/bin [javac] warning: [options] bootstrap class path not set in
conjunction with -source 1.7 [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 warning [copy] Copying 54 files to /home/pradeeban/programs/
floodlight-1.2/target/bin compile-test: [javac] Compiling 90 source files to /home/pradeeban/programs/
floodlight-1.2/target/bin-test [javac] warning: [options] bootstrap class path not set in
conjunction with -source 1.7 [javac] 1 warning dist: [jar] Building jar: /home/pradeeban/programs/floodlight-1.2/
target/floodlight.jar [jar] Building jar: /home/pradeeban/programs/floodlight-1.2/
target/floodlight-test.jar BUILD SUCCESSFUL Total time: 12 seconds
After the successful build, you will find the built floodlight.jar in the floodlight-1.2/target directory. You may run it using the following command:
$ java -jar target/floodlight.jar
Floodlight is quite verbose with its info logs. You will see a lot of logs when it runs. You may run Mininet to connect to it:
$ sudo mn --controller=remote,ip=127.0.0.1 --topo tree,depth=3,fanout=2
The following screenshot shows Floodlight and Mininet in execution. The logs are informative on OpenFlow switches connected and LLDP packets sent to the enabled ports.
You may run Wireshark to listen to the OpenFlow packets:
$ wireshark
You may need to issue the following command to execute Wireshark as a non-root user before running Wireshark:
$ sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap
The following screenshot shows the Wireshark, highlighting an OpenFlow capture: