The MTU (Maximum Transmission Unit) is the largest packet size that can be transmitted over your network without needing fragmentation. An incorrect MTU setting can lead to connectivity issues, slow speeds, or packet loss. Testing and adjusting your MTU can optimize your internet performance. This guide shows how to test MTU on both Windows and macOS.

1. What is MTU and Why Test It?

MTU refers to the maximum size of a packet (measured in bytes) that your network interface can transmit. The standard MTU size for most Ethernet networks is 1500 bytes, but depending on your ISP or network configuration, a different value might be optimal.

Testing your MTU helps you identify the ideal packet size, ensuring efficient data transfer and avoiding packet fragmentation, which can cause slow speeds and connectivity issues.

2. How to Test MTU on Windows

To find the optimal MTU size on Windows, you’ll use the ping command with specific parameters:

  1. Open Command Prompt:
    • Press Windows + R to open the Run dialog.
    • Type cmd and press Enter to open the Command Prompt.
  2. Run the Ping Command:
    • In the Command Prompt window, type: ping -f -l
    • Replace with an IP address or domain name (e.g., 8.8.8.8 for Google DNS).
    • Replace with a number, starting with 1472. The reason for this is that 1472 bytes + 28 bytes (ICMP header) equals 1500 bytes, which is the standard MTU size.
  3. Adjust the Packet Size:
    • If the response says Packet needs to be fragmented but DF set, reduce the packet size by 10 (e.g., 1462) and try again: ping 8.8.8.8 -f -l 1462
    • Repeat this process, gradually lowering the packet size until you find the largest value that does not result in fragmentation.
  4. Calculate the Optimal MTU:
    • Once you find the largest packet size that works without fragmentation, add 28 to that value to determine your optimal MTU.
    • For example, if 1464 works, your MTU is 1464 + 28 = 1492.

3. How to Test MTU on macOS

  1. Open Terminal:
    • Press Command + Spacebar to open Spotlight Search.
    • Type Terminal and press Enter to open the Terminal application.
  2. Run the Ping Command:
    • In the Terminal, type: ping -D -s
    • Replace with an IP address or domain name (e.g., 8.8.8.8 for Google DNS).
    • Replace with a value starting at 1472.
  3. Adjust the Packet Size:
    • If you receive a message saying Message too long, reduce the packet size by 10 and try again: ping -D -s 1462 8.8.8.8
    • Continue adjusting the size until you find the largest packet size that does not produce an error.
  4. Calculate the Optimal MTU:
    • Once you find the largest packet size that works, add 28 to determine your MTU value.
    • For instance, if 1464 works, the MTU would be 1464 + 28 = 1492.

4. Tips for Testing MTU Effectively

  • Test Multiple Servers: If possible, test different destinations (e.g., 8.8.8.8 or your ISP’s DNS server) to ensure consistency.
  • Use Wired Connections: Test using a wired connection for the most accurate results, as Wi-Fi may introduce variables affecting MTU.
  • Apply Changes if Necessary: Once you determine the optimal MTU, you can set it on your router or device’s network settings for better network performance.

By following these steps, you can determine the optimal MTU size for your network, ensuring smooth and efficient data transmission.