Friday, February 26, 2021

UDP Packet Corruption

Hey ya'll, i made a few posts a few months ago asking how to do reliable high rate UDP transmission.

I'm able to now receive data at a high speed from SFP+ fiber connected to another device. Only thing is, i'm getting 99.9% accurate data, and it always seems to corrupt in the same area, usually towards the end of the file transmission.

The device sends me packets, and i dump the entire packet minus the initial 4 byte header into a Memory Mapped File on Windows. I keep track of position for file write and this for the most part is able to assemble the file correctly except towards the end.

I don't get any packet loss on these full dumps, i discard the entire MMF if i get anything less or more than the desired amount of packets. But when i do get the full transmission, towards the end of the file i get random bytes being flipped to 0's, never the case for them to be flipped to 1's. I did a HEX compare and it's strangely always in the same area of the dump.

I don't think there's anything wrong with my algo to store the data since there'd be rampant corruption everywhere and i treat the data the same whether it's at the beginning of the transmission or the end.

My system, Windows 10

Xeon Silvers @ 2.2Ghz

Intel X710 10G adapter

Jumbo frames is set, datagram size is 8400

Method used to catch the data : Registered IO with a 2GB ring buffer, and i dedicate a single thread to polling the receive constantly.



No comments:

Post a Comment