Ask Your Question

How to decode HTTP packets?

asked 2015-04-03 00:05:24 -0700

Bakshi Gulam gravatar image

updated 2015-04-03 00:06:35 -0700

I want to decode the HTTP header inside TCP packet. I used sal.packet.TCP.getRawPayload and stored the result in a byte[]. There were only 20 bytes and when I tried to print it byte by byte (typecasting it to char), I'm getting some non-alphanumeric characters. Can somebody help?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-04 03:57:08 -0700

Dana gravatar image

Do not typecast. Arrays.toString(byte[]); should do the trick.

edit flag offensive delete publish link more


Actually the problem seems to be with OVS switch. Eventhough miss_send_len is set to 0xffff (OFPCML_NO_BUFFER) by ODL, OVS is including only till TCP header in the PacketIn message. There seems to a glitch with sal.packet.TCP too. sal.packet.TCP.getRawPayload is returning TCP options fields.

Bakshi Gulam ( 2015-04-05 02:06:49 -0700 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-04-03 00:05:24 -0700

Seen: 157 times

Last updated: Apr 04 '15