Home » Projects » Mturoute.php


mturoute.exe - Debug the MTU values between you and a host.

Current Version (v2.1) from 2008-01-18:

Can be downloaded right here: mturoute.exe or as a zip file which includes source code here: mturoute_v2_1.zip

Description:

mturoute.exe is a small command line application that uses ICMP pings of various sizes in order to determine the MTU values on the path between itself and the target system. It also includes a "traceroute" like mode where it will attempt to determine the lowest MTU between the local host and each hop in the communication. The utility generates maybe 100 times as much traffic as a normal ping does, so you should exercise restraint when running it on networks you do not administer. During development and testing my ICMP capability was disabled completely several times, although a power cycle on the cable modem restored normal operation.

Behavior/Usage:

Mturoute sends a non-fragmentable icmp probe to the target IP address with a given payload size. Since the do-not-fragment bit is set, any network equipment that has an MTU setting which is smaller than the packet size will drop the packet.

Based on the presence or absence of a response, mturoute adjusts the payload size of its next probe. Subsequent probes are sent with a packet size midway between the highest value for which a response was received and the lowest value for which a response was not received. (For the initial conditions, the low value is 0 and the high value is whatever you set with -m, defaulting to 10000 bytes).

This process is repeated, narrowing the search space by ~50% with each cycle, terminating once the highest possible probe size has been converged upon. It then adds the 28 bits of ICMP protocol overhead before reporting results.

• In -t "traceroute" mode, mturoute performs this same process for each hop between you and the specified host. The output is abbreviated (only the +/- characters remaining to indicate progress), outputting a single MTU value for each hop.

Since each probe has to traverse the entire distance from localhost to a given hop, the reported MTU values represent the smallest MTU setting between you and the given hop, not necessarily the MTU setting between a hop and its immediate predecessor. For instance, if the MTU is narrowed on a hop midway between you and your destination, all subsequent hops will show the same small size - as your packets to more distant hops must pass through that choke point.

For example:
figure illustrating packet size being narrowed by an intermediate mtu setting
... despite the MTU value widening past hop C, mturoute would display the narrow, green size for both hop D and the destination host.

Due to the nature of the test, it is sensitive to packets dropped for non-MTU related reasons. Packets that are lost for other reasons will result in an incorrect MTU reading. Mturoute v2 will now attempt to re-probe to avoid dropped packets, but the mysteries of the Internet may still conspire to give you an incorrect reading. In general, the true MTU cannot be lower than the highest successful probe, but the possibility does exist that the true MTU may in fact be higher than reported.

• If the -f flag is specified, mturoute doesn't test MTU sizes. This flag will toggles off the "do not fragment" bit, which will allows intermediate routers to break mturoute's probes into multiple packets if they exceed the MTU size. Fragmented probes are re-assembled at their destination. With MTU is taken out of the equation, this mode instead reports the largest ping that a given host will respond to. This could help you determine whether fragmentation is happening properly.

• The -w setting sets the amount of time you want mturoute to wait for a response for a given probe. This was undocumented in the original version, but is exposed in v2.

• The -i setting allows you to specify the length of the interval that mturoute will wait between probes. This was also undocumented in the original version, but is exposed in v2.

• The -r setting is new in v2, it allows you to specify the number of retries that mturoute will run given a probe timeout. Hopefully this will alleviate the problem in the original version where a single missed probe (which may have been dropped for any reason) would cause an incorrect MTU to be calculated. The default number of retries is 3.

• The -d setting is new in v2, it instructs mturoute to output more verbose debugging information as it runs.

• The -m setting allows you to set a maximum probe size, in bits. The default is 10,000.

• The -v setting outputs the version information. Versions prior to v2.1 have no version information.

Platform:

  • Win32 Console. Tested on XP. Should work on Vista.
  • The original icmp library I used for this claimed that it compiled under Linux etc as well - which I was unable to duplicate. (I think it wanted to have ties to an older version of Wine). In v2, mturoute depends on a Windows provided library instead. It is now less likely to compile under *nix.

    Note: Turns out there is a similar-functioning equivalent in the Linux world for this sort of thing already: tracepath. If you're looking for a version of tracepath for windows, mturoute may suit your needs... and if you are seeking to compile mturoute for Linux, you should probably see if you can do it with tracepath.

    Language:

  • C - Specifically, I compiled it under Microsoft's C Compiler from Visual Studio 6.0
  • History/License:

  • Mturoute was originally based on the ping source code available here. The license quoted there is very liberal: """All the applications are free (BSD, GNU, or even no license) and come with the source. Don't hesitate to modify them, tweak them, enhance them. I will appreciate it if you send me your suggestions, source modifications, .. """ My modifications are free under the same arrangement as the original. Like the original author, I'd love to hear any feedback.
  • In October 2007, I received modifications from Ivan Pepelnjak, which I have collectively referred to on this page as v2. These modifications are the first significant update since the original release in 2005. Ivan's posts on mturoute and his modifications can be found on his blog.
  • Fixes, January 2008:
    * Fixed up some buffer size related bugs, hopefully squashing any mysterious crashes that people may
      have been having.  In particular, if large packet sizes crashed for you before (in theory) they
      should be working now.
    * added a "-v" option to output version information so I don't get confused.  Since I had previously
      dubbed Ivan's version "v2", I am unceremoniously dubbing this version "v2.1".  Incremental fixes
      will be v2.2, v2.3 etc.  Huge changes, if ever, might make a v3.
    * Speed fixes for dealing with unresponsive hosts.  Rather than ticking down from the base test
      value all the way to the minimum MTU, mturoute will now throw out a minimum sized packet before
      it begins.  If this minimum packet times out, we skip all the larger packets.  Under the default
      settings this should result in an approx 3 second wait for non-responsive hosts.
    * Fixed some embarrassing spelling errors and cleaned up a bit of output.  Non-responsive hosts will
      no longer report things like "------------------ host: blah max: 120 bytes", rather a message about
      them being non-responsive will be issued.
    
  • I welcome future modifications - so long as they are of a useful nature and within the spirit with which the software was offered originally.
  • Bugs:

  • Not really a bug, but it generates a lot of ICMP traffic which your ISP or network equipment may not like.
  • High payload sizes may be prohibited by windows, which will cause the utility to crash. Using the -m flag to lower the maximum payload size should let you get around this.This was in fact a buffer overflow problem. I believe it is now corrected.
  • Example Output:

    C:\mturoute-src\bin>mturoute www.slashdot.org
    * ICMP Fragmentation is not permitted. *
    * Maximum payload is 10000 bytes. *
    - ICMP payload of 5046 bytes failed..
    - ICMP payload of 2569 bytes failed..
    + ICMP payload of 1330 bytes succeeded.
    - ICMP payload of 1949 bytes failed..
    - ICMP payload of 1639 bytes failed..
    - ICMP payload of 1484 bytes failed..
    + ICMP payload of 1407 bytes succeeded.
    + ICMP payload of 1445 bytes succeeded.
    + ICMP payload of 1464 bytes succeeded.
    - ICMP payload of 1474 bytes failed..
    + ICMP payload of 1469 bytes succeeded.
    + ICMP payload of 1471 bytes succeeded.
    + ICMP payload of 1472 bytes succeeded.
    - ICMP payload of 1473 bytes failed..
    + ICMP payload of 1472 bytes succeeded.
    + ICMP payload of 1472 bytes succeeded.
    Path MTU: 1500 bytes.
    
    C:\mturoute-src\bin>mturoute -t www.slashdot.org
    mturoute to www.slashdot.org, 30 hops max, variable sized packets
    * ICMP Fragmentation is not permitted. *
    * Maximum payload is 10000 bytes. *
     1  --+---+++-+++-++  host: 192.168.2.1  max: 1500 bytes
     2  --+---+++-+++-++  host: 10.90.160.1  max: 1500 bytes
     3  --+---+++-+++-++  host: 68.87.56.165  max: 1500 bytes
     4  --+---+++-+++-++  host: 68.87.56.213  max: 1500 bytes
     5  --+---+++-+++-++  host: 68.87.56.209  max: 1500 bytes
     6  --+---+++-+++-++  host: 68.87.56.201  max: 1500 bytes
     7  --+---+-+++++++  host: 68.87.56.197  max: 1472 bytes
     8  --+---+++-+++-++  host: 68.87.56.249  max: 1500 bytes
     9  --+---+++-+++-++  host: 68.87.56.253  max: 1500 bytes
    10  --+---+++-+++-++  host: 68.87.19.177  max: 1500 bytes
    11  --+---+++-+++-++  host: 12.118.149.13  max: 1500 bytes
    12  -----+---+-+--  host: 12.123.3.14  max: 285 bytes
    13  ---+----+-----  host: 12.123.3.109  max: 758 bytes
    14  --+---+++-+++-++  host: 192.205.32.198  max: 1500 bytes
    15  --+---+++-+++-++  host: 204.70.192.186  max: 1500 bytes
    *15 (An additional device responded for 204.70.192.186.)
    *15 (An additional device responded for 204.70.192.186.)
    16  --+---+++-+++-++  host: 204.70.192.13  max: 1500 bytes
    *16 (An additional device responded for 204.70.192.13.)
    17  --+---+++-+++-++  host: 204.70.192.65  max: 1500 bytes
    18  --+---+++-+++-++  host: 204.70.192.70  max: 1500 bytes
    19  --+---+++-+++-++  host: 204.70.192.49  max: 1500 bytes
    *19 (An additional device responded for 204.70.192.49.)
    *19 (An additional device responded for 204.70.192.49.)
    20  --+---+++-+++-++  host: 204.70.192.117  max: 1500 bytes
    *20 (An additional device responded for 204.70.192.117.)
    21  --+---+++-+++-++  host: 204.70.192.90  max: 1500 bytes
    22  --+---+++-+++-++  host: 204.70.192.90  max: 1500 bytes
    *22 (An additional device responded for 204.70.192.90.)
    23  --+---+++-+++-++  host: 208.172.156.198  max: 1500 bytes
    24  --+---+++-+++-++  host: 66.35.194.34  max: 1500 bytes
    *24 (An additional device responded for 66.35.194.34.)
    25  --+---+++-+++-++  host: 66.35.250.151  max: 1500 bytes
    *25 (An additional device responded for 66.35.250.151.)
    *25 (An additional device responded for 66.35.250.151.)
    

    Current Version:

    mturoute v2.1, source code included

    Older Versions:

    mturoute v2, source code included

    mturoute v1, from 6-26-2005
    mturoute.exe, win32 console application, zipped (v1)
    source for mturoute.exe, zipped (v1)

    Related Projects:

    The MTU Eyechart - visual debugging of MTU problems with your HTTP connection