What is MTR Print

  • 0

What is a traceroute?

Traceroute is a tool used to diagnose problems in a network path. Traceroute is used to understand the path IP packets are taking from one computer (source IP address) to another (destination IP address). The command traceroute (on Linux or macOS) or tracert (on Windows) makes it possible to understand:

  • The path your packets are taking (including the IP addresses of each router)
  • The RTT* between the source and each hop, or router the packets pass through, in the network path

*Round-trip time (RTT) is the amount of time it takes for data to get to and from a certain point on a network.

Here is an example traceroute to 1.1.1.1. The lines with asterisks (* * *) represent hops from which packets were not returned; this can happen when routers are configured to ignore traceroute packets. The millisecond times in each line are the roundtrip times from the source to that hop for each packet (traceroute sends three packets at a time to verify the results).

Traceroute example

traceroute to 1.1.1.1 (1.1.1.1), 64 hops max, 52 byte packets
1 myrouter (192.168.47.1) 2.755 ms 1.452 ms 1.325 ms
2 * * *
3 69.168.32.65 (69.168.32.65) 18.159 ms 18.658 ms 15.091 ms
4 * * *
5 206.126.237.30 (206.126.237.30) 30.453 ms 50.242 ms 24.342 ms
6 one.one.one.one (1.1.1.1) 29.000 ms 26.784 ms 26.017 ms

To install WinMTR on Windows

1. Download the latest version of WinMTR

2. You will have a .zip file containing two folders: WinMTR-32 and WinMTR-64

3. Each folder contains two files: WinMTR.exe and README.txt

4. Extract the WinMTR.exe that corresponds to your platform (32 or 64 bit) and run the file.

 

To install MTR on Debian and Ubuntu

Issue the following commands to ensure that your system’s package repository is up to date, that all installed packages are up to date, and finally to install MTR itself:



apt-get update

apt-get upgrade

apt-get install mtr-tiny

CentOS and Fedora:

Issue the following commands to update repositories, upgrade installed packages, and install the MTR program:



yum update

yum install mtr

Arch Linux systems:

Issue the following commands to update the package database and install MTR:



pacman -Sy pacman -S mtr

 

Mac OSX

1. Press Command+Space and type Terminal and press enter/return key.

2. Type in Terminal app:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

3. Press enter/return key. Wait for the command to finish.

4. Run:

brew install mtr

5. You can now run MTR

What is a network path?

A network path refers to the sequence of networks a packet passes through in order to reach its destination.

The Internet is a massive collection of networks that connect to one another via routing. Most Internet endpoints — for example, a web browser trying to access a website and the server which hosts that website — are not part of the same network. This means that if said web browser sends a request to the website’s servers, the request will probably have to hop between several intermediary networks along the way.


How does traceroute work?

A traceroute tool sends packets to a destination IP and with a time-to-live (TTL) set to 1, so that the first router the packets reach will send back an error (“time exceeded”). When the error returns, the traceroute tool records the first router’s identity and round-trip time, increments the TTL, and sends new packets, repeating this process until either 1) the last packet reaches the destination IP or 2) two sets of packets are dropped.

By doing this, the tool enables you to understand the path your packets are taking and the roundtrip time to each hop, so you can troubleshoot packet loss and latency.

Traceroute relies on the ICMP (Internet Control Message Protocol) protocol. ICMP is a network layer protocol used for error testing. It has no associated transport protocol, running directly on the Internet Protocol (IP). When the TTL of a packet sent by the traceroute tool is exceeded, the router sends back an ICMP Type 11 (Time Exceeded Error) packet.

Outgoing packets (sent from the starting router) can use ICMP (default on macOS and Linux operating systems) or UDP (default on Windows). Choosing a different protocol for outgoing traceroute packets is one way to get more complete results if routers along the network path are configured to filter out packets of a certain protocol.


What is My Traceroute (MTR)?

My Traceroute (MTR) is a tool that combines traceroute and ping, which is another common method for testing network connectivity and speed. In addition to the hops along the network path, MTR shows constantly updating information about the latency and packet loss along the route to the destination. This helps in troubleshooting network issues by allowing you to see what’s happening along the path in real-time.

MTR works by discovering the network path in a similar manner to traceroute, and then regularly sending packets to continue collecting information to provide an updated view into the network’s health and speed.

Like traceroute, MTR can use ICMP or UDP for outgoing packets but relies on ICMP for return (Type 11: Time Exceeded) packets.


How to read MTR

Below are three examples of how to read and draw conclusions from MTR output.

MTR #1: All clean

Start: 2020-04-08T13:28:52+0100
HOST: myrouter   Loss%   Snt   Last   Avg   Best   Wrst   StDev
1.|-- 10.10.1.1  0.0%    10    0.3    0.4   0.3    0.4    0.0
2.|-- 141.0.147.177.bcube.co.uk  0.0%  10    2.7    2.7   2.5    3.1    0.2
3.|-- 172.16.28.38  0.0%  10    2.8    6.4   2.8   22.2   6.1
4.|-- 172.17.13.76  0.0%  10    1.1    2.8   1.1   14.6   4.2
5.|-- 172.17.13.49  0.0%  10    1.4    4.0   1.3   25.0   7.4
6.|-- 172.17.13.24  0.0%  10    2.5    2.7   2.0    5.1   1.1
7.|-- one.one.one.one  0.0%  10    1.3    1.2   1.2    1.3   0.0

This example follows the network path between the starting router and 1.1.1.1 DNS server. The MTR output does not indicate any problems — it takes 7 hops to reach 1.1.1.1, and none of them indicate any packet loss.

MTR #2: Packet loss - or is there?

Start: 2020-04-08T12:48:28+0000
HOST: myrouter   Loss%   Snt   Last   Avg    Best   Wrst   StDev
1.|-- 2400:cb00:207:1000::1   0.0%   10   1.1   6.0    0.6   15.7   5.9
2.|-- 2404:d400:4000:27::1    0.0%   10   0.4   0.6    0.2    2.9   0.8
3.|-- 2404:d400:0:8::         0.0%   10 125.7 125.7  125.7  126.2   0.2
4.|-- 2001:978:2:42::e:1     50.0%   10 129.2 129.6  129.2  130.5   0.6
5.|-- be2846.ccr42.fra03.atlas.cogentco.com  80.0%  10 151.9 139.5 127.1 151.9 17.6
6.|-- be2814.ccr42.ams03.atlas.cogentco.com  80.0%  10 136.2 137.0 136.2 137.8  1.1
7.|-- be2183.ccr22.lpl01.atlas.cogentco.com  50.0%  10 146.3 146.2 145.9 146.3  0.1
8.|-- be3043.ccr22.ymq01.atlas.cogentco.com  30.0%  10 215.3 215.2 215.0 215.4  0.2
9.|-- be3260.ccr32.yyz02.atlas.cogentco.com  90.0%  10 227.8 227.8 227.8 227.8  0.0
10.|-- be2994.ccr22.cle04.atlas.cogentco.com 30.0%  10 234.9 234.9 234.5 235.1  0.2
11.|-- be2718.ccr42.ord01.atlas.cogentco.com 70.0%  10 233.7 233.8 233.7 233.9  0.1
12.|-- be2832.ccr22.mci01.atlas.cogentco.com 50.0%  10 244.8 245.1 244.8 245.5  0.3
13.|-- be3036.ccr22.den01.atlas.cogentco.com 30.0%  10 259.6 259.6 259.3 259.8  0.2
14.|-- be3038.ccr32.slc01.atlas.cogentco.com 90.0%  10 267.2 267.2 267.2 267.2  0.0
15.|-- be3110.ccr22.sfo01.atlas.cogentco.com 10.0%  10 291.0 291.1 291.0 291.4  0.1
16.|-- be3670.ccr41.sjc03.atlas.cogentco.com 30.0%  10 292.6 292.7 292.6 292.8  0.1
17.|-- 2001:550:2:1f::29:2    0.0%   10 312.3 291.5 287.0 312.3  8.6
18.|-- ???                     100.0% 10   0.0   0.0   0.0   0.0   0.0
19.|-- ???                     100.0% 9    0.0   0.0   0.0   0.0   0.0
21.|-- 2400:cb00:36:1008::a29e:40e2  0.0%  9  302.9 302.9 302.8 303.2 0.1

This example shows the network path between the starting router and an IPv6 destination. The output shows significant packet loss on several intermediary hops, however there is no packet loss on the last hop. This often indicates the path is not actually losing traffic — instead, some routers may be rate-limiting the responses they send back (often called “control plane policing”), while still forwarding traffic normally.

MTR #3: Actual packet loss

Start: 2020-04-08T13:32:30+0000
HOST: myrouter   Loss%   Snt   Last   Avg   Best   Wrst   StDev
1.|-- 162.158.216.129  0.0%  10   0.7   6.9   0.7  62.6  19.6
2.|-- 118.69.221.209   0.0%  10   0.2   0.3   0.2   1.3   0.3
3.|-- 118.69.252.172   0.0%  10   0.7   1.0   0.6   2.9   0.7
4.|-- 118.69.132.169   0.0%  10  11.4  11.3  11.2  11.5   0.1
5.|-- 118.69.247.64    0.0%  10  34.2  34.4  33.9  37.2   1.0
6.|-- 13335.sgw.equinix.com  50.0%  10  27.5  27.9  27.1  29.1  0.8
7.|-- 162.158.161.251  30.0%  10  26.8  26.8  26.8  26.8  0.0

This example shows the network path between the starting router and the destination, and indicates packet loss on the last two hops. Packet loss at the end of the route is more likely to reflect a real problem affecting traffic to the destination.


Further MTR options

MTR has a lot of options. You can find more through the MTR help page: mtr --help

Some of the frequently used options are:

  • TCP MTR: Instead of using ICMP packets, use TCP. You can optionally choose a destination port as well.
  • UDP MTR: Use UDP instead of ICMP. This can be used to circumvent routers that are blocking ICMP packets, or for the purpose of testing a specific port.
  • Show IPs: Shows IP addresses next to the records for each hop. This makes it easier to report issues upstream.
  • AS Lookup: Shows the AS number in the MTR.

```


Je li Vam ovaj odgovor pomogao?
Back