When we talk about networking, sometimes we’ll talk about Maximum Transmission Unit (MTU) packet sizing.  I briefly referred to MTUs in the SSL errors, and how to diagnose them post.

Why should you care?  Well if you want a fast internet connection, you should.

Think of the MTU as a 4 pint jug.  Your 4 pint jug can ever only hold 4 pints.  But say you are trying to fill it from an 8 pint (gallon) bucket.  You need two jugs.  This, in networking, we call packet fragmentation.  Packet fragmentation was the root cause of the issue in the SSL errors post.

Packet fragmentation is bad.  To stretch the bucket example, you’d need to make two trips as your 4 pint is too small.  It’s faster to make one trip.

So how do you set the maximum MTU for your network connection?
(Note: if you are running Windows Vista or Windows 7, you should not need to.  But if you want/need to, there is a handy guide here.)

Well there are two ways to adjust your MTU.

The hard way – MTU Ping Test

We do a series of ping tests using the ping command like this:
ping www.google.com -f -l xxxx,
where
-f tells Ping not to fragment the packet,
-l is the packet size switch, and xxxx is the packet size we’re going to test.  This will help us determine the best MTU for your network connection.

  1. In Windows 2000/XP, go to the Start menu, and select Run.
    Type in CMD and the Enter key.
  2. At the CMD prompt, enter ping www.google.com -f -l 2000 and press the Enter key.
    mtu ping 1See the line “Packet needs to be fragmented but DF set.”.  That means that 2000 is too high for your MTU value.
  3. Lower the value for the packet size in increments (ie. 1800, 1600, 1400, 1200) until you don’t get a packet size which does not fragment.
    In the following example, we went for 1400:
    mtu ping 2
  4. Now begin increasing the packet size in small increments until you find the largest packet size that does not produce the “Packet needs to be fragmented but DF set.”
    message.
    mtu ping 3
    Then add 28 to that number (28 allows for the packet headers) to get the optimal MTU setting.
    For example, my largest packet size was 1472, so I’d add 28 to 1472, to get a MTU value of 1500.
  5. Now, to set that MTU value, you should use a utility like SG TCP Optimizer.
    Or you can set it yourself by editing the registry:
    Windows 2000: TCP/IP and NetBT configuration parameters for Windows 2000 or Windows NT
    Windows XP: How to change the PPPoE MTU size in Windows XP

The easy way

Just use SG TCP Optimizer.