Monday, February 8

Setting MTU on Windows

The first questions that I imagine comes to the mind of many people is what is MTU and why should I care about it. I expect a more or less formal definition is not that useful when it comes to answering these questions.

Maximum Transmission Unit [MTU]
The largest possible unit of data that can be sent on a particular network implementation

The MTU can be thought of the largest amount of information, in bytes, that can be sent in a single message between two systems on a network, including those systems on the internet.  But still why should we care, the information can be sent in multiple messages, and in reality systems almost always send multiple messages.  The answer is that the MTU value that is used affects how efficient a system is when it transfers information to another system.



If the MTU is set too low, then a system must send many small messages to the remote system, which means that the exchange of information will take longer.


If the MTU is set too large it may not be able to reach the remote host and if that happens then either rthe transfer of information will fail or the information is resent using smaller messages, which again means that the exchange of information will take longer.


So just like Goldilocks, we want it to be just right, that way our computer can exchange information faster.

The first step in getting your MTU just right is determining what it should be.  This can be done by using 'ping -f -l 1500 www.google.com' and repeating the command, lowering the value after '-l' until the command works.  It is important that both the '-f' option and the '-l' option is used as the '-l' specifies the size message to send, while the '-f' option tells ping not to allow the messages to be split up.  By using both of these option we guarantee that in order for a ping to succeed the message size must be no larger than the maximum MTU the network can support.
C:\Users\Manny>ping -f -l 1500 www.google.com

Pinging www.l.google.com [66.249.80.104] with 1500 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for 66.249.80.104:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\Users\Manny>ping -f -l 1480 www.google.com

Pinging www.l.google.com [66.249.80.104] with 1480 bytes of data:
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.
Packet needs to be fragmented but DF set.

Ping statistics for 66.249.80.104:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\Users\Manny>ping -f -l 1472 www.google.com

Pinging www.l.google.com [66.249.80.104] with 1472 bytes of data:
Reply from 66.249.80.104: bytes=64 (sent 1472) time=34ms TTL=50
Reply from 66.249.80.104: bytes=64 (sent 1472) time=25ms TTL=50
Reply from 66.249.80.104: bytes=64 (sent 1472) time=28ms TTL=50
Reply from 66.249.80.104: bytes=64 (sent 1472) time=27ms TTL=50

Ping statistics for 66.249.80.104:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 25ms, Maximum = 34ms, Average = 28ms
Once you have a value that works for your network, then using a tool like DrTCP from dslreports, you can set your system's MTU to that value.  If you are having issues where some web sites work  and others just won't load, then checking your MTU is one of the first things I advise doing.

No comments:

Post a Comment