One of the not so well know networking tools available on Linux is MTR.  MTR combines the functionality of the traceroute and ping programs in a single net-work diagnostic tool.  As mtr starts, it investigates the network connection between the host mtr runs on and a user-specified destination host. After it determines the address of each network hop between the machines, it sends a sequence ICMP ECHO requests to each one to determine the quality of the link to each machine. As it does this, it prints running statistics about each machine.   A sudden increase in packet-loss or response time is often an indication of a bad (or simply overloaded) link.  mtr is fairly easy to use once you have a look at the different options possible:

mtr-help-flags

This shows us the usage flags and options.
So in order to know more about the different flags we will take a look at them now:

OPTIONS
-h help
Print the summary of command line argument options.

-v –version
Print the installed version of mtr.

-r –report
This option puts mtr into report mode. When in this mode, mtr will run for
the number of cycles specified by the -c option, and then print statistics and
exit.
This mode is useful for generating statistics about network quality. Note
that each running instance of mtr generates a significant amount of network
traffic. Using mtr to measure the quality of your network may result in
decreased network performance.

-c COUNT –report-cycles COUNT
Use this option to set the number of pings sent to determine both the machines
on the network and the reliability of those machines. Each cycle lasts one
second.

-s BYTES –psize BYTES

PACKETSIZE
These options or a trailing PACKETSIZE on the commandline sets the packet size
used for probing. It is in bytes inclusive IP and ICMP headers

If set to a negative number, every iteration will use a different, random
packetsize upto that number.

-t –curses
Use this option to force mtr to use the curses based terminal interface (if available).

-n –no-dns
Use this option to force mtr to display numeric IP numbers and not try to
resolve the host names.

-g –gtk
Use this option to force mtr to use the GTK+ based X11 window interface (if
available). GTK+ must have been available on the system when mtr was built
for this to work. See the GTK+ web page at
www DOT gimp DOTorg/gtk/for more information about GTK+.

-p –split
Use this option to set mtr to spit out a format that is suitable for a split-
user interface.

-l –raw
Use this option to tell mtr to use the raw output format. This format is better
suited for archival of the measurement results. It could be parsed to be
presented into any of the other display methods.

-a IP.ADD.RE.SS

–address IP.ADD.RE.SS
Use this option to bind outgoing packets’ socket to specific interface, so
that any packet will be sent through this interface. NOTE that this option
doesn’t apply to DNS requests (which could be and could not be what you want).

-i SECONDS

–interval SECONDS
Use this option to specify the positive number of seconds between ICMP ECHO
requests. The default value for this parameter is one second.

-4
Use IPv4 only.

-6
Use IPv6 only.

Ok now we see that we have lots of options to play with here.

Ok back to the terminal we are going to look at a target computer with the -r (report mode) and -c (count) set to 1

mtr-excecution

We only care about the first two columns. The first is the name of the nodes along the route,and the second is the percent of packets that were lost. If we lose packets then the traceroute must find a new way to get to the destination. Sometimes nodes along our route will drop these packets. You can see that our query was didnt have any isues until hop #13 where it clearly failed and had to find a new route.  Remember just like any traceroute the first node returned is the closest to your box and the last is farthest away. The next step we would take is do do individual whois on the hops which failed in order to determine the reasons for the packet loss.

If your distribution  of choice does not have the MTR program installed or it is not available with the package manager it can be downloaded from here

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , , , , ,
5 Responses to “How to Use MTR (Traceroute and Ping Combined)”
  1. Rob says:

    So what does the

    Last Avg Best Wrst StDev

    mean?

    is that ping in MS?

    what do you make of this?

    Loss% Snt Last Avg Best Wrst StDev
    0.0% 100 0.6 60.5 0.3 2064. 293.2

    [Reply]

  2. Luis says:

    Last means the time of the last try you use the program, Avg the average of the times, Best the best time you got, Wrst the worst and StDev is the standard desviation, the only I’m looking for it’s meaning is “Snt”.
    If someone knows please respond

    [Reply]

    Daniel Reply:

    Snt is the number of packages sent

    [Reply]

    alex Reply:

    Hello Daniel,

    Hadn’t seen that comment come in sense this is not my article but just wanted to say thank you for taking the time to respond with the answer.

    Thanks!

    [Reply]

  3.  
Leave a Reply

*Type the letter/number combination in the abvoe field before clicking submit.

*