Versions Compared

Key

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

This tutorial is for Floodlight v1.0 and later. If you need to use Floodlight v0.91 or earlier, you can find the v0.91 and v0.90 documentation here

...

There are a number of different types of OpenFlow messages for which events are generated, but most of the action happens in the PacketIn handlers. A PacketIn message is the OpenFlow message that is sent from the switch to the controller if the switch does not have a flow table rule that matches the packet. The controller is expected to handle the packet and to install any necessary flows table entries (using a set of FlowMod messages). In this tutorial, we'll be adding a new PacketIn listener will store the PacketIn messages. We  will then make these messages available via the REST API.

Creating the Class

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.pktinhistory" in the "Package" box.
  4. Enter "PktInHistory" in the "name" box.
  5. Next to the "Interfaces" box, choose "Add..."
  6. Type "IFloodlightModule" into the search box, and choose "OK."
  7. Repeat steps above for "IOFMessageListener"
  8. Click "Finish" in the dialog.

...

Note

After you complete this tutorial, you should to change the serializer for IOFSwitch back to @JsonSerialize(using=IOFSwitchSerializer.class) in order to restore the original serializer.

...