* incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
@ 2007-09-13 17:55 Krzysztof Oledzki
2007-09-23 4:39 ` Herbert Xu
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Oledzki @ 2007-09-13 17:55 UTC (permalink / raw)
To: netdev
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1925 bytes --]
Hello,
It seems that after some not very recent changes udp and tcp packes
carring data send by a loopback have incorrect cksum:
UDP:
# echo test|nc -u 127.0.0.1 1111
# tcpdump -i lo -n -v -v port 1111
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
19:43:39.340576 IP (tos 0x0, ttl 64, id 15179, offset 0, flags [DF], proto: UDP (17), length: 33) 127.0.0.1.49512 > 127.0.0.1.1111: [bad udp cksum 174c!] UDP, length 5
TCP:
# echo test|nc -u 127.0.0.1 1111
tcpdump: listening on lo, link-type EN10MB (Ethernet), capture size 96 bytes
*Correct:
19:44:27.692614 IP (tos 0x0, ttl 64, id 32100, offset 0, flags [DF], proto: TCP (6), length: 60) 127.0.0.1.53804 > 127.0.0.1.1111: S, cksum 0xfd54 (correct), 3426125135:3426125135(0) win 32792 <mss 16396,sackOK,timestamp 1912797227 0,nop,wscale 7>
19:44:27.692674 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto: TCP (6), length: 60) 127.0.0.1.1111 > 127.0.0.1.53804: S, cksum 0xea3f (correct), 3427916955:3427916955(0) ack 3426125136 win 32768 <mss 16396,sackOK,timestamp 1912797227 1912797227,nop,wscale 7>
19:44:27.692711 IP (tos 0x0, ttl 64, id 32101, offset 0, flags [DF], proto: TCP (6), length: 52) 127.0.0.1.53804 > 127.0.0.1.1111: ., cksum 0xd263 (correct), 1:1(0) ack 1 win 257 <nop,nop,timestamp 1912797227 1912797227>
*Incorrect:
19:44:27.692831 IP (tos 0x0, ttl 64, id 32102, offset 0, flags [DF], proto: TCP (6), length: 57) 127.0.0.1.53804 > 127.0.0.1.1111: P, cksum 0xfe2d (incorrect (-> 0xe07c), 1:6(5) ack 1 win 257 <nop,nop,timestamp 1912797227 1912797227>
*Correct:
19:44:27.692859 IP (tos 0x0, ttl 64, id 9399, offset 0, flags [DF], proto: TCP (6), length: 52) 127.0.0.1.1111 > 127.0.0.1.53804: ., cksum 0xd25f (correct), 1:1(0) ack 6 win 256 <nop,nop,timestamp 1912797227 1912797227>
Tested on:
- 2.6.22.6
- 2.6.21.7
- 2.6.20.11
Best regards,
Krzysztof Olędzki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-09-13 17:55 incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22 Krzysztof Oledzki
@ 2007-09-23 4:39 ` Herbert Xu
2007-09-23 21:18 ` Krzysztof Oledzki
0 siblings, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2007-09-23 4:39 UTC (permalink / raw)
To: Krzysztof Oledzki; +Cc: netdev
Krzysztof Oledzki <olel@ans.pl> wrote:
>
> It seems that after some not very recent changes udp and tcp packes
> carring data send by a loopback have incorrect cksum:
This correct. The loopback interfaces has the no checksum flag
set so we only provide a partial checksum on output (i.e., the
pseudoheader without the payload).
We even export this to user-space via a flag. So you should fix
tcpdump to read this flag and ignore the checksum.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-09-23 4:39 ` Herbert Xu
@ 2007-09-23 21:18 ` Krzysztof Oledzki
2007-09-24 1:30 ` Herbert Xu
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Oledzki @ 2007-09-23 21:18 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
[-- Attachment #1: Type: TEXT/PLAIN, Size: 656 bytes --]
On Sun, 23 Sep 2007, Herbert Xu wrote:
> Krzysztof Oledzki <olel@ans.pl> wrote:
>>
>> It seems that after some not very recent changes udp and tcp packes
>> carring data send by a loopback have incorrect cksum:
>
> This correct. The loopback interfaces has the no checksum flag
> set so we only provide a partial checksum on output (i.e., the
> pseudoheader without the payload).
>
> We even export this to user-space via a flag. So you should fix
> tcpdump to read this flag and ignore the checksum.
Thank you for the information. Is there any easy way to turn them on? I
need it for LVS.
Best regards,
Krzysztof Olędzki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-09-23 21:18 ` Krzysztof Oledzki
@ 2007-09-24 1:30 ` Herbert Xu
2007-09-24 9:44 ` Krzysztof Oledzki
0 siblings, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2007-09-24 1:30 UTC (permalink / raw)
To: Krzysztof Oledzki; +Cc: netdev
On Sun, Sep 23, 2007 at 11:18:58PM +0200, Krzysztof Oledzki wrote:
>
> Thank you for the information. Is there any easy way to turn them on? I
> need it for LVS.
Do you really need it? The packets should be checksummed at
the point where they physically leave the host.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-09-24 1:30 ` Herbert Xu
@ 2007-09-24 9:44 ` Krzysztof Oledzki
2007-10-02 10:40 ` Herbert Xu
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Oledzki @ 2007-09-24 9:44 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
[-- Attachment #1: Type: TEXT/PLAIN, Size: 728 bytes --]
On Mon, 24 Sep 2007, Herbert Xu wrote:
> On Sun, Sep 23, 2007 at 11:18:58PM +0200, Krzysztof Oledzki wrote:
>>
>> Thank you for the information. Is there any easy way to turn them on? I
>> need it for LVS.
>
> Do you really need it?
Yes. I would like to use a LVS redirector as both a client and a director:
http://www.austintek.com/LVS/LVS-HOWTO/HOWTO/LVS-HOWTO.LVS-DR.html#director_as_client_in_LVS-DR
> The packets should be checksummed at the point where they physically
> leave the host.
So, with DR mode, packet goes by the lo device (with bad checksum) and
then get redirected outside. Unfortunately, when it leaves host it has bad
checksum, too. :(
Best regards,
Krzysztof Olędzki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-09-24 9:44 ` Krzysztof Oledzki
@ 2007-10-02 10:40 ` Herbert Xu
2007-10-02 14:15 ` Krzysztof Oledzki
0 siblings, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2007-10-02 10:40 UTC (permalink / raw)
To: Krzysztof Oledzki; +Cc: netdev
On Mon, Sep 24, 2007 at 11:44:19AM +0200, Krzysztof Oledzki wrote:
>
> So, with DR mode, packet goes by the lo device (with bad checksum) and
> then get redirected outside. Unfortunately, when it leaves host it has bad
> checksum, too. :(
Did you check this by taking a tcpdump on an external host?
Doing a local tcpdump doesn't work as tcpdump won't show the
correct checksum if checksum offload is enabled.
If it's really sending a bogus checksum then it's a bug in
LVS.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22
2007-10-02 10:40 ` Herbert Xu
@ 2007-10-02 14:15 ` Krzysztof Oledzki
2007-10-02 14:17 ` Herbert Xu
0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Oledzki @ 2007-10-02 14:15 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev
[-- Attachment #1: Type: TEXT/PLAIN, Size: 897 bytes --]
On Tue, 2 Oct 2007, Herbert Xu wrote:
> On Mon, Sep 24, 2007 at 11:44:19AM +0200, Krzysztof Oledzki wrote:
>>
>> So, with DR mode, packet goes by the lo device (with bad checksum) and
>> then get redirected outside. Unfortunately, when it leaves host it has bad
>> checksum, too. :(
>
> Did you check this by taking a tcpdump on an external host?
Yes.
> Doing a local tcpdump doesn't work as tcpdump won't show the
> correct checksum if checksum offload is enabled.
Indeed, I'm aware about this.
> If it's really sending a bogus checksum then it's a bug in
> LVS.
I'm not sure if we should call it a bug. LVS does not support such
configuration by default - it requires kernel patching. However, it worked
with older kernels so that's why I asked if it is possible to force full
TCP/UDP checksum calculation?
Thank you.
Best regards,
Krzysztof Olędzki
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-10-02 14:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-13 17:55 incorrect cksum with tcp/udp on lo with 2.6.20/2.6.21/2.6.22 Krzysztof Oledzki
2007-09-23 4:39 ` Herbert Xu
2007-09-23 21:18 ` Krzysztof Oledzki
2007-09-24 1:30 ` Herbert Xu
2007-09-24 9:44 ` Krzysztof Oledzki
2007-10-02 10:40 ` Herbert Xu
2007-10-02 14:15 ` Krzysztof Oledzki
2007-10-02 14:17 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox