Versions Compared

Key

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

This tutorial is for releases v1.0 and later. If you are using v0.91 or earlier, please see the old documentation.

Info

While we try to keep these tutorials as up to date as possible, Floodlight changes quickly so this tutorial may not be 100% accurate. It is highly advised that you learn a little bit of Java and Object Oriented Programming skills if you are not familiar with them.

...

We are going to create a bundle that will watch for new MAC addresses that have not been seen before, and log the MAC and switch they were seen on.

  • Successfully completed the Getting Started tutorial, including setting up Eclipse
  • Mininet installed and running, or a physical OpenFlow switch

Creating The Listener

Add Class In Eclipse

  1. Expand the "floodlight" item in the Package Explorer and find the "src/main/java" folder.
  2. Right-click on the "src/main/java" folder and choose "New/Class".
  3. Enter "net.floodlightcontroller.mactracker" in the "Package" box.
  4. Enter "MACTracker" in the "Name" box.
  5. Next to the "Interfaces" box, choose "Add...".
  6. Add the "IOFMessageListener" and the "IFloodlightModule", click "OK".
  7. Click "Finish" in the dialog.

You should end up with something like this:

...

This assumes you are running Mininet inside a VM on your host, and you are running Floodlight from Eclipse on the host.

Determine your host's IP address relative to Mininet, in the below example it is set as the Gateway (192.168.110.2)

Code Block
mininet@mininet:~$ sudo route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.110.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.110.2 0.0.0.0 UG 0 0 0 eth0

...