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


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

Hi,

 

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 ) {

                    LOG.info("FlowRemoved received\n");

                } else if ( ofheader instanceof HelloMessage) {

                    LOG.info("Hello reply received\n");

                } else if ( ofheader instanceof ErrorMessage) {

                    LOG.info("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,

Raksha

Join z.archive.openflowjava-dev@lists.opendaylight.org to automatically receive all group messages.