Software Defined Networking
Showing results for 
Search instead for 
Did you mean: 

Re: Packet-In

New Member


I could not find an API for processing Packet-In packets. If my component pushes a flow-rule with action that sends the packet to the controller, how can I get access to this packet and also make sure that other components do not look at the packet?




Re: Packet-In

SDN Controller Programming Guide, page 31 gives some description on listeners. The interface ControllerService [ com.hp.of.ctl ] in apidocs describes how to participate in Packet_In processing.


Not entirely certain if it is possible to prevent other components from listening for specific packets but if you do not want certain components (maybe the built-in Path Daemon) to process packets, you can simply remove them using the web-ui, but I would not recommend it. You can always set a higher prority for your flows so that any flows that are setup by other components are not used by the Open Flow switch.

Trusted Contributor

Re: Packet-In

Hello Ariel,



To make sure other components do not act on the packet, you can  register as packetlistener at higher altitude and return true in your packet listener (see attached code snippet).

This indicates that the packet has been handled by your listener and none of the directors will be able to process the packet. But the observers will still get a copy of the packet.





Re: Packet-In

Hi There,


I've been trying to get your code working and I have been unsuccessful thus far.


What's happening when I try the sample code that you attached is that Eclipse underlines each of the imports for the com.hp.of.* and com.hp.util.* in red and says "The import com.hp.util.ip cannot be resolved" - meaning it's not able to find the classes trying to be imported.


I have run the install-sdk script that comes with the hp-sdn-sdk-2.3.5 folder. What am I doing wrong? What else am I missing?


Re: Packet-In

You need to add all the SDK jars to your build path. Create a lib folder in your Eclipse project's workspace, copy the jars from the SDK folder into it, then do the following: right click on your project in the project explorer > build path > configure build path > click on libraries tab > add jars... > point the selector to your lib folder > click ok and exit back to workspace > let it rebuild. That should resolve your dependency issues within Eclipse at least. Keep in mind that even if Eclipse gives you errors, it may still work fine when compiling with Maven ("mvn clean install").