* Udp packets received with improper length
@ 2011-11-23 20:14 paul bilke
2011-11-28 21:23 ` paul bilke
0 siblings, 1 reply; 5+ messages in thread
From: paul bilke @ 2011-11-23 20:14 UTC (permalink / raw)
To: netdev
We recently updated an embedded powerpc platform from 2.6.32 to 2.6.37. When deployed in the field devices with the new kernel have started receiving truncated UDP packets from their mates across noisy links. To test we wrote a simple client and
server. The client sends 512 byte packets with a sequence number to the server listening on a UDP socket. On the client box we use netem to corrupt 100% of the packets sent(after transferring some data so arp cache is populated). The server then
dumps the length received and the serial number from any packets that are received. Netem sometimes corrupts bits in the source MAC address so these packets arrive with valid UDP checksums and are delivered to the user application. With the
server running on the 2.6.32 box we send a few million packets to it and only receive packets that are exactly 512 bytes long. When we do the same on the box running 2.6.37 we receive hundred of short packets, zero length and also 504 byte packets.
When I use TCPdump on the box running 2.6.37 the truncated packets have valid checksums (Source MAC was corrupted by NETEM) and are of proper length (554 byte ethernet frame, 540 Byte IP portion and 520 byte UDP length) but the userland receives 504
or 0 length in recvfrom. To see if this was just a powerpc related issue I repeated the test on x86 virtual machines. A vm running 2.6.18 (Centos 5) receives only 512 byte packets. On a vm running 2.6.40 (Fedora 15) I receive 512, 504 and 0 length
packets.
Below is a hex dump of a packet captured on the 2.6.37 box (its identical on the wire as captured by a probe) but is dispatched to the user application which receives it as a 504 byte packet.
This is problematic in our environment since the IP connectivity is typically a high error rate (Satellite or long haul microwave link).
I did not know if there is a known behavior change that was introduced after 2.6.32 (before .37) that would explain this behavior.
Any ideas what is going on here would be appreciated.
Paul Bilke
00e10c0000fe00115510132808004500
021c00004000401110360a0a0a450a0a
0a43b0971391020875b4323233333400
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Udp packets received with improper length
2011-11-23 20:14 Udp packets received with improper length paul bilke
@ 2011-11-28 21:23 ` paul bilke
2011-12-01 19:11 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: paul bilke @ 2011-11-28 21:23 UTC (permalink / raw)
To: netdev; +Cc: gerrit
On 11/23/2011 2:14 PM, paul bilke wrote:
> We recently updated an embedded powerpc platform from 2.6.32 to 2.6.37. When deployed in the field devices with the new kernel have started receiving truncated UDP packets from their mates across noisy links. To test we wrote a simple client and
> server. The client sends 512 byte packets with a sequence number to the server listening on a UDP socket. On the client box we use netem to corrupt 100% of the packets sent(after transferring some data so arp cache is populated). The server then
> dumps the length received and the serial number from any packets that are received. Netem sometimes corrupts bits in the source MAC address so these packets arrive with valid UDP checksums and are delivered to the user application. With the
> server running on the 2.6.32 box we send a few million packets to it and only receive packets that are exactly 512 bytes long. When we do the same on the box running 2.6.37 we receive hundred of short packets, zero length and also 504 byte packets.
> When I use TCPdump on the box running 2.6.37 the truncate packets have valid checksums (Source MAC was corrupted by NETEM) and are of proper length (554 byte ethernet frame, 540 Byte IP portion and 520 byte UDP length) but the userland receives 504
> or 0 length in recvfrom. To see if this was just a powerpc related issue I repeated the test on x86 virtual machines. A vm running 2.6.18 (Centos 5) receives only 512 byte packets. On a vm running 2.6.40 (Fedora 15) I receive 512, 504 and 0 length
> packets.
<clip>
Reverting commit 81d54ec8479a2c695760da81f05b5a9fb2dbe40a makes this problem disappear. The patch looks sane, the results are problematic.
Paul Bilke
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Udp packets received with improper length
2011-11-28 21:23 ` paul bilke
@ 2011-12-01 19:11 ` David Miller
2011-12-03 2:32 ` Gerrit Renker
0 siblings, 1 reply; 5+ messages in thread
From: David Miller @ 2011-12-01 19:11 UTC (permalink / raw)
To: fsmail; +Cc: netdev, gerrit
From: paul bilke <fsmail@conspiracy.net>
Date: Mon, 28 Nov 2011 15:23:52 -0600
> On 11/23/2011 2:14 PM, paul bilke wrote:
>> We recently updated an embedded powerpc platform from 2.6.32 to 2.6.37. When deployed in the field devices with the new kernel have started receiving truncated UDP packets from their mates across noisy links. To test we wrote a simple client and
>> server. The client sends 512 byte packets with a sequence number to the server listening on a UDP socket. On the client box we use netem to corrupt 100% of the packets sent(after transferring some data so arp cache is populated). The server then
>> dumps the length received and the serial number from any packets that are received. Netem sometimes corrupts bits in the source MAC address so these packets arrive with valid UDP checksums and are delivered to the user application. With the
>> server running on the 2.6.32 box we send a few million packets to it and only receive packets that are exactly 512 bytes long. When we do the same on the box running 2.6.37 we receive hundred of short packets, zero length and also 504 byte packets.
>> When I use TCPdump on the box running 2.6.37 the truncate packets have valid checksums (Source MAC was corrupted by NETEM) and are of proper length (554 byte ethernet frame, 540 Byte IP portion and 520 byte UDP length) but the userland receives 504
>> or 0 length in recvfrom. To see if this was just a powerpc related issue I repeated the test on x86 virtual machines. A vm running 2.6.18 (Centos 5) receives only 512 byte packets. On a vm running 2.6.40 (Fedora 15) I receive 512, 504 and 0 length
>> packets.
> <clip>
>
> Reverting commit 81d54ec8479a2c695760da81f05b5a9fb2dbe40a makes this problem disappear. The patch looks sane, the results are problematic.
I think that commit is buggy. If we do a goto to "try_again", the length has already been
truncated the first time around, so the calculation is not the same as what the original code
calculates
And indeed, checksum errors are how we can end up taking this code path.
I'm reverting.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Udp packets received with improper length
2011-12-01 19:11 ` David Miller
@ 2011-12-03 2:32 ` Gerrit Renker
2011-12-03 2:54 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Gerrit Renker @ 2011-12-03 2:32 UTC (permalink / raw)
To: David Miller; +Cc: fsmail, netdev
Dave, -
| From: paul bilke <fsmail@conspiracy.net>
| Date: Mon, 28 Nov 2011 15:23:52 -0600
|
| > On 11/23/2011 2:14 PM, paul bilke wrote:
| >> We recently updated an embedded powerpc platform from 2.6.32 to 2.6.37. When deployed in the field devices with the new kernel have started receiving truncated UDP packets from their mates across noisy links. To test we wrote a simple client and
| >> server. The client sends 512 byte packets with a sequence number to the server listening on a UDP socket. On the client box we use netem to corrupt 100% of the packets sent(after transferring some data so arp cache is populated). The server then
| >> dumps the length received and the serial number from any packets that are received. Netem sometimes corrupts bits in the source MAC address so these packets arrive with valid UDP checksums and are delivered to the user application. With the
| >> server running on the 2.6.32 box we send a few million packets to it and only receive packets that are exactly 512 bytes long. When we do the same on the box running 2.6.37 we receive hundred of short packets, zero length and also 504 byte packets.
| >> When I use TCPdump on the box running 2.6.37 the truncate packets have valid checksums (Source MAC was corrupted by NETEM) and are of proper length (554 byte ethernet frame, 540 Byte IP portion and 520 byte UDP length) but the userland receives 504
| >> or 0 length in recvfrom. To see if this was just a powerpc related issue I repeated the test on x86 virtual machines. A vm running 2.6.18 (Centos 5) receives only 512 byte packets. On a vm running 2.6.40 (Fedora 15) I receive 512, 504 and 0 length
| >> packets.
| > <clip>
| >
| > Reverting commit 81d54ec8479a2c695760da81f05b5a9fb2dbe40a makes this problem disappear. The patch looks sane, the results are problematic.
|
| I think that commit is buggy. If we do a goto to "try_again", the length has already been
| truncated the first time around, so the calculation is not the same as what the original code
| calculates
|
| And indeed, checksum errors are how we can end up taking this code path.
|
| I'm reverting.
|
You are correct. What I had failed to see is the try_again case with multiple corruped datagrams. In this case the
code is not correct, len could already have been modified in the previous iteration. Reverting the commit is the
sanest option. Thank you.
Gerrit
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Udp packets received with improper length
2011-12-03 2:32 ` Gerrit Renker
@ 2011-12-03 2:54 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2011-12-03 2:54 UTC (permalink / raw)
To: gerrit; +Cc: fsmail, netdev
From: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Date: Fri, 2 Dec 2011 19:32:57 -0700
> You are correct. What I had failed to see is the try_again case with
> multiple corruped datagrams. In this case the code is not correct,
> len could already have been modified in the previous
> iteration. Reverting the commit is the sanest option. Thank you.
Thanks for confirming my analysis.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-12-03 2:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-23 20:14 Udp packets received with improper length paul bilke
2011-11-28 21:23 ` paul bilke
2011-12-01 19:11 ` David Miller
2011-12-03 2:32 ` Gerrit Renker
2011-12-03 2:54 ` David Miller
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).