Tuesday, June 17, 2008

[tcpdump] how to fix the bad checksum problem

If you capture packets using tcpdump directly from the server, your capture file may contain bad checksums. This is because your OS is currently configured to use the hardware checksum offloading feature of the NIC. When this feature is enabled, expecting the NIC to rewrite the checksums, OS doesn't bother to fill (nor to reset) in the checksum fields. The problem is that tcpdump is capturing the packets before the checksums are rewritten by the NIC.

Use the following command to turn off the checksum offloading before using tcpdump (on ubuntu).

sudo ethtool -K eth0 rx off tx off

If you already have a capture file not usable due to the wrong checksums, use the following command to repair the file.

sudo tcpreplay -i eth0 -F -w output.cap input.cap

or

sudo tcprewrite -i input.cap -o output.cap -C

Blogged with the Flock Browser

1 comment:

Anonymous said...

I am able to make link exchange with HIGH pr pages on related keywords like [url=http://www.usainstantpayday.com]bad credit loans[/url] and other financial keywords.
My web page is www.usainstantpayday.com

If your page is important contact me.
please only good pages, wih PR>2 and related to financial keywords
Thanks
epiptoike