What is MTU In Networking?

published
July 1, 2024
TABLE OF CONTENTS

Maximum Transmission Unit (MTU) is the largest size a data packet can be when transmitted over a network. Usually associated with the ethernet protocol, it represents the largest data packet a network device can accept.

Measuring MTU is essential for optimal network performance. Different network types and configurations have different MTU sizes, and understanding these can help you avoid unnecessary fragmentation and ensure smooth data transmission.

How MTU impacts data transmission

When you send files over the network, it’s crucial to consider their size. If the files are large, they may exceed the MTU size. The file will have to be split into smaller sizes that don’t exceed the MTU. This will make the data transfer faster and more efficient.

MTU also impacts the efficiency of VPN connections which often require an MTU adjustment to 1400 bytes to ensure data passes through securely and without fragmentation. So, it’s crucial to configure the MTU correctly.

Generally, if MTU is set too high, you may experience packet fragmentation, delays, and connection failures. Adjusting the MTU to the optimal size will resolve these issues.

How to measure MTU

MTU is measured in bytes, and the standard size is usually 1500 bytes for Ethernet. This means your Ethernet network can handle packets up to 1500 bytes before they need to be fragmented. Fragmentation can slow down your network, so you should minimize it.

MTU measurement includes the payload and the headers, but it varies depending on the technology and configuration. For example, in Ethernet networks, the maximum frame size is typically 1518 bytes, which includes the 18 bytes of overhead from the Ethernet header and the frame check sequence. So, the MTU for Ethernet is 1500 bytes.

What is the maximum MTU for Wifi?

On a standard Wi-Fi network (IEEE 802.11), the maximum MTU is usually 2304 bytes, which accounts for the maximum payload before encryption. If you're using encryption methods like WPA2, additional bytes are added for the encryption process, so you’d see a slight reduction in this number.

We should also mention jumbo frames that are supported in some Ethernet network configurations. Those frames can go up to 9000 bytes or more in size. That allows for much larger MTUs, which enhances efficiency by sending more data with fewer packets. However, every device on the network segment must support the larger frame size for this to work properly.

How do you find the right MTU for your network? 

You may often need to use techniques like Path MTU Discovery. This method involves sending packets with the "don't fragment" option. 

If a packet is too large, it’s dropped, and an ICMP message is sent back to notify the sender of the maximum size allowed. This way, the sender adjusts the packet size to match the smallest MTU along the path.

How MTU impacts network efficiency

Adjusting the MTU size can significantly impact network efficiency. When you use larger MTU sizes, the operating system sends fewer packets of a larger size to achieve the same network throughput.

This is much more efficient because it reduces the processing required within the operating system, especially if your workload involves sending large messages.

For instance, when you use an MTU size of 1500 bytes on Ethernet, it’s pretty standard and works well in mixed environments. But imagine you have a setup where all your devices support jumbo frames, say with an MTU of 9000 bytes. 

By switching to jumbo frames, the network can send much larger packets. Fewer, larger packets mean the CPUs on your devices spend less time processing packet headers and can focus more on the actual data. This is like delivering a few big boxes instead of many small ones; it simply gets the job done faster.

However, note that this works best when the workload allows for large messages. If your applications only send small packets, increasing the MTU size has little effect. For example, if your email system sends small, frequent messages, a larger MTU won’t make those transmissions any quicker.

You should also note the specific cases where large MTU sizes can be particularly beneficial. On Asynchronous Transfer Mode (ATM) adapters, a default MTU size of 9180 bytes is much more efficient than the typical 1500 bytes used by LAN Emulation. 

In a setup where you have a server-to-server connection using Gigabit Ethernet and all devices support it, employing jumbo frames greatly boosts efficiency. All devices need to support the larger frame size, though. If just one device can't handle it, the benefits are lost.

Optimal network performance hinges on finding the right MTU size for your setup. Different technologies and scenarios call for different MTU adjustments. By understanding and configuring MTU sizes properly, you enhance your network's efficiency and ensure smooth data transmission.

MTU and bandwidth utilization

If MTU isn't optimized, you use up more bandwidth than necessary. Therefore, you must configure the MTU to match your needs. This minimizes fragmentation and maximizes bandwidth utilization, ensuring your data ships efficiently through the network. 

Each packet you send includes headers that add extra overhead. So, instead of sending 5000 bytes in one go, for example, you will end up sending closer to 6020 bytes due to the extra headers. 

The extra overhead uses more bandwidth and can clog your network, especially when many employees are sending large files. So. whether it's through standard configurations or utilizing jumbo frames, the right MTU setting keeps your network running smoothly.

Your VPN connections also impact bandwidth utilization. A team member working remotely may connect with a VPN that requires an MTU of 1400 bytes. This lower MTU ensures secure and smooth data travel over the VPN, but it also means more packets and potential overhead. So, it's crucial to balance security needs with bandwidth efficiency.

When the IT department troubleshoots the slow network speed and failed connections, they often check the MTU settings. Wrong MTU sizes usually come up as the issue causing delays and reduced bandwidth utilization. Adjusting the MTU can solve these issues, optimizing your network's performance.

How MTU affects latency

Optimizing MTU can improve network performance and reduce latency. Again, size matters here. If your MTU is set to 1500 bytes, you have an MSS (Maximum Segment Size) of 1460 bytes for the data and 40 bytes for the headers. That produces a latency of 7.772 milliseconds per hop.

But what if your MTU is smaller, like 576 bytes? Then, the MSS is 536 bytes plus the same 40 bytes of headers. That produces a latency of 2.924 milliseconds per hop. That’s because smaller packets mean a shorter transmission delay per hop due to the throughput limits of the line.

Now, if you're transferring a 1-megabyte file over the same T1 line, your transmission overhead would be 1,048,576 bytes. With an MTU of 1500 and MSS of 1460 bytes, that file would fragment into about 719 packets (1,048,576 bytes / 1460 bytes per packet). That gets you a delay of 5588.068 milliseconds or 5.588 seconds per hop. The delay increases when you factor in the 10 hops.

Larger packets reduce overhead. With a 1500-byte MTU, you have 28,760 bytes of header data. But a 576-byte MTU bumps this up to 78,280 bytes. That’s nearly 50,000 extra bytes of headers. Over long distances and large transfers, this overhead adds up, causing delays.

So, while smaller packets may seem quicker due to less per-hop delay, they introduce more overhead, impacting overall transfer time. Adjusting MTU and understanding its effect on latency, especially over multiple hops, is crucial.

How to configure MTU on company routers

Configuring the MTU on company routers optimizes your network performance and reduces unnecessary fragmentation.

Step 1 - Access the router's configuration interface

Many routers have a web-based GUI, but sometimes you may use a command-line interface (CLI) for more advanced settings. Using a Cisco router as an example, if you need to adjust the MTU, you get into the CLI by connecting via SSH or through the console port.

Step 2 - Configure the MTU

Once inside the CLI, the commands to set the MTU are pretty simple. On the Cisco router, you would enter the interface configuration mode for the specific interface you want to adjust. If you are configuring the MTU for the Ethernet interface, the command would look something like this:

interface Ethernet0/0
mtu 1500

This sets the MTU to 1500 bytes, which is the standard for Ethernet. But we don't always stick to the standard. Sometimes, you may need to tweak the MTU settings based on specific requirements. For example, if you are dealing with jumbo frames, you might set the MTU to 9000 bytes. The command would then be:

interface Ethernet0/0
mtu 9000

VPNs often have a lower MTU to avoid fragmentation over the secure tunnel. If you are configuring a VPN that requires an MTU of 1400 bytes, you would go into the VPN interface settings and set it accordingly. 

Step 3 - Verify the settings and perform tests

Verifying the settings ensures that your changes are in effect and helps you spot any misconfigurations. Just as important is performing real-world tests. 

If someone in Sales reports issues with their remote VPN connection, you might run a ping test with various packet sizes to ensure data flows smoothly without fragmentation. This helps you fine-tune the MTU settings to match the demands of your network traffic.

Configuring the MTU on your routers is about finding the right balance. Aim to set it high enough to maximize efficiency but low enough to avoid fragmentation. By doing this, you keep your network running efficiently and securely.

How to configure MTU on company switches

Configuring the MTU on your company switches is critical for maintaining an efficient and smooth network. By carefully setting and verifying MTU sizes, you can optimize data transmission and minimize the chances of fragmentation slowing down your network.

Step 1 - Access the switch's configuration interface

For many switches, this is done via the command line interface (CLI). You connect to the switch using either a direct console connection or SSH if you are working remotely.

Step 2 - Enter the privileged EXEC mode

This is where you can execute configuration commands. For instance, if you are using a Cisco switch, you type `enable` to enter this mode and then `configure terminal` to start the configuration process. 

Step 3 - Set the MTU

This is usually done at the interface level. If you are configuring the MTU for a specific Ethernet interface, like GigabitEthernet0/1, you type `interface GigabitEthernet0/1` to select this interface. 

Step 4 - Specify the MTU size

For standard Ethernet, you might use `mtu 1500`. This sets the maximum packet size to 1500 bytes, ensuring it matches your network’s optimal size and minimizes fragmentation.

If your setup supports Jumbo Frames, you might set a higher MTU. Suppose you want to set it to 9000 bytes to support larger data transfers. You would enter `mtu 9000`. This is particularly useful for departments that handle large files, like some marketing teams with their high-resolution images.

Step 5 - Save the configuration

On a Cisco switch, you do this by typing `write memory` or `copy running-config startup-config`. This step ensures your changes persist even after the switch reboots.

Step 6 - Verify your settings

Do this by checking the interface configuration. You can use the command `show running-config interface GigabitEthernet0/1` to confirm the MTU is set correctly. This quick check helps prevent any misconfigurations that could lead to network issues.

Sometimes, you need to adjust MTU settings for VPN connections. You would follow a similar process to configure this on the relevant interface, ensuring the remote user’s data passes through securely without unnecessary fragmentation.

How to configure MTU on end devices

Fine-tuning MTU settings on your end devices can significantly enhance network performance, reduce fragmentation, and ensure smooth data flow across your network.

Windows operating system

Open Command Prompt as an administrator and use the `netsh` command. For instance, you could type `netsh interface ipv4 set subinterface "Ethernet" mtu=1500 store=persistent`. 

That command sets the MTU to 1500 bytes for your Ethernet connection. If you need to check the current MTU settings, you use `netsh interface ipv4 show subinterfaces`.

MacOS

Open Terminal and enter the command `sudo ifconfig en0 mtu 1500`. Here, `en0` typically refers to the primary Ethernet interface. Just like on Windows, you can confirm the MTU setting using `ifconfig en0 | grep mtu` to ensure it's correctly configured.

Linux

You can SSH into a server and run `sudo ip link set dev eth0 mtu 1500` to set the MTU for an Ethernet interface named `eth0`. If you want to see the current MTU setting, you just type `ip link show eth0` and look for the MTU value.

VPN connections

Sometimes, remote employees need to configure MTU settings for their VPN connections. They might need to set a lower MTU to avoid fragmentation. 

On their Windows laptop, they can run `netsh interface ipv4 set subinterface "VPN" mtu=1400 store=persistent`. This ensures their data packets are sized correctly for smooth travel through the VPN.

It’s also worth noting that some devices, like routers, allow MTU configuration through their web interfaces. You simply log into the admin panel and look for the MTU settings, often found in the WAN or advanced settings section. Setting this appropriately helps avoid issues with all connected devices.

More posts

GET STARTED

A WireGuard® VPN that connects machines securely, wherever they are.
Star us on GitHub
By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.