mtr online

mtr online is an advanced version of the typical traceroute (or tracepath, tracert, tcptraceroute) command. mtr combines ping and a traditional traceroute and will ping each hop in the network path.


mtr usage

mtr is a very effective way of discovering packet loss on particular hops in the path when troubleshooting connectivity problems.

Responses are determined from ICMP Time exceeded replies and ICMP echo replies from the destination node. It is possible to have mtr use UDP by specifying -u on the command line. When UDP mode is utilized, mtr watches for ICMP port unreachable packets (type 3, code 3) from the destination.

About mtr

For a brief introduction to mtr we will look at the first two paragraphs of the man page.

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 HOSTNAME by sending packets with purposely low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. A sudden increase in packet loss or response time is often an indication of a bad (or simply overloaded) link.

Install mtr in Windows or Linux

mtr can be installed under Ubuntu linux by installing the MTR package. A simple apt-get install mtr will do it, or if you prefer use the package manager to install the program. For Windows users there is a win32 based version of mtr that uses the same methodology but completely different code due to the major architecture differences in the operating systems.


test@home:~$ mtr --help

Usage: mtr [options] hostname -F, --filename FILE read hostname(s) from a file -4 use IPv4 only -6 use IPv6 only -u, --udp use UDP instead of ICMP echo -T, --tcp use TCP instead of ICMP echo -I, --interface NAME use named network interface -a, --address ADDRESS bind the outgoing socket to ADDRESS -f, --first-ttl NUMBER set what TTL to start -m, --max-ttl NUMBER maximum number of hops -U, --max-unknown NUMBER maximum unknown host -P, --port PORT target port number for TCP, SCTP, or UDP -L, --localport LOCALPORT source port number for UDP -s, --psize PACKETSIZE set the packet size used for probing -B, --bitpattern NUMBER set bit pattern to use in payload -i, --interval SECONDS ICMP echo request interval -G, --gracetime SECONDS number of seconds to wait for responses -Q, --tos NUMBER type of service field in IP header -e, --mpls display information from ICMP extensions -Z, --timeout SECONDS seconds to keep probe sockets open -M, --mark MARK mark each sent packet -r, --report output using report mode -w, --report-wide output wide report -c, --report-cycles COUNT set the number of pings sent -j, --json output json -x, --xml output xml -C, --csv output comma separated values -l, --raw output raw format -p, --split split output -t, --curses use curses terminal interface --displaymode MODE select initial display mode -n, --no-dns do not resolve host names -b, --show-ips show IP numbers and host names -o, --order FIELDS select output fields -y, --ipinfo NUMBER select IP information in output -z, --aslookup display AS number -h, --help display this help and exit -v, --version output version information and exit See the 'man 8 mtr' for details.