Do MTU modifications impact both directions?

Viewed 18795

ifconfig 1.2.3.4 mtu 1492

This will set MTU to 1492 for incoming, outgoing packets or both? I think it is only for incoming

5 Answers

There is no doubt that MTU configured by ifconfig impacts Tx ip fragmentation, I have no more comments.

But for Rx direction, I find whether the parameter impacts incoming IP packets, it depends. Different manufacturer behaves differently. I tested all the devices on hand and found 3 cases below.

Test case:

Device0 eth0 (192.168.225.1, mtu 2000)<--ETH cable-->Device1 eth0 (192.168.225.34, mtu MTU_SIZE)

On Device0 ping 192.168.225.34 -s ICMP_SIZE, Checking how MTU_SIZE impacts Rx of Device1.

case 1:

Device1 = Linux 4.4.0 with Intel I218-LM:

When MTU_SIZE=1500, ping succeeds at ICMP_SIZE=1476, fails at ICMP_SIZE=1477 and above. It seems that there is a PRACTICAL MTU=1504 (20B(IP header)+8B(ICMP header)+1476B(ICMP data)).

When MTU_SIZE=1490, ping succeeds at ICMP_SIZE=1476, fails at ICMP_SIZE=1477 and above, behave the same as MTU_SIZE=1500.

When MTU_SIZE=1501, ping succeeds at ICMP_SIZE=1476, 1478, 1600, 1900. It seems that jumbo frame is switched on once MTU_SIZE is set >1500 and there is no 1504 restriction any more.

case 2:

Device1 = Linux 3.18.31 with Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet:

When MTU_SIZE=1500, ping succeeds at ICMP_SIZE=1476, fails at ICMP_SIZE=1477 and above.

When MTU_SIZE=1490, ping succeeds at ICMP_SIZE=1466, fails at ICMP_SIZE=1467 and above.

When MTU_SIZE=1501, ping succeeds at ICMP_SIZE=1477, fails at ICMP_SIZE=1478 and above.

When MTU_SIZE=500, ping succeeds at ICMP_SIZE=476, fails at ICMP_SIZE=477 and above.

When MTU_SIZE=1900, ping succeeds at ICMP_SIZE=1876, fails at ICMP_SIZE=1877 and above.

This case behaves exactly as Edward Thomson said, except that in my test the PRACTICAL MTU=MTU_SIZE+4.

case 3:

Device1 = Linux 4.4.50 with Raspberry Pi 2 Module B ETH:

When MTU_SIZE=1500, ping succeeds at ICMP_SIZE=1472, fails at ICMP_SIZE=1473 and above. So there is a PRACTICAL MTU=1500 (20B(IP header)+8B(ICMP header)+1472B(ICMP data)) working there.

When MTU_SIZE=1490, behave the same as MTU_SIZE=1500.

When MTU_SIZE=1501, behave the same as MTU_SIZE=1500.

When MTU_SIZE=2000, behave the same as MTU_SIZE=1500.

When MTU_SIZE=500, behave the same as MTU_SIZE=1500.

This case behaves exactly as Ron Maupin said in Why MTU configuration doesn't take effect on receiving direction?.

To sum it all, in real world, after you set ifconfig mtu,

sometimes the Rx IP packts get dropped when exceed 1504 , no matter what MTU value you set (except that the jumbo frame is enabled).

sometimes the Rx IP packts get dropped when exceed the MTU+4 you set on receiving device.

sometimes the Rx IP packts get dropped when exceed 1500, no matter what MTU value you set.

... ...

Related