Developer & Network Tools

MTR: Combining Ping and Traceroute

Run MTR, read its loss and latency columns, and avoid blaming the wrong router along the path.

Key takeaways

  • MTR repeatedly probes each hop, so intermittent loss and delay become visible over time.
  • Loss at a middle hop that disappears further on is usually the router rate-limiting its own replies.
  • Loss or delay that starts at one hop and persists to the end is worth reporting.
  • The return path can differ from the forward path, so tests from both ends help.
  • Use report mode with plenty of cycles when sharing results.

MTR is a diagnostic tool that traces the route to a destination and then keeps probing every hop on it, building up loss and latency figures for each one. In one live table you get the path that traceroute shows and the repeated measurements that ping gives.

The table is easy to produce and easy to misread. The most important rule: a problem that is real usually continues to the final destination.

How it works

Every IP packet carries a time-to-live value, called the hop limit in IPv6. Each router subtracts one, and when it reaches zero the router discards the packet and usually sends back an ICMP "time exceeded" message. MTR sends probes with a limit of 1, then 2, then 3, and so on, which makes each router along the way identify itself. It then repeats the whole cycle and keeps statistics.

How hops reveal themselves
Your computer Router 1 Router 2 Destination Probe with TTL 1 1 Time exceeded 2 Hop 1 is now known Probe with TTL 2 3 Time exceeded 4 Hop 2 is now known Probe with a larger TTL 5 Reply from the destination 6 The path is complete Your computer Router 1 Router 2 Destination Probe with TTL 1 1 Time exceeded 2 Hop 1 is now known Probe with TTL 2 3 Time exceeded 4 Hop 2 is now known Probe with a larger TTL 5 Reply from the destination 6 The path is complete

TTL and hop limits covers why this field exists in the first place.

Installing and running it

MTR is available in the package managers of most Linux distributions and through common macOS package managers. Some systems need elevated rights to send the probes.

mtr example.com
sudo mtr example.com
mtr -rw -c 100 example.com
mtr -n example.com
mtr -4 example.com
mtr -6 example.com

The interactive view updates continuously; press q to quit. -r produces a report after a set number of cycles, -w keeps long host names from being cut off, and -c sets the cycle count. -n skips reverse DNS lookups, which is faster.

On Windows, the built-in pathping example.com does something related, collecting statistics per hop after tracing, and takes a few minutes. Third-party Windows ports with a graphical window, such as WinMTR, also exist. Download tools only from sources you trust.

Changing the probe type

By default MTR uses ICMP echo probes. Networks sometimes treat ICMP differently from real application traffic, so MTR can send TCP or UDP instead:

sudo mtr -T -P 443 example.com
sudo mtr -u example.com

The first line probes with TCP toward port 443, which resembles HTTPS traffic and often gets through firewalls that drop ping. UDP probes are useful when investigating voice or game traffic, though some targets won't answer them. If the results differ sharply between probe types, filtering or traffic handling along the way is a likely reason.

Reading the columns

A hypothetical report looks like this:

HOST                  Loss%  Snt  Last  Avg  Best  Wrst StDev
1. 192.168.1.1         0.0%  100   1.2  1.4   0.9   6.1   0.6
2. 198.51.100.1        0.0%  100   9.8 10.3   8.7  22.4   1.9
3. 198.51.100.33      45.0%  100  11.0 12.1   9.9  40.2   4.4
4. 203.0.113.9         0.0%  100  18.4 18.9  17.6  29.0   1.7
5. 203.0.113.80        0.0%  100  19.1 19.5  18.2  31.3   1.8
  • Loss%: share of probes with no reply.
  • Snt: probes sent.
  • Last, Avg, Best, Wrst: latest, average, lowest and highest round-trip times in milliseconds.
  • StDev: how widely times vary.

Hop 3 shows 45 percent loss, yet hops 4 and 5 show none. Packets that reached the destination passed through hop 3, so it is forwarding them fine. It is simply declining to answer many of the probes addressed to its own control functions.

Real loss versus harmless loss

Is the loss at this hop real?
Does loss disappear at later hops, including the destination? YES Likely reply rate limiting on that router. Ignore it. 1 NO Does loss begin here and continue to the final hop? YES Traffic is probably being lost at or near this point, or returning from it. 2 NO Is loss seen only at the final destination? YES Suspect the host, its firewall or its own link. Try TCP probes. 3 NO No clear pattern Run more cycles, repeat at other times and test from the other end. Does loss disappear at later hops, including the destination? 1 IF YES Likely reply rate limiting on that router. Ignore it. NO Does loss begin here and continue to the final hop? 2 IF YES Traffic is probably being lost at or near this point, or returning from it. NO Is loss seen only at the final destination? 3 IF YES Suspect the host, its firewall or its own link. Try TCP probes. NO No clear pattern Run more cycles, repeat at other times and test from the other end.

Latency follows the same logic. A single hop with a high average, followed by lower figures, means that router answers slowly, not that it delays your traffic. A jump that carries through every later hop marks a real increase. It may be perfectly normal: crossing an ocean adds delay that physics sets.

Unknown hops and odd names

Lines showing ??? or "waiting for reply" mean a hop didn't answer. If later hops respond, nothing is blocked. If every line after a point is silent and the destination never appears, the probes are being dropped there or beyond, or the destination ignores them.

Several addresses at the same hop number can appear when traffic is balanced across parallel links.

Router host names sometimes contain city or interface abbreviations. They can hint at location, but naming is up to each operator and may be stale. Don't build an accusation on a name.

Names and addresses also change as traffic crosses from one network to another. Each of those networks is an autonomous system, and some MTR builds can show AS numbers with the -z option.

Reading latency and variation

The average column is the usual summary, but the others add context. Best approximates what the path can do when nothing is queued. Wrst shows the single slowest reply, which one unlucky probe can inflate. A large StDev at the final destination means times are inconsistent, which matters for calls, video meetings and games even when the average looks fine. Jitter and packet loss explains why.

In the interactive view, pressing keys changes the display on many builds; the built-in help lists them. You can also choose which columns a report includes with the -o option, and check your version's manual for the letters.

To tell congestion from distance, compare runs at different times of day. Delay due to distance stays about the same around the clock. Delay due to a full link tends to rise at busy hours and fall at quiet ones. If times at your first hop beyond the router climb sharply only while you upload large files, the queue is probably in your own equipment, and bufferbloat is worth reading about.

A worked interpretation

Suppose a hypothetical video meeting keeps freezing in the evenings. You run 200 cycles from a wired computer. Hop 1, your router, shows no loss. Hop 2 shows 6 percent loss, hop 3 shows 5 percent, and the destination shows 6 percent. The loss starts at the second hop and carries all the way through, so it is real, and it sits at or near your access link.

You repeat the run the next morning and see no loss anywhere. Together, the two reports describe a time-dependent fault close to your end. That is specific enough for a provider to act on: they can check signal levels on your line and congestion on the local segment.

Now imagine instead that hop 2 showed 40 percent loss while every later hop showed zero. You would conclude that hop 2 limits its replies, and look for the cause of the freezing elsewhere, perhaps in Wi-Fi, the meeting application or the computer itself.

Sharing machine-readable results

MTR can print reports in formats such as CSV or JSON on many builds, using options like --csv or --json. These are handy if you schedule runs and want to chart them later:

mtr -rw -c 100 example.com > mtr-$(date +%Y%m%d-%H%M).txt

That line saves a timestamped text report. Running it a few times a day for a week, against one destination, gives you a baseline and catches intermittent trouble that a single manual test would miss. Keep the frequency modest.

The hidden return path

MTR measures round trips. Your probes travel one way and the replies may come back along a different route, which is common between large networks. Loss reported at a hop can originate on the way back, where you can't see it.

If you control both ends, or can ask someone at the other end, run MTR in both directions. Comparing the two often locates a fault that one report leaves ambiguous.

A good troubleshooting routine

Collecting a report worth sending
1 Use a wired connection Remove Wi-Fi as a variable where possible. 2 Run while the fault happens A report from a good hour proves little. 3 Send 100 or more cycles Small samples exaggerate single drops. 4 Save a baseline Compare with a run from a time when things worked. 5 Share both with times Include date, time zone, source and destination. Use a wired connection Remove Wi-Fi as a variable where possible. 1 Run while the fault happens A report from a good hour proves little. 2 Send 100 or more cycles Small samples exaggerate single drops. 3 Save a baseline Compare with a run from a time when things worked. 4 Share both with times Include date, time zone, source and destination. 5

If loss starts at hop 1, the problem is between your computer and your router. Check Wi-Fi signal and cables first. If it starts at hop 2, look at the link between your equipment and your provider. Further out, the fault is likely in a network you can't change, and a clear report to your provider is your best move.

When MTR isn't the right tool

If a site is slow but MTR shows a clean path, the network is probably not the cause. Time the request with curl to see whether the delay is in DNS, connection setup or the server's response. If a single application fails while everything else works, test the port it uses. And if the destination can't be found at all, MTR won't start usefully until the name resolves, so check DNS first.

Limits to keep in mind

MTR can't see inside switches or other equipment that forwards without lowering the TTL, and tunnels may collapse many physical hops into one. It tells you nothing about bandwidth. It also generates steady traffic, so don't leave it running for days against systems that aren't yours.

Before sharing a report publicly, consider removing your own public address and any internal host names from the first few lines. Providers can look those up from your account if they need them.

Finally, remember what a clean report means. It shows that probes of one type, sent at one time, reached each hop and came back. If the trouble returns later, run it again while it is happening and put the new table next to the clean one.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Developer & Network Tools →

Latest news on this topic