MTU path discovery - where are the ICMP responses?

I am doing some experiments with MTU path detection on Linux. As far as I understood from RFC 1191, if a router receives a packet with a non-zero DF bit and the packet cannot be sent to the next host without fragmentation, then the router should delete the packet and send the ICMP message to the original sender.

I created several VMs on my computer and linked them as follows:

VM1 (192.168.100.2) R1 (192.168.100.1, 192.168.150.1) R2 (192.168.150.2, 192.168.200.1) VM2 (192.168.200.2) 

Rx are virtual machines with Linux installed, they have two network interfaces with a static route. Pinging V2 from V1 and vice versa.

 traceroute from 192.168.100.2 to 192.168.200.2 (192.168.200.2) 1 192.168.100.1 (192.168.100.1) 0.437 ms 0.310 ms 0.312 ms 2 192.168.150.2 (192.168.150.2) 2.351 ms 2.156 ms 1.989 ms 3 192.168.200.2 (192.168.200.2) 43.649 ms 43.418 ms 43.244 ms tracepath 192.168.200.2 1: ubuntu-VirtualBox.local 0.211ms pmtu 1500 1: 192.168.100.1 0.543ms 1: 192.168.100.1 0.546ms 2: 192.168.150.2 0.971ms 3: 192.168.150.2 1.143ms pmtu 750 3: 192.168.200.2 1.059ms reached 

Segments 100.x and 150.x have MTU 1500. Segment 200.x has MTU 750.

I am trying to send UDP packets with DF enabled. The fact is that VM1 does not send a packet at all if the packet size is more than 750 (I get an EMSGSIZE error for calling send ()).

However, I expect this behavior for packets larger than 1500. And I expect VM1 to send packets from 750 to 1500 in R1, and R1 (or R2) will drop such packets and return the ICMP packet to VM1. But this does not happen.

There are two questions:

1) Why?

2) Is it possible to configure my virtual network to receive ICMP packets in accordance with RFC 1191?

Thanks.

+4
source share
1 answer

It is possible that VM1 has cached PMTU information. By default, the timeout for these cache entries is 10 minutes. You can change the timeout by writing to / proc / sys / net / ipv 4 / route / mtu_expires (in seconds).

For your experiment, try clearing the cache (by removing the PMTU cache) before sending 1500 byte packets:

 echo "0" > /proc/sys/net/ipv4/route/flush 

You will receive an ICMP fragmentation message that again populates the PMTU record for this destination! Therefore, you will need to continue flushing this cache before repeating the experiment.

+6
source

All Articles