0

Say I have Host1 & 2 connected to a router with different speeds.

Host1  <--100 Mbps-->  Router  <--10 Mbps-->  Host2

Host1 sends 10MB of UDP data using nc command to Host2, but the Host2 fails in reassembling fragmented packets and sends ICMP(Time-to-live exceeded/Fragment reassembly time excedded).

When the both ends are 100 Mbps, I don't see any failure and no fragmentation happens.

I tried to avoid fragmentation by following methods

1. Enabling PMTU on destination, router 
        echo 0 > /proc/sys/net/ipv4/ip_no_pmtu_disc
2. Reducing MTU to 576 from 1500

But still fragmentation happens. I can see through wireshark log. Can you please guide me to avoid fragmentation and how to handle this scenario.

Edit:
This is kind of stress scenario from router perspective. I should not change anything on source/destination side.

Jeyaram
  • 101
  • 4

1 Answers1

2

The key issue here is not fragmentation, it is packet loss that happens on a router when its queue fills up. Then some fragments are dropped and you see a reassembly failure.

To avoid fragmentation you should set your packet size on a sending side so that fragmentation would not happen, but even if you'd do so you're likely to see a packet loss in this same scenario because of the speed difference and router's buffer size limits.

You can use socat that allows you to set your packet size with UDP (a feature that netcat does not seem to have, as it just dumps whatever data it has in the buffer into a single packet) and set it so that fragmentation won't happen and observe the results predicted above.

In general the above is a nature of pure UDP that one can only avoid by implementing certain flow-control protocol on top of UDP.

Peter Zhabin
  • 2,276
  • 8
  • 10
  • Thanks for the reply. I don't see any information about packets drops in `/proc/net/snmp` or `/proc/net/udp` of router. Any other place I should be looking for packet drops? At the moment I'm interested in log about packet drops in /var/log at least. – Jeyaram Mar 23 '17 at 15:17
  • Sending side I see offset 0 on all packets in wireshark. i.e sender side there is no fragmentation. only router does fragmentation. – Jeyaram Mar 23 '17 at 16:36