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
- Expand the "Floodlight" item in the Package Explorer and find the "src/main/java" folder.
- Right-click on the "src/main/java" folder and choose "New/Class."
- Enter "net.floodlightcontroller.pktinhistory" in the "Package" box.
- Enter "PktInHistory" in the "name" box.
- Next to the "Interfaces" box, choose "Add..."
- Type "IFloodlightModule" into the search box, and choose "OK."
- Repeat steps above for "IOFMessageListener"
- 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. |
...