Parsing open-flow packet and decoding the type of the message

Madhava Bangera, Raksha <raksha.madhava.bangera@...>



I would like to parse/decode the openflow packets received from Java sockets. The received openflow packets are in byte[] format and as far as I could understand, it should be converted to OfHeader.


OfHeader ofheader = (OfHeader) msg

if ( ofheader instanceof FlowRemovedMessage ) {

          "FlowRemoved received\n");

                } else if ( ofheader instanceof HelloMessage) {

          "Hello reply received\n");

                } else if ( ofheader instanceof ErrorMessage) {

          "Error message received\n");




1.       Is the above approach right to decode Openflow packets?

2.       What is the best way to convert byte[] received from Java sockets to OfHeader?


Thanks & Regards,


Join to automatically receive all group messages.