Determine correct MTU value using ping

Determine correct MTU value by Ping Test

For Windows:
A series of ping tests using the command, ping -f -l xxxx aaa.bbb.ccc.ddd, where xxxx is the packet size, aaa.bbb.ccc.ddd is your IP address, can be used to determine the optimal MTU for your connection.  You can also use hostname instead of IP address.
  1. Go to Start and select Run.
  2. Type in cmd (Windows 2000/XP) or command (Windows 98/ME) into the Open: field. Hit the enter key or click OK. The command prompt should open.
  3. At the command prompt, type in ping -f -l 1492 192.168.1.11 and hit the Enter key.
    C:\Users\Owner>ping -l 1492 -f 192.168.1.1

    Pinging 192.168.1.1 with 1492 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 192.168.1.1:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

  4. Note the results above indicate that the packet needs to be fragmented. Lower the size the packet in increments of +/-10 (e.g. 1472, 1462, 1440, 1400) until you have a packet size that does not fragment.
    C:\Users\Owner>ping -l 1472 -f 192.168.1.1

    Pinging 192.168.1.1 with 1472 bytes of data:
    Reply from 192.168.1.1: bytes=1472 time<1ms TTL=64
    Reply from 192.168.1.1: bytes=1472 time<1ms TTL=64

    Ping statistics for 192.168.1.1:
        Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
    Approximate round trip times in milli-seconds:
        Minimum = 0ms, Maximum = 0ms, Average = 0ms


  5. Begin increasing the packet size from this number in small increments until you find the largest size that does not fragment. Add 28 to that number (IP/ICMP headers) to get the optimal MTU setting. For example, if the largest packet size from ping tests is 1462, add 28 to 1462 to get a total of 1490 which is the optimal MTU setting.
  6. Change the MTU using TCPOptimizer or editing the registry.
For windows, you may download TCP Optimizer to simplify the process.

For Linux:
Please use the below command

ping -s 1464 -M do -c 4 192.168.1.1

where:
-s       -specify the packet size
-M do -equal to Don't Fragment flag
-c 4     - instruct PING to send 4 testing packets only.  Linux PING will send infinite PING packets

For VMWare ESXi/vSphere:
Please use the below command:

ping -s 1472 -d 192.168.1.1









Comments

Popular Posts