The MTU setting controls the maximum ethernet packet size your PC will send (you did know the Internet works in packets, didn't you?). Why a limit? Because although larger packets can be constructed and sent, your ISP and Internet backbone routers and equipment will chop up (fragment) any packets larger than their limit. These parts are then reassembled by the target equipment before reading. This fragmentation and reassembly is not optimal.MTU and Windows and Defaults
Unless otherwise set, Windows defaults MTU to 1500, or a lower value of 576 for external networks. 1500 is OK unless you are running PPPoE, want to use IPSec (Secure VPNs) or both, then it's too big. 576 is not efficient for the broadband/Internet; it's too small.Finding the largest MTU, by EXPERIMENT
If your MTU is too low already, maybe 576, the following method will not be able to detect whether you can switch to an optimal size. So first follow "CHANGING MTU for PPPoE" to reset MTU to 1500, reboot and then come back to this!
The best value for MTU is that value just before your packets get fragmented. How do you find that out? By using Ping at an command prompt.
Windows 2000/XP users:
Go to Start/ Programs/ Accessories/ Command Prompt and type the following:
ping -f -l 1472 www.dslreports.com
(That is a dash lower case "L," not a dash "1." Also note the spaces in between the sections.)
ping -s 1472 www.dslreports.com
OS X users:
ping -D -s 1472 www.dslreports.com
Linux and OS X commands are case sensitive.
Press Enter. Then reduce 1472 by 10 until you no longer get the "packet needs to be fragmented" error message. Then increase by 1 until you are 1 less away from getting the "packet need to be fragmented" message again.
Add 28 more to this (since you specified ping packet size, not including IP/ICMP header of 28 bytes), and this is your MaxMTU.Note:
If you can ping through with the number at 1472, you are done
! Stop right there. Add 28 and your MaxMTU is 1500.
~~~~~~~~~~~~~~~~~~~~~~~~~~~For PPPoE, your MaxMTU should be no more than 1492
to allow space for the 8 byte PPPoE "wrapper," but again, experiment to find the optimal value. For PPPoE, the stakes are high: if you get your MTU wrong, you may not just be sub-optimal, things like UPLOADING or web pages may stall or not work at all!
~~~~~~~~~~~~~~~~~~~~~~~~~~~(TCP, IP, MTU and MSS magic numbers)
Windows 98/98SE (or 95 with DUN 1.3) - CHANGING MTU
|1500||The biggest-sized IP packet that can normally traverse the Internet without getting fragmented. Typical MTU for non-PPPoE, non-VPN connections.|
|1492||The maximum MTU recommended for Internet PPPoE implementations.|
|1472||The maximum ping data payload before fragmentation errors are received on non-PPPoE, non-VPN connections.|
|1460||TCP Data size (MSS) when MTU is 1500 and not using PPPoE.|
|1464||The maximum ping data payload before fragmentation errors are received when using a PPPoE-connected machine.|
|1452||TCP Data size (MSS) when MTU is 1492 and using PPPoE.|
|576||Typically recommended as the MTU for dial-up type applications, leaving 536 bytes of TCP data.|
|48||The sum of IP, TCP and PPPoE headers.||The sum of IP and TCP headers.|
|28||The sum of IP and ICMP headers.|
Use drTCP to change MTU.MTU and other OS
For Linux, it is a matter of using the ifconfig command (read the main page for ifconfig).
For Macintosh, your PPPoE software (MacPOET) will set the MTU correctly.
Feedback received on this FAQ entry:
- Very good and clear information!
- The MTU tool posted in this thread is perfect! it doesn't need to be installed and is so simple yet so specific I had to reply. Thank you for the hard work! I had already tested my MTU on my system link and know the value. I ran the tool in my VM (no offense but I downloaded it off the net and we can never be to careful) after snapshoting. It found my exact MTU after going through a series of small checks. Thank you again for making life in technology just a little bit easier.
- Some platforms (linux, Windows, Cisco etc) have a slightly other way of calculating the payload and MTU size. Some take the payload including 28 bit headers and info, like Cisco. 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.
- Very enlightening!
- Also, the ifconfig in linux has been deprecated for years. The command is now "ip".
- In linux, add "-M do" to the parameters to ping to force the don't fragment bit on, otherwise ping will silently do mtu discovery and fragment for you. Eg:
ping -s 1472 -M do www.dslreports.com
- If you need to adjust your MTU permanently, do the following:
sudo vim /etc/network/interfaces
If you are using a static address then find the interface you need and simply add the MTU line:
iface eth0 inet static
If you are using DHCP addresses then you need to set this before the interface comes up, by adding this line:
iface eth0 inet dhcp
pre-up /sbin/ifconfig $IFACE mtu 1492
Then release and renew (or up and down) the interface
sudo ifdown eth0
sudo ifup eth0
2009-09-22 23:50:55 (mdelatorre )
- in macs running 10.3 and later , you just select the ethernet port you want to modify from the network pane, in system preferences. You then highlight your ethernet connection on the left hand side, then click on advanced on the bottom right corner. select the ethernet tab from the window that comes down, then set the first menu to manual. and there you go, change your mtu, your duplex settings and the connection speed.
- If you ping with Linux you should specify the DF (don't fragment) flag with "-M do":
ping -M do -s 1472 www.dslreports.com
- hello, i did this ping at 1472 for x-p and had 4 sent recieved 1 loss 3 ??? also say's packet's need to be fragmented but DF set ?? it said this 3 time's what does that mean ? so then ran it at 1462 and said sent 4 rec. 4 loss 0 so did i fix something by doing this ? this is happening to me as well please help!
2009-02-22 18:46:49 (mikeoe )
- I have never seen a better article that explains MTU and how it relates to everything so well. This is awesome. Thank you.
- For Vista:
"You can change the MTU settings in vista using the following command from the command line as an admin...
netsh interface ipv4 set subinterface "Local Area Connection" mtu=1300 store=persistent
If you just want to see what your settings are you can run.
netsh interface ipv4 show subinterfaces"
PS: Instead of "Local Area Connection" you must put the suitable string of your connection, which you get using the last command above. For a wireless connections, you could have "Wireless Network Connection".
2008-11-17 12:33:42 (ganiba )
- On Linux (Ubuntu at least), a better MTU test:
ping -c 10 -M do -s
- Thanks for the information. I don't know the technical aspects of the actions I performed but this article worked for me. My problems started after upgrading to Comcast's "Speed Boost" up to 16Mbps. I had the 6Mbps service and should have stayed with my original service.
Linksys - WRT350N (Firmware Version: v1.03.7 )
- Thanks, this helped heaps
I wrote a little C# application that automates the MTU discovery process and prepares a nice little report which might enhance this FAQ and simplify MTU testing for your users (at least the ones the run Windows).
The application uses the OS ping to do the work so it should be a bit more compatible then if I wrote an internal network ping (or so my thinking goes), it certainly appears to work reasonably well.
You can review and download the tool for testing from my webpage here:
Currently the tool pings my web server which is hosted at godaddy (secureserver.net) which should have more then adequate bandwidth to support any number of users testing with this tool.
I look forward to your comments, thoughts and criticisms, all are very welcome.
edited by redxii
last modified: 2008-01-25 09:51:45