Optimize Your Internet Speed by Determining the Right MTU Size

Other Factors to Consider

  • Connection Type: The type of internet connection you use (DSL, cable, fiber optic) can affect the optimal MTU that can be used.
  • Network Devices: Routers, switches, and other network devices have a maximum MTU supported. The MTU you set must not exceed the maximum value supported by the device.
  • Network Protocols: Some network protocols have specific MTU requirements.

How to Determine the Optimal MTU:

  • Ping with Don’t Fragment Options: You can use the ping command with the “-f” (don’t fragment) to find out the maximum MTU supported by your network path.
  • Use Specialized Tools: Several specialized tools can be used to measure MTU, such as PathPing on Windows or traceroute on Linux.
  • Consult your ISP: You can also consult your internet service provider for recommendations regarding the optimal MTU.

Steps to Determine the Optimal MTU Size

Preparation

Before conducting the MTU test, several equipment and preparations need to be done:

  • Stable Internet Connection: Make sure your internet connection is stable and there are no interruptions.
  • Computer Device: Prepare the computer or laptop that will be used to perform the MTU test.
  • Access to the Router: Make sure you have access to the router’s settings, either through the web interface or the router manager app.
  • Network Test Tool: You will need a network tool or utility, such as Command Prompt on Windows, Terminal on macOS, or Terminal on Linux.

Method Ping Test

The steps to perform the Ping Test to determine the optimal MTU size are as follows:

  1. Open Command Prompt or Terminal:
    • Windows: Press Win + R, type cmd, and then press Enter.
    • macOS and Linux: Open Terminal from the app or use the shortcut Ctrl+Alt+T (Linux).
  2. Type Command Ping: Use the ping command with the options -f (set the Don’t Fragment bit) and -l (specify the packet size) to send a data packet of a specific size without fragmentation. Start with a packet size of 1472 bytes (since the MTU size of 1500 bytes includes a 28-byte IP header).
ping [ip_address] -f -l 1472
  1. Reduce Package Size: If you receive the message “Packet needs to be fragmented but DF set”, reduce the package size by 10 bytes and repeat the command.
ping [ip_address] -f -l 1462
  1. Find Maximum Size Not Fragmented: Repeat step 3 until you find the maximum size that does not generate an error message. Add 28 bytes to determine the optimal MTU size.
ping [ip_address] -f -l [largest_size]
ping test google

Practical Examples

  • Windows:
ping google.com -f -l 1472
  • macOS:
ping -D -s 1472 google.com
  • Linux:
ping -M do -s 1472 google.com

Addressing Error Messages

If you receive an error message like “Request timed out” or “Packet needs to be fragmented but DF set”:

  • Reduce Package Size: Reduce the size of the package being tested until the error message disappears.
  • Check Connection: Make sure there is no disruption to your internet connection.
ping test yahoo

Destination host unreachable: This means that the package cannot reach its destination. There may be a problem with the connection or the IP address you are using.

Packet too big: This means that the package size exceeds the MTU. Make a note of the size of the last successful packet before this message appears.

Fragmentation needed and DF set: This means that the package must be broken into fragments, but the don’t fragment (DF) option is enabled.

Latest Articles