raptor
raptor

Reputation: 51

Length of OF_packet_data exceeding total length of OF_IN_packet

I am parsing openflow packets using java by opening 6633 port and listening to OF packets.

My code is breaking for some openflow PACKET_IN packets. See the following image.


I am simulating topology using mininet.

mn --mac --switch ovsk,protocols=OpenFlow13 --controller remote,ip=172.23.107.166,port=6633 --ipbase=2.2.2.0/24 --topo linear,10

Mininet vesion: 2.2.1rc1

Openvswitch version: 2.0.2


Following is the screenshot of wireshark capture.

enter image description here


You can observe that Total Length (342) is exceeding Length (170).

Because of this my java code is parsing extra packet bytes (because of inappropriate data length:342) i.e. bytes from next packet, thereby the following packets parsed are being corrupted.

It should stop parsing after reading 170 bytes. And then parsing for next of packet should start.

Can you explain why is this happening?

Upvotes: 1

Views: 638

Answers (1)

Christopher Maynard
Christopher Maynard

Reputation: 6284

The TCP segment length of 170 bytes is just that - the number of bytes in the current segment. Since the openflow total length is 342 bytes, its data spans multiple TCP segments, so your java code needs to be able to deal with this.

Upvotes: 1

Related Questions