June 18, 2018

Finding your optimum MTU

Finding your optimum MTU can help get the best Internet speed. MTU stands for Maximum Transmission Unit, which is basically the size of the packet sent from your PC to the Internet.

Default MTU size

Cable = 1500
PPOE = 1492 or lower
VPN = 1300

Most routers allow you change the MTU from their Web GUI. It is usually set to 1500 or you can have it set to Auto. To change it on the PC’s is a little harder.

On Windows 7, open a command prompt

To check what the MTU is on all subinterfaces type

netsh interface ipv4 show subinterfaces

To set it type

netsh interface ipv4 set subinterface "Local Area Connection" mtu=1500 store=persistent

To find out what MTU to set, open a command prompt and type

ping -f -l 1472 www.yahoo.com

Using a -f switch sets it not to fragment the packets.
The -l switch is used to set the packet size.

I used www.yahoo.com as the destination to ping. You can use whichever.

1472 = Ethernet Default MTU
28 = Packet Header

1472 + 28 = 1500

If the packet can’t be sent because it would need to be fragmented you will get something similar to this:

Packet needs to be fragmented but DF set.

So you will need to run the ping command with different packet sizes to determine the optimum packet size. Keep trying lower packet sizes by 10 (i.e. -l 1460, 1450, 1440, etc.) until you get a successful ping request. Raise your packet sizes by one until you get a “Packet needs to be fragmented but DF set.”. The last successful value plus 28 will be your MTU value.
For example a packet size of 1460 succeeds, but 1461 fails, so 1460 + 28 = 1488.

I had the Cisco VPN software installed which changed my MTU to 1300. I uninstalled the software and rebooted, but my MTU still was set to 1300. I ran the netsh command above and it changed it, but after a reboot it reverted back to 1300.

I found the location in the registry where the MTU setting is kept and changed it there.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces

I then went through the different interfaces, until I found the one with my current IP for the Lan Interface. I edited the MTU and set the hexadecimal value of 5dc. Which sets the MTU to 1500. I closed the registry and rebooted. The MTU was now still set to 1500. Success.

Comments

  1. Basically info! Anyone clarified often the concern I actually posted on StackOverflow.

Speak Your Mind

*