Skip navigation

Here are some steps I took to detect the MTU of some of our off-site DSL users.

The MTU for Ethernet is 1500. This is a typical setting for office LANs where there’s no traffic traversing links of smaller size. However, traffic that must cross non-ethernet links, such as DSL, will encounter MTUs of different sizes. When a network device receives a packet larger than its MTU two things can happen:

  1. If the packet has the ‘do not fragment’ flag set the device will drop the packet and reply back to the packet originator with an error message.
  2. If the packet does not have the ‘do not fragment’ flag set the device will break the packet down into identical-but-smaller sterilized packets that fit within the MTU requirements of that link.

Here’s how you can test to see what the MTU is between your computer and a remote computer.

  • In this example I’m going to use my Mac at home to test the MTU to yahoo.com.
  • I’m going to use the ‘ping’ command with the ‘-D’ (do not fragment) and ‘-s’ (packet size) flags.

Normally when I ping yahoo.com I see:

playpig(~)$ ping -c 1 yahoo.com
PING yahoo.com (66.94.234.13): 56 data bytes
64 bytes from 66.94.234.13: icmp_seq=0 ttl=47 time=256.573 ms
--- yahoo.com ping statistics ---
 1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 256.573/256.573/256.573/0.000 ms

Now I’ll ping yahoo.com with a packet size of 1492bytes:

playpig(~)$ ping -c 1 -D -s 1500 yahoo.com
PING yahoo.com (66.94.234.13): 1500 data bytes
ping: sendto: Message too long
--- yahoo.com ping statistics ---
 1 packets transmitted, 0 packets received, 100% packet loss

Next I’ll ping yahoo.com with a smaller packet size:

playpig(~)$ ping -c 1 -D -s 1300 yahoo.com
PING yahoo.com (66.94.234.13): 1300 data bytes
1308 bytes from 66.94.234.13: icmp_seq=0 ttl=47 time=172.396 ms
--- yahoo.com ping statistics ---
 1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 172.396/172.396/172.396/0.000 ms

From our testing so far we can safely assume that our MTU is less than 1500bytes and more than 1300bytes. We can continue testing until we find a happy medium. Lets try 1329bytes:

playpig(~)$ ping -c 1 -D -s 1329 yahoo.com
PING yahoo.com (66.94.234.13): 1329 data bytes
ping: sendto: Message too long
--- yahoo.com ping statistics ---
 1 packets transmitted, 0 packets received, 100% packet loss

Lets try 1328bytes:

playpig(~)$ ping -c 1 -D -s 1328 yahoo.com
PING yahoo.com (66.94.234.13): 1328 data bytes
1336 bytes from 66.94.234.13: icmp_seq=0 ttl=48 time=288.600 ms
--- yahoo.com ping statistics --
 1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 288.600/288.600/288.600/0.000 ms

Bingo. Our MTU is going to be a number less than 1336bytes that is a multiple of 8:

  • NO 1336 / 8 = 167
  • NO 1334 / 8 = 166.75
  • YES 1332 / 8 = 166.5

The MTU between us and yahoo.com is 1332bytes.

Here’s some more information on fragmentation:

“Internetworking with TCP/IP”
Pg 81 – 6.7.6 Fragmentation Control
http://tinyurl.com/6xunt8

About these ads

6 Comments

    • jure
    • Posted August 24, 2008 at 19:03
    • Permalink

    why does it have to be a multiplier of 8?

    • The rule for calculating valid MTU is (MTU size – 1500) mod 8 = 0. (‘xxx mod 8′ means the value ‘xxx’ can be divided by 8).

  1. Really nice post, I was trying to work out a simple way for my site to scan for MTU, so this is a godsend!

    Thanks so much!
    Cheers,
    ADSLgeek

    • Dave
    • Posted November 18, 2010 at 05:03
    • Permalink

    Used this to tweak my iMac running OS X thanks!

  2. Thank you, this was very straight forward and easy to understand. Worked like a charm for speeding up my connection on Snow Leopard

    • Peter
    • Posted February 9, 2013 at 14:42
    • Permalink

    Some platforms (linux vs Windows vs Cisco etc) have a slightly other way of calculating the payload and MTU size. Some take the payload including 28 bit headers and info. With others you still need to add 28 bits to the maximum payload to get the correct MTU size.

    If you are looking for a way to do this from an external source to the outside of your router, automatically, you could try the following MTU test:

    http://www.letmecheck.it/MTU-test.php

    It will also check if the ‘divisible by 8′ rule is respected.


Comments are closed.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: