Subject: Re: TCP checksum error on local device

From: Ben Hutchings <[email-masked]>
Date: Wed, 9 Jul 2008 16:38:38 +0100

Kevin Spiteri wrote:
[...]
> I saw the behaviour as strange because only the segment containing data 
> had an incorrect TCP checksum, all other segments (SYN, SYN ACK, ACKs 
> without data and FIN ACK) had a correct TCP checksum.
> 
> Also, the incorrect checksum field seems to depend on the IP address and 
> the packet length, but not on the port number, sequence/acknowledgement 
> number or data content. Thus, the incorrect checksum is the same when 
> the sample is run repeatedly, it only changes when the data length 
> and/or IP address are changed.
[...]

The TCP/IP stack will unconditionally start calculating a checksum as it
prepares some of the headers.  Then at a later stage it checks the checksum
capability of the destination route/device (checksum calculation may be
offloaded or unnecessary) and decides whether to update the TCP checksum to
include the rest of the packet, including the payload.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.