Floodlight Controller Tutorial


Floodlight Controller:

The Floodlight Open SDN Controller is an enterprise-class, Apache-licensed, Java-based OpenFlow Controller and intended to run with standard JDK tools and ant.


  • Easy to set up with minimal dependencies
  • Supports a broad range of virtual and physical  OpenFlow switches
  • Can handle mixed OpenFlow and non- OpenFlow networks.
  • It can manage multiple “islands” of OpenFlow hardware switches
  • Designed to be high-performance


Floodlight master has been updated (on 04/30/16) to Java 8.


  • Java development kit
    • JDK 8 for Floodlight master and above
    • JDK 7 for Floodlight v1.2 and below
  • Ant to build
  • Python development package

-To download  dependencies for Floodlight master and above:

sudo apt-get install build-essential ant maven python-dev

-To download dependencies for Floodlight v1.2 and below:

sudo apt-get install build-essential openjdk-7-jdk ant maven python-dev eclipse

Download And Build:

Floodlight is simple to download from Github and install. The “git clone” step below uses the master version of Floodlight.Type the below command in SDNHub Terminal.

$ git clone git://

If You are having JDK 7 use a specific version, specify the version branch in the “git clone”

$ git clone -b v1.2 git://


After installation complete follow the steps to build floodlight controller.

$ cd floodlight
$ git submodule init
$ git submodule update
$ ant
After build completed successful. Make a directory  floodlight and set root permission for it.
$ sudo mkdir /var/lib/floodlight
$ sudo chmod 777 /var/lib/floodlight

Running Floodlight in the Terminal

Assuming java is in your path, you can directly run the floodlight.jar file produced by ant from within the floodlight directory:

$ java -jar target/floodlight.jar


To Create mininet topology with floodlight remote controller, another terminal run the below command,

$ cd floodlight

$ sudo mn --controlle=remote,ip=,port=6653 --topo=single,3


we created single topology with 3 host 1 switch and one controller. This can be view in the following url. Go to web browser and type,



In topology tab we can see our topology.floodlight7


Switches can be view in switches tab.floodlight8


Hosts are listed in Hosts tab.floodlight9

we can view host separately by xterm in mininet

mininet>xterm h1 h2


ping each other host by ping command with host IP

In node h1 $ ping

In node h2 $ ping



Congrats! Now you can simulate your various topologies with floodlight controllers.



Install all SDN controllers from SDN Hub

Step 1: Download VirtualBox

Before install SDN software’s we need to install VirtualBox.

Download VirtualBox platform packages.

Double click on the .exe file to install VirtualBox.

Step 2:  Download OVA file.

This is a 64-bit Ubuntu 14.04 image (3GB) that has a number of SDN software and tools installed.

  • Controllers : OpenDayLight, ONOS, RYU, Floodlight, Floodlight-OF1.3, POX and Trema
  • Mininet to create and simulate topologies.
  • Pyretic :Python + Frenetic
  • Wireshark 1.12.1
  • JDK 1.8, Eclipse Luna, and Maven 3.3.3


  1. You can directly download the OVA file from this file server: [64-bit | 32-bit]

 Step 3:  Import OVA file into VirtualBox.

To create a new virtual machine for SDN ,you need to start VirtualBox.

For Ubuntu start VirtualBox

open new terminal (by click Ctrl + T) and type virtualboxPicture2

For Windows start VirtualBox

By double clicking the VirtualBox iconwin.png

The oracle VM VirtualBox manager is displayed, as shownvm.png

Import OVA file

File –> Import Appliance…imp.png

You get a import virtual appliance window to choose a virtual appliance file to import…choose.png

select a downloaded  OVA file from file server and click next to install…select.png

Import window will appear please check allocating at least 2 vCPUs and 2GB memory and then click on import…import.png

Import will take time to load please be patient until it complete its loading…loading.png

After importing completed you can get a virtualbox with your SDN virtual appliance…

Please ensure your virtualbox acceleration and network settings… acceleration should be VT-x/AMD-V, Nested paging, PAE/NX and Network adapter should be in NAT.check

Then start the tutorial by clicking start button…start.png

compilation will take some time to compile and open a appliance…2s.png

After process you got a SDN GUI which is having file system, Firefox, Terminal and Eclipse. 3s

Open terminal and check for available controllers in this Hub…

First change to  root mode

ubuntu@sdnhubvm:~$ sudo -s


root@sdnhubvm:~# ls



Congrats! Now you can simulate your topology with various controllers.Try various topologies with various controllers and check out the tutorials and source codes available in this Hub for your future development.

Install the Mininet -SDN Network Simulator

Step 1 : Download Mininet.

Download Mininet herePicture1

Mininet VM Images click here

The VM images are in zipped .ovf format (including .vmdk disk images), and should be usable with any modern x86 virtualization system.

Download VirtualBox click here

Based on your operating system select the appropriate VirtualBox  platform package. After install VirtualBox start virtual machine open new terminal and type virtualbox.Picture2

Step 2 : Install Mininet.

In Oracle VM VirtualBox Manager import mininet ovf file to install mininet in VirtualBox.

File –> Import Appliance..


Browse .ovf by clicking  folder


Click Next


Click Import

Its take some time to install be patient to install… After install you will get a mininet in virtualboxPicture18

Step 3 : To Start Mininet.

Click Start button to start a mininet…Picture3

Which takes some time to start to compile and updates of mininet in VM…Picture4

After mininet started mininet terminal will open it require username and password to start mininet…

Username : mininet             password: mininet


we can’t run our mininet programs with xterm in VM itself, so we need to open mininet in Ubuntu.

Open new Ubuntu terminal to run Mininet… To start mininet in Ubuntu by typing

ssh -Y mininet@


Enter password and get into mininet…Picture7

Step 4 : Working with Mininet.

To Check Mininet is working by the following command.

mininet@mininet-vm:~$ sudo mn


For opening host terminals

mininet> xterm h1 h2


Working with Host terminals. checking with nodes connectivity…

In Node:h2 (To connect server)

root@mininet-vm:~# iperf -s

In Node:h1 (To connect client)

root@mininet-vm:~# iperf -c


We can get nodes details and net details by typing node and net…Picture10

Step 5 : Working with Mininet GUI.

mininet@mininet-vm~$  cd  /mininet/examples

mininet@mininet-vm~ /mininet/examples$ sudo python


You can pick and place the network devices and make a connectivity by blue line and simulate the created network. For Example…Picture14

Setting Network Preferences
Edit ->preferences


 Setting Link Details
Right click on the link ->properties


File-> save to save as a .mn
File ->Export Level 2 script to save as a .py



Congrats! You’ve completed the Mininet installation and few examples. Try out new topology and controllers or check out the more source code available in mininet itself.

Programming with Contiki

Step 1: Download Instant Contiki

Download Instant Contiki here. It is a large file, just over 1GB. When downloaded, unzip the file, place the unzipped directory on the opt.

Step2: Start Instant Contiki

To Start contiki first open the terminal by click Ctrl+t (in Ubuntu)

cd opt/contiki-3.0


” ls ” to view and conform the files inside the contiki


Start Cooja

In the terminal window, go to the Cooja directory:

cd contiki-3.0/tools/cooja

Start Cooja with the command:

ant run


Wait for Simulator to start

When Cooja first starts, it will first compile itself, which may take some time.

When its compiled, it will start with a blue empty window.


Step 3: Run simulation

Create new simulation

Click the File menu and click New simulation….5Click the Create button.


Add motes

Before we can simulate our network, we must add one or more motes. We do this via the Motes menu, where we click on Add motes…. Since this is the first mote we add, we must first create a mote type to add. Click Create new mote type… and select one of the available mote types. For this example, we click Sky mote… to create an emulated Tmote Sky mote type.

Motes–>Add Motes–>Create new mote type–>sky mote…6

Browse and find contiki example /opt/contiki-3.0/examples and select a .c file…

for example am selected /opt/contiki-3.0/examples/collect-view/collect-view.c7

Compile Contiki and the application

Now Cooja will verify that the selected Contiki application compiles for the platform that we have selected. Click the Compile button. This will take some time the first time around, expect it to take a minute at least. The compilation output will show up in the white panel at the bottom of the window.8

Create the mote type

Click the Create button to create the mote type. The window will close.10

Add motes to simulation

Cooja will now ask us if we want to add motes from the newly created mote type to the simulation. We change the number of motes to add in the Number of motes field to 5. And click add motes.11

Start the simulation

We can now see the 5 motes we added to the simulation in the Network window. Click the Start button to start the simulation.13

we can pause the simulation by clicking pause button.14

Collect view : Tools–>collect view–>sky 1

In collect window click start collect button to start collect the mote info…15


Congratulations! We have now created our first Cooja simulation with Contiki nodes that collect packets.

TinyOS 2.x for Ubuntu 12.04 and above

At my point of view Ubuntu is better than Windows for TinyOS. Both Ubuntu and TinyOS are the open source. TOSSIM simulator is available in TinyOS itself.

Installation of the TinyOS 2.x

Need to add the following TinyOS repository addresses into the repository source file to install TinyOS . This can accomplished by editing the file /etc/apt/sources.list as follows:

1. To edit sources.list

$ sudo gedit /etc/apt/sources.list


In this editer add the following three lines at the end of this document


deb lucid main

deb maverick main

deb natty main

Save and close it.

2. Open Terminal (ctrl+alt+t)

$ sudo apt-get update

$ sudo apt-get install tinyos

Then you’re going to a list of the TinyOS version available

3. Run the following command to install TinyOS 2.1.2.

$ sudo apt-get install tinyos 2.1.2

4. Install subversion too…

$ sudo apt-get install subversion

5. This will enable the installation of  the latest MSPGCC tools. We now have to download the latest TinyOS® version from the official repository.

$ sudo svn checkout tinyos-main-read-only

$ sudo cp -R /opt/tinyos-main-read-only /opt/tinyos-2.x

6. close terminal.

7. Open new terminal (ctrl+alt+t)

$ sudo -s

this will ask u for a pwd for root change after enter pwd its entered into root mode. which will replace $ to #

# cd  /opt/tinyos-2.1.2

8. create on .sh file for tinyos-2.1.2

/opt/tinyos-2.1.2#  sudo gedit

copy the following content inside the empty gedit

#! /usr/bin/env bash

# Here we setup the environment

# variables needed by the tinyos

# make system

echo “Setting up for TinyOS 2.1.2 Repository Version”

export TOSROOT=

export TOSDIR=







export TOSROOT

export TOSDIR



save the file and exit.

9. Now repeat the step 8 for tinyos-2.x

# cd  /opt/tinyos-2.x

/opt/tinyos-2.1.2#  sudo gedit

copy the following content inside the empty gedit

#! /usr/bin/env bash

# Here we setup the environment

# variables needed by the tinyos

# make system

echo “Setting up for TinyOS 2.x Repository Version”

export TOSROOT=

export TOSDIR=







export TOSROOT

export TOSDIR



save and exit

10.Open the terminal console and execute the following command:

$ sudo gedit ~/.bashrc

Add the following lines at the end of the .bashrc file.

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.1.2/

#Sourcing the tinyos environment variable setup script

source /opt/tinyos-2.x/

save and exit.

11. Close the terminal and restart the PC.

Now on your new terminal u can see….

Setting up for TinyOS 2.1.2 Repository Version

Setting up for TinyOS 2.x Repository Version

So, We successfully installed tinyos-2.x .