Usage Scenario
When hosts on the same network communicate, the MTU of the network is important to both communication ends. When hosts need to communicate across multiple networks, the smallest MTU on the communication path is most important to both ends. This is because different networks along the communication path have different link-layer MTUs. The minimum MTU on the communication path is called the path MTU.
The path MTU has the following characteristics:
- Uncertainty: During communication, the path MTU of hosts depends on the selected path and thus may change.
- Inconsistency: The path MTUs in the inbound and outbound directions may be inconsistent because the path from the sender to the receiver may be different from the path from the receiver to the sender.
Configuration Impact
After the peer path-mtu-discovery command is run, peers learn the number of bytes of the maximum data packet on a transmission path to prevent packet fragmentation.
The path MTU auto discovery function affects TCP MSS calculation.
- If path MTU auto discovery is not enabled:
- a.On the sending end, the calculation formula of TCP MSS is as follows: MSS = MIN { CFGMSS, MTU-40 }.
- b.On the receive end:
If the device supports SYNCOOKIE, the calculation formula of MSS is as follows: MSS = MIN { MIN { CFGMSS, MTU-40 } , internally-defined MSS value }.
If the device does not support SYNCOOKIE, the calculation formula of MSS is as follows: MSS = MIN { CFGMSS, MTU-40 }.
- After path MTU auto discovery is enabled:
- a.On the sending end, the local MSS value is updated only when the device sends packets in which the MSS value is greater than the path MTU. The calculation formula of TCP MSS is as follows: MSS = MIN { MIN { CFGMSS, MTU-40 }, PMTU-40 }.
- b.On the receive end:
If the device supports SYNCOOKIE, the calculation formula of TCP MSS is as follows: MSS = MIN { MIN { MIN { CFGMSS, MTU-40 }, internally-defined MSS value }, PMTU-40 }.
If the device does not support SYNCOOKIE, the calculation formula of TCO MSS is as follows: MSS = MIN { MIN { CFGMSS, MTU-40 }, PMTU-40 }.
The parameters in the calculation formula are described as follows:
- CFGMSS: MIN { APPMSS, CLICFGMSS }
- a.APPMSS: Specifies the MSS configured using the peer tcp-mss command.
- b.CLICFGMSS: Specifies the maximum MSS configured using the tcp max-mss command.
- MTU-40: Specifies the interface MTU minus 40.
- PMTU-40: Specifies the path MTU minus 40.
- internally-defined MSS value: Specifies an internally-defined MSS value, which can be 216, 460, 952, 1400, 2900, 4900, 7900, or 9500. Upon receipt of a packet, the receive-end device uses the internally-defined MSS which is smaller than but close to the MSS of the received packet.
Precautions
By default, path MTU discovery is disabled on a peer because enabling path MTU discovery by default requires the additional cost. If the MTU is known during network planning, path MTU discovery does not need to be enabled.