Egor Lakomkin
Egor Lakomkin

Reputation: 1434

Stabilizing the latency. Many TCP Bad CheckSum packets captured by Wireshark

I am coding some network software and trying to minimize and stabilize the latency. I came up with the thing that in most cases the latency to remote host ( send message and receive the ACK by some protocol ) is about 2 ms, but sometimes there are some fluctuations(instantly goes to 40ms and then back to 2 ms), which i cannot explain( code is pretty simple and straightforward), so i started blaming the network card. First thing I found out through WireShark is that there is a lot of TCP Bad Checksum packets? Is it possible that it is the case? This is the first thing, after all i found out that my intel network card is detected by OS ( Linux SLED 11 ) improperly. lspci command outputs wrong NIC information. How can i fix it? Should I reinstall the driver? If so how can i do it?

Thanks!

Upvotes: 1

Views: 2360

Answers (1)

Karl Bielefeldt
Karl Bielefeldt

Reputation: 49128

Please see here about checksum errors. Checksums are sometimes calculated in hardware by your NIC, so wireshark will see it incorrectly even if it is correct on the wire.

Unless you have a direct point to point network connection, without any routers or switches in between, you aren't going to be able to remove all variation in latency. Even with a direct connection you won't be able to unless you are running a real time operating system on both ends. Queues getting full, memory getting paged in and out, higher priority tasks running, and many other things affect your latency. You need to look into jitter buffers and sliding window protocols if you want to minimize the harmful effects of jitter.

Also, the lspci command shows what chipset is actually detected on the pci bus, and really has nothing to do with the driver it is using. Manufacturers change chipsets occasionally, and they are not always a good match to the brand on the box. Depending on the history of the driver, the name won't necessarily match your expectations. If traffic is passing, you almost certainly are using the right driver.

Upvotes: 4

Related Questions