Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 40 Next »

Table of Contents

Introduction

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

  • 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

One can download dependencies using a package manager, such as apt-get. To download Java 8, please refer to these instructions. To download remaining dependencies for Floodlight master and above:

sudo apt-get install build-essential ant mvn python-dev eclipse

To download dependencies for Floodlight v1.2 and below:

sudo apt-get install build-essential openjdk-7-jdk ant mvn 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; 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
  • Eclipse

Note: Want to get started fast? You can use 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.

$ 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
The above uses the master version of Floodlight. To use a specific version, specify the branch in the git step by appending -b <branch-name>.

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

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.

$ ant eclipse

This creates several files: Floodlight.launch, Floodlight_junit.launch, .classpath, and .project. From these you can setup a new Eclipse project.

  • Open eclipse and create a new workspace
  • File -> Import -> General -> Existing Projects into Workspace. Then click "Next".
  • From "Select root directory" click "Browse". Select the parent directory where you placed floodlight earlier.
  • Check the box for "Floodlight". No other Projects should be present and none should be selected.
  • Click Finish.

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:

  • Click Run->Run Configurations
  • Right Click Java Application->New
  • For Name use FloodlightLaunch
  • For Project use Floodlight
  • For Main use net.floodlightcontroller.core.Main
  • Click Apply

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 and Mininet.
  • Start it in VMware Fusion or VirtualBox
  • Login (username is floodlight and password is floodlight)
  • 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:
$ sudo mn --controller=remote,ip=<controller ip>,port=6653 --switch ovsk,protocols=OpenFlow13

Optionally run wireshark over ssh. Listen on "eth0? and filter for packets with "of" names.

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

Next Steps

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

  • No labels