Versions Compared

Key

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

Getting Started 
Create from Template
blueprintModuleCompleteKeycom.atlassian.confluence.plugins.confluence-questions:ask-a-space-question-blueprint
contentBlueprintIde4da771a-d1a3-4914-b7f8-1088c0fed594
templateNamee4da771a-d1a3-4914-b7f8-1088c0fed594
buttonLabelAsk a Question

Overview

Table of Contents

Table of Contents
outlinetrue
excludeTable of Contents

Introduction

Tip

Floodlight master has been updated (on 04/30/16) to Java 8. Please make sure you're using the correct JDK for your Floodlight version, as indicated below.

Floodlight is Java-based and intended to run with standard JDK tools and ant and can optionally be run in Eclipse.

Installation

Prerequisites

Linux

  • Ubuntu 10.04 (Natty) or higher.  (Has been run with Ubuntu 10.04 with Ant versions 1.8.1 or lower).
  • Install JDK and Ant. You can optionally choose to install eclipse but it is not required.Your favorite flavor of Linux
  • Java development kit
    • JDK 8 for Floodlight master and above
    • JDK 7 for Floodlight v1.2 and below
  • Ant or Maven to build
  • Python development package
  • Eclipse IDE (Eclipse Luna Preferred)

Floodlight Master and Above

To download Java 8, please refer to these instructions. Please download the latest version of Eclipse, making sure the version you choose supports Java 8. To download remaining dependencies for Floodlight master and above:

Info

Eclipse Luna version is recommended to successfully import Floodlight project. Other Eclipse version would work as well, just people sometimes might have trouble on configuring those versions(most of time, JDK issues and "unresolved compilation problem"). This tutorial is written and tested with Eclipse Luna version so that version is recommended. For Floodlight master branch, you should still ensure to have Java 8 installed in your environment and JDK 1.8 is correctly configured at Eclipse. 


Code Block
xml
xml
sudo apt-get install build-essential ant maven python-dev

Floodlight v1.2 and Below

To download dependencies for Floodlight v1.2 and below:

Code Block
xml
xml
sudo apt-get install build-essential defaultopenjdk-7-jdk ant maven python-dev eclipse

Mac

  • Mac OS X 10.6 or higher: older versions may work but have not been tested
  • Xcode 4.1 (for 10.7 Lion) or Xcode 4.0.2 (for 10.6 Snow Leopard) (includes gcc, make, git, etc.)
  • Java Development Kit: to install, ; just type 'javac' in a Terminal; this should automatically install the JDK if it isn't already present
    • Java 8 for Floodlight master and above
    • Java 7 for Floodlight v1.2 and below
  • Latest version of Eclipse (optional)

Note: Want to get started fast? You can set up an Ubuntu image on Amazon here and add the above Linux dependenciesuse our VM here, which already includes the above dependencies for Floodlight v1.2 and below.

Windows

Floodlight is written in Java, so it should work in Windows; however, specific instructions are not provided aside from this helpful site for using ant on Windows and this helpful site that documents how to use git on Windows. If you wish to use Windows, do so at your own risk or use our Floodlight Linux VM instead.

Download And Build

Floodlight is simple to download from Github and build. Please follow the following steps to either download and install a new copy of Floodlight or update an existing installation of Floodlight:

Installing Floodlight from Scratch

The "git clone" step below uses the master version of Floodlight. To use a specific version, specify the version branch in the "git clone" step by appending "-b <branch-name>", e.g. "-b v1.2".

Code Block
xml
xml
$ git clone git://github.com/floodlight/floodlight.git
$ cd floodlight
$ git submodule init
$ git submodule update
$ ant

$ sudo mkdir /var/lib/floodlight
$ sudo chmod 777 /var/lib/floodlight

Updating an Existing Floodlight Installation

The following steps show how to update Floodlight to master. Substitute "master" in the "git pull" step with your desired version's branch, e.g. "v1.1", "v1.2", etc. if you would like to switch to a different version.

Code Block
languagebash
$ cd floodlight

Note: This uses the master version of Floodlight.

...


$ git pull origin master
$ git submodule init
$ git submodule update

If you are upgrading from Floodlight v1.2 or below to a newer version or the master branch, you should update to Java 8 at this point. Others should already have Java 8 installed or do not require it (if downgrading to v1.2 or below). Once you have satisfied this requirement, proceed with re-building the controller:

Code Block
languagebash
$ ant

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:

Code Block
xml
xml
$ java -jar target/floodlight.jar

Floodlight will start running and print log and debug output to your console. If you would like to save your log, you can redirect it to a file.

...

Eclipse IDE

Developing Floodlight in Eclipse

Its also possible to setup, develop and run Floodlight through Eclipse. Rather than setting up projects manually, its easily to use the Eclipse ant target.

...

You now have a working Eclipse project for Floodlight. You can run the project directly through Eclipse as well. Since we use a dynamic module loading system to run Floodlight, we must configure Eclipse to launch it in the correct manner.

Running Floodlight in Eclipse

Create the FloodlightLaunch target:

...

To then run Floodlight click on the drop-down arrow next to the Play button and select the proper target to run. These also work with debug targets.

Simulating A Network

Now that Floodlight is running, you need to attach it to an OpenFlow network. One of the best tools for this is Mininet, a network simulation tool.

  • Download the Floodlight VM. It includes floodlight running by default Floodlight and Mininet.
  • Start it in VMware Fusion (set up new VM with provided vmdk) or VirtualBox (run floodlightcontroller.vbox.sh, click "Network tab" in VirtualBox GUI and OK before powering up - avoid running script from path with space in name, like "../ VirtualBox VMs/..")
  • Login (username is floodlight and no password is requiredfloodlight)
  • Its possible to run Mininet against the locally running Floodlight (just type "sudo mn") but you can also run it against a remote controller you built as well.  To do that, type:

...

Code Block
xml
xml
$ ssh -X floodlight@<vm-ip>
$ sudo wireshark

Next Steps

If you are finished the getting started guide, you may want to check out Developing Floodlight for Developers, where you will find a few simple coding examplesuseful examples, tutorials, and information to help you get started as a Floodlight developer.