Determining Your MTU

General Procedure

This test can only determine the Path MTU of a specific path. In most cases this will match your connection MTU, but it may not always. You cannot test MTUs larger than your interface MTU. If you need to test an MTU larger than 1500 bytes ensure your interface has the correct MTU settings. In most cases your interface MTU will be larger or the same as your connection MTU. Please keep these limitation in mind.

To test your MTU you will need to send progressively larger pings that have the Don't Fragment bit set to a destination until the packet cannot be sent. The largest ping that can be successfully sent can be used to calculate your MTU. Since ICMP headers are 28 bytes you must add 28 to the largest data size you were able to send. For the purpose of this test if you do not have a particular endpoint in mind we recommend the destination of Level 3's 4.2.2.2 as Google's 8.8.8.8 will truncate replies. Operating system specific instructions are available below.

Windows 

    1. Open 'Command Prompt'.
      • mtu_ss_01.png
      • mtu_ss_02.png
    2. Ping your desired endpoint with the following command replacing <size> with the size of the data payload and <endpoint> with the IP or hostname of the endpoint. Increase the size by 50 bytes until you receive an error that the packet needs to be fragmented. I recommend starting at 1300 bytes. If you receive an error at 1300 bytes you may need to start with a lower value.
      • ping /f /l <size> /n 1 <endpoint>
      • mtu_ss_03.png
    3. Once you receive an error revert back to the previous size that worked and slowly increment the size by 10 bytes until you receive the same error.
      • mtu_ss_04.png
    4. Revert by to the last 10-byte increment that worked and increase the size by 1 byte every increment.
      • mtu_ss_05.png
    5. Take the last value you got that works and add 28 bytes to find out the MTU. In our example it is 1472 + 28 = 1500. Your values may vary.

Linux/BSD/OSX

  1. Open a terminal. Unfortunately due to the variations in desktop environments / window managers we cannot provide specific instructions.
  2. Ping your desired endpoint with the following command replacing <size> with the size of the data payload and <endpoint> with the IP or hostname of the endpoint. Increase the size by 50 bytes until you receive an error that the packet needs to be fragmented. I recommend starting at 1300 bytes. If you receive an error at 1300 bytes you may need to start with a lower value.
    • Linux:
      • ping -c 1 -M do -s <size> <endpoint>
    • BSD/OSX:
      • ping -c 1 -D -s <size> <endpoint>
    • $ping -c 1 -M do -s 1300 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1300(1328) bytes of data.
      1308 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=28.0 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 28.008/28.008/28.008/0.000 ms
      $ping -c 1 -M do -s 1350 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1350(1378) bytes of data.
      1358 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.7 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.668/27.668/27.668/0.000 ms
      $ping -c 1 -M do -s 1400 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1400(1428) bytes of data.
      1408 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.8 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.768/27.768/27.768/0.000 ms
      $ping -c 1 -M do -s 1450 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1450(1478) bytes of data.
      1458 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.8 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.794/27.794/27.794/0.000 ms
      $ping -c 1 -M do -s 1500 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1500(1528) bytes of data.
      ping: local error: Message too long, mtu=1500

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

      $
  3. Once you receive an error revert back to the previous size that worked and slowly increment the size by 10 bytes until you receive the same error.
    • $ping -c 1 -M do -s 1460 4.2.2.2 
      PING 4.2.2.2 (4.2.2.2) 1460(1488) bytes of data.
      1468 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.9 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.869/27.869/27.869/0.000 ms
      $ping -c 1 -M do -s 1470 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1470(1498) bytes of data.
      1478 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.9 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.861/27.861/27.861/0.000 ms
      $ping -c 1 -M do -s 1480 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1480(1508) bytes of data.
      ping: local error: Message too long, mtu=1500

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

       $
  4. Revert by to the last 10-byte increment that worked and increase the size by 1 byte every increment.
    • $ping -c 1 -M do -s 1471 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1471(1499) bytes of data.
      1479 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.7 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.724/27.724/27.724/0.000 ms
      $ping -c 1 -M do -s 1472 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1472(1500) bytes of data.
      1480 bytes from 4.2.2.2: icmp_seq=1 ttl=57 time=27.8 ms

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 1 received, 0% packet loss, time 0ms
      rtt min/avg/max/mdev = 27.766/27.766/27.766/0.000 ms
      $ping -c 1 -M do -s 1473 4.2.2.2
      PING 4.2.2.2 (4.2.2.2) 1473(1501) bytes of data.
      ping: local error: Message too long, mtu=1500

      --- 4.2.2.2 ping statistics ---
      1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms

      $
  5. Take the last value you got that works and add 28 bytes to find out the MTU. In our example it is 1472 + 28 = 1500. Your values may vary.
Have more questions? Submit a request

Comments