Maximum transmission unit

From Wikipedia, the free encyclopedia

In computer networking, the term Maximum Transmission Unit (MTU) refers to the size (in bytes) of the largest packet that a given layer of a communications protocol can pass onwards. MTU parameters usually appear in association with a communications interface (NIC, serial port, etc.). The MTU may be fixed by standards (as is the case with Ethernet) or decided at connect time (as is usually the case with point-to-point serial links). A higher MTU brings higher bandwidth efficiency. However large packets can block up a slow interface for some time, increasing the lag on other packets. For example a 1500 byte packet, the largest allowed by Ethernet (and hence most of the Internet), would block up a 14.4k modem for about one second.

Contents

[edit] IP (Internet Protocol)

The Internet protocol suite was designed to work over many networking technologies. While a host will know the MTU of its own interface and possibly that of its peer (from initial handshakes) it will not initially know what the lowest MTU on the link is and in any case a higher protocol design may require packets of a size larger than the network links support.

To get around this issue IP performs fragmentation, sub-dividing the datagram into pieces, each small enough to pass over a link with a smaller MTU than the original datagram size. This fragmentation takes place at the IP layer (OSI layer 3) and uses the MTU parameter of the network interface that will send the packet out onto the link. The fragmentation process marks the "fragments" of the original packet so that the IP layer of the destination host can reassemble the packets into the original datagram. This method however has a number of drawbacks.

  • When the link MTU is just below the packet size (as is common in tunneling situations), a small fragment will be removed from the end of the packet. So any reduction in MTU size means a doubling in the overhead from IP headers and any lower-layer headers, trailers or inter-packet delays. The number of routing decisions that routers must make is also doubled.
  • As it is normal to make all fragments except the last as big as possible, further fragmentation can easily occur later on in the transmission, increasing the overhead even more.
  • All fragments of a packet must arrive for the higher level protocol to get the packet. Therefore if any fragment is dropped, the entire packet must be resent.

[edit] Path MTU discovery

The Internet Protocol defines the "path MTU" of an Internet transmission path as the smallest MTU of any of the IP hops of the "path" from the source address to the destination address. Or, looked at another way, the "path MTU" defines the largest MTU value that can traverse the "path" without the packets suffering further fragmentation.

RFC 1191 describes "Path MTU discovery", a technique for determining the path MTU between two IP hosts with a view to avoiding IP fragmentation. Path MTU discovery works by setting the DF (Don't Fragment) option in the IP headers of outgoing packets—any device along the path whose MTU is smaller than the packet will drop it, and send back an ICMP "Destination Unreachable (Datagram Too Big)" message containing its MTU, allowing the source host to reduce its assumed path MTU appropriately. The process repeats until the MTU is small enough to traverse the entire path without fragmentation.

Unfortunately, increasing numbers of networks block all ICMP traffic (e.g. to prevent denial-of-service attacks) - this prevents path MTU discovery from working. One often detects such blocking in the cases where a connection works for low-volume data but hangs as soon as a host sends a large block of data at a time (for example, with IRC a client might see up to the nospoof ping but get no response after that, as the large set of welcome messages freezes up the connection). Also, in an Internet Protocol network, the path from the source address to the destination address often gets modified dynamically, in response to various events (load-balancing, congestion, outages, etc.) - this could result in the path MTU changing (sometimes repeatedly) during a transmission, which may introduce further packet drops before the host finds the new safe MTU.

Most modern Ethernet LANs use an MTU of 1500 bytes. But systems like PPPoE will reduce this, causing path MTU discovery to come into effect with the possible effect of making some sites behind badly-configured firewalls unreachable. One can possibly work around this, depending on which part of the network one controls; for example one can change the MSS (maximum segment size) in the initial packet that sets up the TCP connection at one's firewall.

[edit] ATM Backbones

Some providers, particularly those with a telephony background, use the ATM (Asynchronous Transfer Mode) protocol on their internal backbone network. That protocol uses 53 byte packets, 5 of which constitute a header, leaving 48 bytes payload for each packet.

Sometimes you see recommendations to lower the MTU to 1488 or fewer bytes to accommodate ATM backbones better. The rationale behind this is that 1488 = 48 * 31, so you avoid having a 32nd ATM packet only carrying a 4 byte payload and therefore you save some 3% bandwidth on the backbone and get 3% more throughput when the backbone is congested.

However, this is a myth. The calculation ignores several additional overhead components:

yielding a total overhead of 40 or 44 bytes. With an MTU of 1492 bytes, the grand total is 1536 bytes, and this is exactly 32 ATM cells of 48 byte payload each. If the FCS is not present, the last of these 32 ATM cells is 4 bytes short of being completely filled, which is practically insignificant.

Therefore the 1488 byte MTU recommendation is usually wrong and one of the many modern urban myths.

[edit] References