Discussion:
hardware checksum with wm nics
(too old to reply)
6***@6bone.informatik.uni-leipzig.de
2007-07-24 19:31:37 UTC
Permalink
hello,

I am using intel nics with netbsd-3-1 and netbsd-4-beta2 kernel
versions. It seems that the hardware-assisted checksums don't work
correctly.

example (disabled hardware-assisted checksums):
ifconfig wm0:

wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
enabled=0
address: 00:14:22:1d:8b:41
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 139.18.25.35 netmask 0xfffffff8 broadcast 139.18.25.39
inet6 fe80::214:22ff:fe1d:8b41%wm0 prefixlen 64 scopeid 0x1
inet6 2001:638:902:1:214:22ff:fe1d:8b41 prefixlen 64 detached


bash-3.2# tcpdump -vpni wm0 port 22
tcpdump: listening on wm0, link-type EN10MB (Ethernet), capture size 96 bytes
14:58:28.922305 IP (tos 0x0, ttl 127, id 15365, offset 0, flags [DF],
length: 40) 139.18.11.72.2430 > 139.18.25.35.22: . [tcp sum ok] ack
2524156043 win 64243


example (enabled hardware-assisted checksums):
ifconfig wm0
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
enabled=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
address: 00:14:22:1d:8b:41
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 139.18.25.35 netmask 0xfffffff8 broadcast 139.18.25.39
inet6 fe80::214:22ff:fe1d:8b41%wm0 prefixlen 64 scopeid 0x1
inet6 2001:638:902:1:214:22ff:fe1d:8b41 prefixlen 64


bash-3.2# tcpdump -vpni wm0 port 22
tcpdump: listening on wm0, link-type EN10MB (Ethernet), capture size 96 bytes
15:11:16.469732 IP (tos 0x10, ttl 64, id 32065, offset 0, flags [DF],
length: 292, bad cksum 0 (->741a)!) 139.18.25.35.22 > 139.18.25.33.65436:
P 946513:946753(240) ack 1008 win 33580 <nop,nop,timestamp 22 22>

I think the problem only occurs with outgoing packets.

You can simply disable the hardware-assisted checksums, but it would be
nice, if anyone could fix the problem.



Thank you for your efforts
Uwe

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Martin Husemann
2007-07-24 19:35:30 UTC
Permalink
Post by 6***@6bone.informatik.uni-leipzig.de
I think the problem only occurs with outgoing packets.
This is expected - the checksum is filled in later by the hardware and left
0 in the software stack. The adapter fixes the packet before it goes out
on the wire. If you tcpdump on a neighbour machine, you should see correct
checksums.

Martin

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Quentin Garnier
2007-07-24 19:37:23 UTC
Permalink
On Tue, Jul 24, 2007 at 09:31:37PM +0200, ***@6bone.informatik.uni-leipzig.de wrote:
[...]
Post by 6***@6bone.informatik.uni-leipzig.de
bash-3.2# tcpdump -vpni wm0 port 22
tcpdump: listening on wm0, link-type EN10MB (Ethernet), capture size 96 bytes
15:11:16.469732 IP (tos 0x10, ttl 64, id 32065, offset 0, flags [DF],
P 946513:946753(240) ack 1008 win 33580 <nop,nop,timestamp 22 22>
I think the problem only occurs with outgoing packets.
Maybe I'm missing something with the way that thing is supposed to work,
but if the system let the NIC do the checksum calculation, why do you
expect anything but 0 in that field in tcpdump output _on the host_?
--
Quentin Garnier - ***@cubidou.net - ***@NetBSD.org
"You could have made it, spitting out benchmarks
Owe it to yourself not to fail"
Amplifico, Spitting Out Benchmarks, Hometakes Vol. 2, 2005.
Christos Zoulas
2007-07-25 23:23:01 UTC
Permalink
Post by 6***@6bone.informatik.uni-leipzig.de
hello,
I am using intel nics with netbsd-3-1 and netbsd-4-beta2 kernel
versions. It seems that the hardware-assisted checksums don't work
correctly.
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
enabled=0
address: 00:14:22:1d:8b:41
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 139.18.25.35 netmask 0xfffffff8 broadcast 139.18.25.39
inet6 fe80::214:22ff:fe1d:8b41%wm0 prefixlen 64 scopeid 0x1
inet6 2001:638:902:1:214:22ff:fe1d:8b41 prefixlen 64 detached
bash-3.2# tcpdump -vpni wm0 port 22
tcpdump: listening on wm0, link-type EN10MB (Ethernet), capture size 96 bytes
14:58:28.922305 IP (tos 0x0, ttl 127, id 15365, offset 0, flags [DF],
length: 40) 139.18.11.72.2430 > 139.18.25.35.22: . [tcp sum ok] ack
2524156043 win 64243
ifconfig wm0
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
enabled=87<IP4CSUM,TCP4CSUM,UDP4CSUM,TSO4>
address: 00:14:22:1d:8b:41
media: Ethernet autoselect (1000baseT full-duplex)
status: active
inet 139.18.25.35 netmask 0xfffffff8 broadcast 139.18.25.39
inet6 fe80::214:22ff:fe1d:8b41%wm0 prefixlen 64 scopeid 0x1
inet6 2001:638:902:1:214:22ff:fe1d:8b41 prefixlen 64
bash-3.2# tcpdump -vpni wm0 port 22
tcpdump: listening on wm0, link-type EN10MB (Ethernet), capture size 96 bytes
15:11:16.469732 IP (tos 0x10, ttl 64, id 32065, offset 0, flags [DF],
P 946513:946753(240) ack 1008 win 33580 <nop,nop,timestamp 22 22>
I think the problem only occurs with outgoing packets.
You can simply disable the hardware-assisted checksums, but it would be
nice, if anyone could fix the problem.
I think that if you enable checksums tcpdump does not know that they will
be calculated by the nic for outgoing packets so you see the wrong checksum.
We could fix tcpdump to look at the interface flags and DTRT but it does
not seem worth-while.

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Charlie Allom
2007-07-26 11:11:43 UTC
Permalink
Post by Christos Zoulas
I think that if you enable checksums tcpdump does not know that they will
be calculated by the nic for outgoing packets so you see the wrong checksum.
We could fix tcpdump to look at the interface flags and DTRT but it does
not seem worth-while.
How about a note in infconfig(8) near the *csum entries noting this?
having spammed this mailing list before, myself..
--
hail eris
http://rubberduck.com/

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...