netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Spiteri <kspiteri@ieee.org>
To: netdev@vger.kernel.org
Subject: Re: TCP checksum error on local device
Date: Wed, 09 Jul 2008 17:28:54 +0200	[thread overview]
Message-ID: <4874D936.9020100@ieee.org> (raw)
In-Reply-To: <20080709151019.GG27741@nereid>

Kristof Provost wrote:
> On 2008-07-09 16:34:32 (+0200), Kevin Spiteri <kspiteri@ieee.org> wrote:
>   
>> When I send TCP data from localhost to localhost (either on 127.0.0.1
>> or on the public IP of the machine), the TCP checksum is wrong.
>>
>>     
> I suspect this is intended and expected behaviour. The checksum is quite
> useless as the packet never travels over the network and can't be
> corrupted. 
>   
Probably.

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 transmit code in net/ipv4/ip_output.c seems to mark packets for the
> loopback interface with CHECKSUM_UNNECESSARY.
>   
The same happens when I bind the server socket on the public IP (e.g. 
10.111.110.71:12345) and connect from a socket on the same IP 
(10.111.110.71). But then, although the IP is for device eth0 rather 
than for device lo, the packet still never has to be transmitted and the 
checksum is still unnecessary.
> I guess the connection over loopback still carries the data like you'd
> expect right?
>   
Yes, the data was still received and correct.

Kevin


  reply	other threads:[~2008-07-09 15:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 14:34 TCP checksum error on local device Kevin Spiteri
2008-07-09 15:10 ` Kristof Provost
2008-07-09 15:28   ` Kevin Spiteri [this message]
2008-07-09 15:38     ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4874D936.9020100@ieee.org \
    --to=kspiteri@ieee.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).