Path MTU discovery
For two hosts communicating across a path of multiple networks, a transmitted packet becomes fragmented if its size is greater than the smallest MTU of any network in the path. Because packet fragmentation can result in reduced network performance, it is desirable to avoid fragmentation by transmitting packets with a size is no greater than the smallest MTU in the network path. This size is called the path MTU.
The operating system supports a path MTU discovery algorithm as described in RFC 1191. Path MTU discovery can be enabled for TCP and UDP applications by modifying the tcp_pmtu_discover and udp_pmtu_discover options of the no command. When enabled for TCP, path MTU discovery will automatically force the size of all packets transmitted by TCP applications to not exceed the path MTU. Because UDP applications themselves determine the size of their transmitted packets, UDP applications must be specifically written to utilize path MTU information by using the IP_FINDPMTU socket option, even if the udp_pmtu_discover no option is enabled. By default, the tcp_pmtu_discover and udp_pmtu_discover are enabled.
When the Path MTU discovery is attempted for a destination, a pmtu entry gets created in a Path MTU (PMTU) table. This table can be displayed using the pmtu display command. Accumulation of pmtu entries can be avoided by allowing unused pmtu entries to expire and be deleted. PMTU entry expiration is controlled by the pmtu_expire option of the no command. pmtu_expire is set to 10 minutes by default.
Since routes can change dynamically, the path MTU value for a path might also change over time. Decreases in the path MTU value will result in packet fragmentation, so discovered path MTU values are periodically checked for decreases. By default, decreases are checked for every 10 minutes, and this value can be changed by modifying the value of the pmtu_default_age option of the no command.
UDP applications will always need to set the IP_DONTFRAG socket option to detect decreases in PMTU. This will enable immediate detection of decreases in Path MTU rather than checking for decreases every pmtu_default_age minutes.
Increases in the path MTU value can result in a potential increase in network performance, so discovered path MTU values are periodically checked for increases. By default, increases are checked for every 30 minutes, and this value can be changed by modifying the value of the pmtu_rediscover_interval option of the no command.
If not all of the routers in the network path support RFC 1191, then it might not be possible to determine an exact path MTU value. In these cases, the mmtu command can be used to add or delete path MTU values that are attempted.
- Path MTU discovery cannot be used on duplicate routes, including those configured for group routing (see Route use restrictions). Path MTU discovery can be used on duplicate routes
- Enabling path MTU discovery sets the value of the arpqsize option of the no command to a minimum value of 5. This value is not decreased if path MTU discovery is subsequently disabled.