1

On a peer-to-peer ethernet connection, I saw something that cause me trouble. An application running on a Linux box with Centos 6.4 send successively two UDP packets :

  • 1 big packet : size above the MTU (so it will be fragmented) => MSG1
  • 1 small packet : size below the MTU (no need to fragment it) => MSG2

It's a peer-to-peer connection so there is no switch between sender and the receiver. Here is what the receiver sees:

| Fragm. 1 MSG1 | MSG2 | Fragm. 2 MSG1 |

Even if MSG2 is send after in the application it will be receive before the end of MSG1. Do you where this kind of treatment is made : in the kernel or in the NIC driver ? Is there a way to disable it ?

Update 1 : The receiver is a FPGA without a complete IP stack so it crashes if segments are not contiguous.

Joker
  • 247
  • 3
  • 7
  • What are you using to look at the packets? – Malt Aug 26 '14 at 07:54
  • 1
    It doesn't matter who did it. UDP does not guarantee datagram arrival or ordering. Any network element anywhere is entitled to affect these. – user207421 Aug 26 '14 at 07:59
  • @EJP Actually, the fragmentation occurs at the IP level, so it shouldn't be seen by regular sockets, but only by raw sockets or something like libpcap. – Malt Aug 26 '14 at 08:00
  • @Malt Actually it is irrelevant where it happens. That's the point. As for 'being seen', this particular scenario will cause the second message to be delivered before the first, but so can many other scenarios. – user207421 Aug 26 '14 at 08:02
  • I agree, but it will be invisible at the socket level. At the socket level there might be reordering of udp segments (MSG2 might arrive before MSG1), not of ip fragments. That's why I asked him what he uses to see this reordering. – Malt Aug 26 '14 at 08:04
  • @Malt If the second datagram arrives before the first is complete, it will be delivered first. I don't call that 'invisible'. The fragment order he describes is invisible at the socket level, but not its effect. There is no such thing as a 'UDP segment'. – user207421 Aug 26 '14 at 08:07
  • I agree, the effect will be visible but he clearly stated that he sees a the packets arriving in that order, so I wonder what tool he uses to look at the ordering of the specific packets, because some tools introduce reordering themselves. And "Segment" is the correct term for a transport layer "packet", regardless whether it's TCP, UDP or something lese. – Malt Aug 26 '14 at 08:17

0 Answers0