maximum transmission unit (MTU)
What is the maximum transmission unit (MTU)?
The maximum transmission unit (MTU) is the largest size frame or packet -- in bytes or octets (eight-bit bytes) -- that can be transmitted across a data link. It is most used in reference to packet size on an Ethernet network using the Internet Protocol (IP).
MTU and packet fragmentation
Each device in a network has a maximum transmission unit size that it can receive and transmit. The MTU of the next receiving device is determined before sending a packet to it. If the packet is too large and the next receiving device cannot accept it, the packet is divided into multiple packets and sent. This is called fragmentation.
Fragmentation is bad for performance, as it adds delay and extra data. For best performance, the original sending device's MTU is set as large as possible while still smaller than the MTU of all of the devices in the network between the sender and final receiver. In practice, a transmitting device will not know the MTU of all intermediary devices, but only of the next one in line.
As an analogy, think of MTU as the maximum weight that can be shipped as a single package. Imagine a company needs to ship 1 ton of goods to another company. The sending company has a big warehouse with forklifts and trucks and so does the receiving company. Therefore, the entire shipment is put into one large pallet and sent as single shipment, or packet. This is like using a large MTU with all devices supporting it. It is very efficient.
Now imagine the sending company needed to send a 1-ton shipment to a small store serviced by only a mail carrier with a small van. If they sent the whole shipment on a single large pallet, at some point the large pallet would need to be broken down and placed in smaller boxes to fit in the van so it can be carried. This is like when a packet of data needs to be fragmented because the sending MTU is too large for one of the intermediary devices. It would be more efficient if the original sender set the MTU appropriately than having it fragmented by an intermediary device.
Only IPV4 allows packet fragmentation. If a packet larger than the MTU is sent over IPv4, it will be automatically fragmented unless the do-not-fragment flag is set. IPv6 does not allow fragmentation. If a packet size exceeds the MTU in IPv6, it will be dropped.
Types of maximum transmission units
Ethernet MTU
The Ethernet frame is on Layer 2 of the Open Systems Interconnection (OSI).The standard size MTU for Ethernet is 1,500 bytes. This does not include the Ethernet header of 18 or 20 bytes, and is the theoretical maximum amount of data that can be transmitted by the physical link. The MTU of any higher-level protocols must fit within this MTU.
IP MTU
The IP protocol is on Layer 3 of the OSI model. The size of the IP MTU packet size can be configured independent of the Ethernet frame size. But because it is carried by Ethernet, it must be smaller than the Ethernet MTU.
The IP MTU is the total size of all information that is included with the packet. This includes the header, and the data payload to transmit. The IP and TCP header takes 40 bytes. To return to the package illustration, imagine the most weight that the forklift can move is 1,500 pounds. This includes the weight of the pallet of 40 pounds, so the most weight of cargo that can be sent is 1,460 pounds.
If there is an additional intermediary protocol applied during transit, such as GRE, IPsec, PPPoE or SNAP (Subnetwork Access Protocol), it is not included in the MTU of the sender but must be considered during network design to not go over an intermediary device's MTU. For example, imagine an organization set the MTU to the highest value of 1,500 bytes, but it needs to go over a VPN secured by IPsec. IPsec will add some additional data to the packet for the encryption to work, but this pushes the total packet size over 1,500 bytes so the packet needs to be fragmented.
Imagine the warehouse in our illustration needed to secure the shipment in a locked container. If the additional weight of the locked container was not taken into account, the total weight of the cargo (data payload), pallet (IP header) and locked container (IPsec) could become higher than the total weight the forklift can support (device MTU).
Maximum segment size (MSS) and MTU
The maximum segment size (MSS) is the size of the payload in an IP packet. It is, effectively, the most data that senders can transmit without exceeding the MTU.
MSS can be calculated by subtracting the header size from the IP MTU. It is on Layer 4 of the OSI model.
Jumbo frames and maximum transmission unit
Jumbo frames are when the Ethernet MTU is larger than the standard 1,500 bytes. This may be possible on fast Ethernet links, such as with a gigabit LAN, and can be as large as 9,000 bytes. Using jumbo packets can reduce the overhead and increase efficiency of data transmission.
Jumbo frame packet size is vendor specific and (certainly) not guaranteed over the internet. So, the use of jumbo frame MTU is usually reserved for dedicated specialized networks such as in a storage area network (SAN).
Path maximum transmission unit discovery
Path MTU discovery (PMTUD) is the process of finding the MTU of all devices in a network that a packet will traverse. By performing PMTUD each device can be appropriately set to avoid fragmentation and dropped frames due to exceeding the MTU of an intermediary device.
The simplest way of performing path MTU discovery is by sending large test packets or pings set to "do not fragment." If they are dropped, then the pings have exceeded the MTU. Decrease the size of the packet until it can traverse the entire path.
In Microsoft Windows, organizations can test MTU with the ping command. Use the -f switch to set "do not fragment" and the -l switch followed by the size in bytes of packet to send. For example: ping www.techtarget.com -f -l 1492
Optimizing maximum transmission units
There is no single best size for IP MTU, as the devices and protocols in the routing path determine MTU. Therefore, adjusting the endpoint MTU should not be approached casually. Most devices can automatically adjust their MTU based on the type of network they are on.
The MTU is optimally set when it is as close to the lowest MTU in the route without going over. If specific constraints are known, then there is value in reducing the MTU.
For example, if an organization uses GRE or a VPN, setting an MTU that accounts for the overhead can reduce packet fragmentation. If a specific ISP technology, such as ADSL, imposes additional packet overhead, reducing the endpoint computer MTU to account for it can result in better performance.