aboutsip / pkts

Pure java based pcap library capable of reading and writing to/from pcaps.
Other
196 stars 91 forks source link

Out of order packet processing #146

Closed lordbuddha closed 11 months ago

lordbuddha commented 11 months ago

When processing a TCP stream I manage to extract custom messages from that stream, but at some point I lose the framing of those messages. I see in Wireshark I have out of order packets in the capture and I assume that is what is upsetting my code.

Is there a way of processing the packets in a corrected order ?

jonbo372 commented 11 months ago

pkts.io doesn't have automatic support that re-arranges the TCP stream in the correct order. It merely allows you to read the pcaps and you will have to add custom code to do so. Note: I have a Stream interface that would be the place to add your code (so create a TcpStream) but yeah, I've never had the need myself so therefore I haven't implemented it. Pull requests very much welcome! :-)

lordbuddha commented 11 months ago

Thanks for the answer.

Filtering duplicates would be easy, but no idea how the sequence numbers work.

lordbuddha commented 11 months ago

Ah,,, sequence+length = next sequence...