Skip to content
masdzub.com
~/articles/networking — one from the notebook

How to Use MTR to Diagnose Network Latency and Packet Loss

Read an MTR report correctly: flag real loss, avoid the intermediate-hop trap, use TCP mode, and diagnose jitter with concrete commands.

masdzub@website:~$ cat ~/articles/how-to-use-mtr-to-diagnose-network-latency-and-packet-loss.aspx.md
# 1 file · 23 min read · topic: networking · status: published

Introduction

MTR tells you where along a network path latency rises and where packets disappear, and it does this with a single command that refreshes like traceroute while sampling like ping. The part most operators get wrong is interpretation. A loss figure printed next to an intermediate router is usually ICMP rate limiting on that router’s control plane, not a fault on the path. Read the last hop first, then walk upstream and find the first hop where the numbers changed and stayed changed.

The other common mistake is sample size. A default mtr -r run sends ten probes per hop. Ten packets cannot distinguish 0% loss from 10% loss with any confidence. Any conclusion you draw from a 10-packet run about a link that loses 0.5% of traffic is noise wearing a number’s clothing.

This guide covers the mechanics MTR relies on, the exact commands to run for different failure modes, how to read the columns without being fooled, how to get a statistically meaningful sample, and the error messages you will hit on hardened hosts. Everything below assumes MTR 0.93 or newer on Linux, with notes where 0.94+ fields and 0.95+ JSON output change the picture.

Installing MTR and Understanding the mtr-packet Helper

On every mainstream distribution the package is a thin front end plus a helper binary named mtr-packet. The helper is what actually opens raw sockets and sends probes. It is normally installed setuid root or given the cap_net_raw capability, which is why a regular user can run MTR without a password.

Terminal window
# Debian / Ubuntu
sudo apt update && sudo apt install -y mtr-tiny
# RHEL / Rocky / Alma (mtr is in EPEL on older releases)
sudo dnf install -y mtr
# Fedora
sudo dnf install -y mtr
# Arch
sudo pacman -S mtr
# Alpine
apk add mtr

Choose mtr-tiny on Debian if you only need the CLI. The full mtr package pulls in GTK and X11 libraries for the curses/GTK display, which you do not want on a production jump host. Both packages ship the same mtr-packet helper.

Verify the helper’s privileges, because this is the source of about half of all MTR failures on locked-down systems:

Terminal window
$ which mtr-packet
/usr/bin/mtr-packet
$ getcap /usr/bin/mtr-packet
/usr/bin/mtr-packet cap_net_raw=ep
$ ls -l /usr/bin/mtr-packet
-rwxr-xr-x 1 root root 39184 Sep 12 08:41 /usr/bin/mtr-packet

Capabilities and setuid are two different mechanisms and packages pick one. Debian and Ubuntu use cap_net_raw=ep. Fedora and RHEL historically shipped setuid root (-rwsr-xr-x). Both work. What does not work is a container image that stripped capabilities, which produces a raw socket error the moment you run the tool.

Check the version before you rely on any output flag:

Terminal window
$ mtr --version
mtr 0.95

Version 0.94 added jitter fields (Jitter, Jttr, Javg, Jmax, Intr). Version 0.95 added -j/--json output and expanded -o field selection. If your target fleet includes RHEL 8 (mtr 0.92) or older Ubuntu LTS images (0.93), write your parsing scripts against the lowest version present or gate the JSON path behind a version check.

How MTR Actually Probes the Network

MTR sends one probe per hop per cycle, incrementing the TTL from 1 to your maximum hop count, then starts again. Each probe that expires at a router produces an ICMP Time Exceeded message from that router. The source address of that message is what MTR prints as the hop. The final destination, receiving a probe whose TTL is large enough, answers with ICMP Echo Reply (default), a TCP SYN-ACK or RST (with -T), or a UDP port unreachable (with -u).

Two properties follow from this design and they matter for interpretation. First, the loss percentage at hop N is computed only from probes carrying TTL=N. It is not a cumulative figure that includes loss at earlier hops. Second, and because of that, if a router at hop N genuinely drops packets, everything downstream of it shows the same loss, since those packets never arrived. That single fact is the entire diagnostic logic behind reading MTR output. Loss that appears at hop N and vanishes at hop N+1 was never real loss on the path. It was the router choosing not to reply to your probe while still forwarding the traffic.

Default mode uses ICMP Echo. That works on most of the public internet and fails on any provider that filters ICMP toward their core routers. The -T flag switches to TCP SYN probes, which look like an ordinary connection attempt to the destination port you name.

Terminal window
mtr -T -P 443 -c 100 -r app.example.com

The TCP variant is what you reach for when every hop shows ??? in ICMP mode, or when you need to prove that a specific TCP service is reachable and not merely that the host answers ping. It has a cost: intermediate routers do not generate TTL-exceeded for TCP any more reliably than for ICMP, so internal hops frequently stay blank while the final hop responds. A TCP-mode report with blank middle hops and a clean final hop still answers the question you asked.

UDP mode (-u) exists mostly for historical reasons and for paths that filter both ICMP and TCP SYN. It uses a fixed destination port, which makes it easier to allow through a firewall, and it can collide with rate limits on some routers.

Reading the Report Without Being Fooled

The report columns are Loss%, Snt, Last, Avg, Best, Wrst, and StDev. Loss% is the fraction of probes at that TTL that got no reply. Snt is the number of probes sent to that TTL so far, which is your sample size and the thing that decides whether the loss figure means anything. Last is the most recent round trip. Avg is the arithmetic mean of all replies. Best and Wrst are the extremes. StDev is the standard deviation of round trip times at that hop, which is a jitter proxy.

Start with the last line. If the destination shows 0% loss and an average within your latency budget, the path is healthy and you can stop. If the destination shows loss, walk upward and find the first hop where loss is non-zero and where loss persists into every hop below it.

Here is a report where an intermediate router is being misread as a fault:

Start: 2026-11-18T09:14:02+0000
HOST: jumpbox.example.net Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.0.4.1 0.0% 200 0.4 0.5 0.3 1.2 0.1
2.|-- 172.16.88.9 0.0% 200 1.1 2.4 0.9 18.7 3.2
3.|-- ae12.edge1.ams1.example.net 0.0% 200 1.3 1.4 1.2 2.0 0.1
4.|-- ae4.core1.fra2.example.net 35.0% 200 42.1 43.0 41.5 61.2 3.1
5.|-- ae1.core2.fra2.example.net 0.0% 200 42.4 43.1 41.9 58.0 2.8
6.|-- cust-edge.fra2.example.net 0.0% 200 42.6 43.2 42.0 57.9 2.7
7.|-- 203.0.113.44 0.0% 200 42.6 43.2 42.0 57.9 2.7

Hop 4 reports 35% loss. Hop 5 reports 0%. That combination is physically impossible if hop 4 were actually dropping a third of all packets, because every packet that reached hop 5 had to pass through hop 4. The correct reading is that ae4.core1.fra2 rate-limits ICMP TTL-expired generation to roughly 65 packets per second across all flows on that line card, or deprioritizes it in the control plane, and your probe is the one being dropped. The path is fine. Do not open a ticket.

Now here is a report with a real problem:

HOST: app-node.example.net Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.0.4.1 0.0% 500 0.4 0.5 0.3 1.2 0.1
2.|-- 172.16.88.9 0.0% 500 1.1 2.4 0.9 18.7 3.2
3.|-- ae12.edge1.ams1.example.net 0.0% 500 1.3 1.4 1.2 2.0 0.1
4.|-- ae4.core1.fra2.example.net 0.0% 500 38.9 39.4 37.1 52.8 2.9
5.|-- ae1.core2.fra2.example.net 12.6% 500 40.1 41.7 38.0 210.4 11.4
6.|-- cust-edge.fra2.example.net 12.4% 500 41.2 42.0 38.5 208.9 11.2
7.|-- 203.0.113.44 12.4% 500 41.5 42.1 38.6 207.6 11.1

Loss appears at hop 5 and continues to the destination at the same rate. That is real. Something between hop 4 and hop 5 is discarding packets, or the hop 5 device is policing. The StDev jump from 2.9 to 11.4 and the 210 ms worst case suggest queueing as well as drops, which usually means congestion or a policer rather than a hard failure.

The general rule to carry into every report: an isolated loss figure is a rate limiter, a loss figure that repeats on every line below it is a fault.

Building a Sample Large Enough to Mean Something

Run MTR with the default settings and you get 10 probes per hop. Use -c to change that, and choose the count to match the loss rate you are trying to detect.

Terminal window
# 1000 probes at 1 per second, roughly 17 minutes, wide output, no DNS
mtr -rwzc 1000 -i 1 198.51.100.90
# 2000 probes at 5 per second (needs root for sub-second intervals)
sudo mtr -rwzc 2000 -i 0.2 198.51.100.90

The arithmetic behind the count is a binomial confidence interval. If you observe one lost packet in 100 probes, the point estimate is 1%, but the 95% Wilson interval runs from roughly 0.03% to about 5.5%. That interval is far too wide to prove anything about a link that is supposed to be clean. At 1000 probes with 5 losses, the interval tightens to roughly 0.3% to 1.2%, which is enough to say the link is losing about 1% and not zero. To resolve 0.1% loss you need something in the range of 20,000 probes, which is why serious measurements run for an hour or more.

Practical counts for common questions:

QuestionProbes per hopWall clock at 1s interval
Does the destination respond at all1010 s
Is there obvious loss (>5%)1001.7 min
Is loss around 1% statistically real100017 min
Is loss around 0.1% real200005.5 h

However many probes you send, remember that intermediate hops answered under a rate limit. The sample size at hop 4 tells you how many probes were sent, not how many reached the router. Real loss is only meaningful at the destination and at hops that show the same loss figure as the destination.

Choosing the Right Probe Mode

Three modes, three different failure sets.

ICMP Echo is the default and the cheapest. It gets the most complete hop list because ICMP TTL-exceeded is generated by almost every router. It fails when the destination or the path filters ICMP.

Terminal window
mtr -r -c 200 -w target.example.com

TCP SYN is the mode for anything that touches a firewall. Point it at a port the service actually listens on, because a filtered port returns nothing and you learn nothing.

Terminal window
# Probe the TLS port on the actual service
mtr -T -P 443 -r -c 200 -w api.example.com
# Probe SMTP to confirm a mail path
mtr -T -P 25 -r -c 200 -w mx.example.com

UDP mode exists for paths where both ICMP and TCP are filtered. Pick a port that is unlikely to be blocked and unlikely to be answered, so the final hop returns port-unreachable rather than a real service reply.

Terminal window
mtr -u -P 5353 -r -c 200 -w target.example.com

One caveat about TCP mode: probes are SYN packets from an ephemeral source port to your chosen destination port. The OS may see these as half-open connections if they reach the target and the target responds with SYN-ACK, and the RST is generated by the local kernel because the socket does not exist in userspace. On some hardened targets with SYN flood protection enabled, a 2000-probe TCP run can trigger a rate limit or a blocklist entry. If you are measuring a production endpoint, use 100 to 200 probes and ask the owner first.

Diagnosing Latency Rather Than Loss

Loss is the loud failure. Latency and jitter are the quiet ones, and MTR exposes them through the Avg, Best, Wrst, and StDev columns. Comparing Best to Avg tells you how much of the round trip is queueing versus fixed propagation. Comparing StDev across hops tells you where jitter is introduced.

Read these columns as a per-hop delta, not an absolute. Subtract the previous hop’s average from the current hop’s average to get the latency added by that link. A hop showing 42 ms average is only slow if the hop above it showed 5 ms; if the hop above showed 40 ms, the link adds 2 ms and is fine.

HOST: client.example.net Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.0.4.1 0.0% 500 0.4 0.5 0.3 1.2 0.1
2.|-- 172.16.88.9 0.0% 500 1.1 2.4 0.9 18.7 3.2
3.|-- ae12.edge1.ams1.example.net 0.0% 500 1.3 1.4 1.2 2.0 0.1
4.|-- ae4.core1.fra2.example.net 0.0% 500 38.9 39.4 37.1 52.8 2.9
5.|-- ae1.core2.fra2.example.net 0.0% 500 40.0 40.9 38.5 95.6 6.2
6.|-- cust-edge.fra2.example.net 0.0% 500 41.2 41.4 38.9 149.0 10.1
7.|-- 203.0.113.45 0.0% 500 41.5 41.6 39.0 147.2 10.0

Hop 3 to hop 4 adds 38 ms. That is a plausible Amsterdam to Frankfurt propagation delay on fiber and not a problem. Hop 4 to hop 5 adds 1.5 ms on average but the worst case jumps from 52 ms to 95 ms, and hop 6 pushes the worst case to 149 ms. The StDev number climbs from 2.9 to 6.2 to 10.1. Nothing is dropping packets, but something on the hop 5 to hop 6 segment is intermittently queuing, and if you run a latency-sensitive application (VoIP, real-time bidding, a database replication stream) that tail latency is the actual bug report.

Interpret StDev with care. Many routers de-prioritize ICMP TTL-exceeded generation, which can add artificial variance to that hop’s timing without affecting forwarding. If jitter appears only at one intermediate hop and disappears at the next, it is the router’s own scheduler, not the link. If it persists to the destination, it is real.

Jitter fields appear in MTR 0.94 and later. Jttr is the current jitter, Javg is the mean jitter, Jmax is the worst, and Intr is the inter-arrival jitter. To show them you have to order the output fields explicitly, because the default columns do not include them:

Terminal window
mtr -r -c 500 -o "LSD NBAW VJJ JMX" 203.0.113.45

The -o argument takes a string of field letters. The commonly used ones are L (loss ratio), D (dropped), R (received), S (sent), N (last), B (best), A (average), W (worst), V (standard deviation), G (geometric mean), J (current jitter), M (jitter mean), and X (worst jitter). Spaces in the string are ignored, so keep it readable.

Report, Wide, CSV, and JSON Output

The default report truncates hostnames at a width that regularly cuts off the part that identifies the provider. -w gives you the wide format, which is almost always what you want in a ticket.

Terminal window
mtr -rwc 200 target.example.com

-b shows both the resolved name and the IP in the host column, which matters when the same hostname is anycasted to multiple locations.

For anything you want to feed into a dashboard or a log, use CSV or JSON. CSV works on every version from 0.85 onward:

Terminal window
mtr -C -c 200 -r target.example.com

The output is a header row like MTR.0.95.0,host,hop,loss,sent,last,avg,best,worst,stdev followed by one row per hop. A typical parse with awk to find hops with more than 1% loss:

Terminal window
mtr -C -c 1000 -r target.example.com \
| awk -F, 'NR>1 && $4+0 > 1.0 {printf "hop %s %s loss=%s%%\n", $3, $2, $4}'

JSON requires MTR 0.95 or later:

Terminal window
mtr -j -c 500 -r target.example.com \
| jq -r '.report.hubs[] | select(."Loss%" > 0) | "\(.count)\t\(.host)\t\(."Loss%")%\t\(.Avg)"'

If your fleet mixes 0.92 and 0.95, detect it once and branch:

Terminal window
if mtr --version | awk '{print $2}' | awk -F. '$2 >= 95 {exit 0} {exit 1}'; then
mtr -j -c 500 -r "$TARGET" > "/var/log/mtr/$TARGET.json"
else
mtr -C -c 500 -r "$TARGET" > "/var/log/mtr/$TARGET.csv"
fi

Keep the raw output. A loss figure without the per-hop breakdown, the probe count, and the timestamp is not evidence; it is an assertion.

Advanced Topology Concerns: ECMP, MPLS, and Asymmetry

Equal-cost multipath routing breaks MTR’s implicit assumption that every probe traverses the same path. When a router has two equal-cost next hops, it hashes on the packet’s 5-tuple (or, on some platforms, on a subset of the header) and forwards the packet through one of them. MTR increments the TTL of each probe, so different probes can take different paths at different TTLs and arrive with different round trip times and different hop identities.

Two symptoms point at ECMP. First, a single hop alternates between two different IP addresses across refresh cycles in the curses view. Second, latency jumps up or down by a fixed offset when you rerun the same command seconds later. TCP mode helps because you can pin the destination port and therefore the hash, though some routers include the TTL in the hash input and defeat this.

Terminal window
# Repeat three times and compare hop 5 across runs
for run in 1 2 3; do
mtr -T -P 443 -r -c 100 -w target.example.com | sed -n '5,7p'
sleep 5
done

MPLS label stacks are visible with -e on MTR 0.86 and later. On a carrier path, the label a packet carries at each hop tells you which LSP it is taking, and that is often the quickest way to prove to a provider that two flows to the same destination take different internal paths.

Terminal window
mtr -re -c 100 -w 198.51.100.77

Asymmetry is the concern MTR cannot see. MTR measures round trip time from your host to each hop. It does not tell you which return path the ICMP response took. If the outbound path goes through Amsterdam and the return path goes through London, you will see a healthy 10 ms average to each hop even though the application’s traffic might take a different route entirely. For any investigation where direction matters, run MTR from both ends and compare. The reverse trace is the single most valuable piece of evidence in an “our side is fine” dispute with a provider.

Common Error Messages and What They Mean

mtr: unable to get raw sockets: Operation not permitted

The helper could not open a raw socket. This happens in three situations: you are running in a container without CAP_NET_RAW, the mtr-packet binary lost its capability during an upgrade, or SELinux/AppArmor is blocking the helper.

Check the capability:

Terminal window
getcap /usr/bin/mtr-packet

If it is empty, restore it:

Terminal window
sudo setcap cap_net_raw+ep /usr/bin/mtr-packet

In a container, add the capability at runtime:

Terminal window
docker run --rm --cap-add=NET_RAW --network host alpine \
sh -c "apk add mtr && mtr -rwc 100 1.1.1.1"

Running inside a container without --network host gives you a path that starts from the container’s virtual bridge, not the host’s, so the first few hops are meaningless. Always pass --network host if you want a real view of the host’s path.

mtr: Failure to start mtr-packet: Invalid argument

The helper exists but could not be executed. On Ubuntu with AppArmor enforcing, a helper inside a mounted volume or a non-standard path (/usr/local/bin/mtr-packet, /opt/mtr/bin/mtr-packet) can be denied by the profile even though the file mode and capability look correct. Check:

Terminal window
sudo dmesg | tail -20 | grep -i apparmor

You will see a line like apparmor="DENIED" operation="exec" profile="mtr" name="/usr/local/bin/mtr-packet". Either move the binary to /usr/bin/mtr-packet or add an AppArmor rule to permit the path.

The second common cause is a missing helper entirely. If you copied mtr from another host, or installed from a source tarball without make install, mtr-packet may not be present:

Terminal window
$ ls -l /usr/bin/mtr-packet
ls: cannot access '/usr/bin/mtr-packet': No such file or directory

Reinstall the package.

Every hop shows ??? in ICMP mode

Three possible causes, in order of likelihood. Your destination filters ICMP entirely (common on hardened servers and any host behind a cloud security group). The path filters ICMP TTL-exceeded (some transit providers do this on their core routers while forwarding packets normally). Or you are on a network that blocks outbound ICMP, which most corporate proxies and many VPS providers do on the public side.

Try TCP mode before you conclude anything:

Terminal window
mtr -T -P 443 -c 100 -r target.example.com

If TCP mode resolves the destination and shows zero loss, the path is healthy and ICMP was simply filtered. If TCP also fails, test reachability separately with nc -vz -w 5 target.example.com 443 to prove the port is open before blaming the tracing tool.

mtr: only root can set the interval below 1.0

You passed -i 0.5 without root. The helper runs unprivileged for anything that does not need the capability, and sub-second intervals require root. Either use sudo or accept a 1-second interval and raise the count.

Terminal window
sudo mtr -rwc 2000 -i 0.2 target.example.com

Be aware that at sub-second intervals you can trigger ICMP rate limits on the intermediate routers and start seeing loss at intermediate hops that would not appear with normal spacing.

sendto: Network is unreachable on an IPv6 target

Your host has no route to the IPv6 destination, usually because the interface has a link-local address only. Check:

Terminal window
ip -6 route show default

If the output is empty, you do not have a default IPv6 route and MTR cannot help. Test over IPv4 instead, or fix the routing first.

Failed to resolve host: Temporary failure in name resolution

MTR tries to resolve every hop’s IP to a name by default, and on a jump host with a slow or broken resolver each hop blocks for the resolver timeout, which can add seconds per refresh. Run with -n (no DNS) if you do not need reverse names:

Terminal window
mtr -rn -c 500 -w target.example.com

If you do need names but resolution is slow, pre-resolve the destination and use -n for the rest, then resolve the interesting hops individually with dig -x.

A Real Investigation, Step by Step

A support ticket lands with the usual shape: an application at app.example.com intermittently times out, the application team says “the network is dropping packets,” and the network team has no evidence either way. Here is how to produce evidence quickly.

First, confirm the symptom with the smallest tool available. ping from the application host toward the client, 1000 packets, gives an independent loss figure that you can cross-check against MTR:

Terminal window
ping -c 1000 -i 0.2 -q 198.51.100.44

Second, run MTR toward the client from the application host, in TCP mode on the application port, with enough probes to resolve 1% loss:

Terminal window
mtr -T -P 443 -rwzc 1000 198.51.100.44 | tee /tmp/mtr-app-to-client.log

Third, ask the client to run the reverse trace toward app.example.com, same flags, same count, and send the file back. The comparison is what ends the conversation.

Fourth, if both directions show loss but at different hops, that is normal and is asymmetry. If one direction is clean and the other is not, the faulty direction identifies the provider whose network you should escalate to.

Fifth, if the destination is clean and only intermediate hops show loss, close the ticket as not-a-network-fault and point the application team at their own logs. This is the outcome more than half the time.

Finally, if loss persists at the destination, capture the report with timestamps, count, and version, and send it to the transit provider. Providers respond to a report containing mtr version, probe count, mode, and both directions because they can reproduce it. They ignore “the network is slow.”

What MTR Cannot Tell You

MTR measures the forward path from a single vantage point, using a single packet size, at a single moment. Anything outside that window is invisible to it.

It cannot see application-layer retransmits. A TCP stream that stalls due to zero-window events will look fine in MTR because the network was never the problem. Use ss -tin or tcpdump to check retransmit counters on the socket.

It cannot see per-packet-size issues. A path with a 1400-byte MTU that silently drops fragments will pass a default-size MTR probe and fail a real TLS handshake. Probe with the payload size you care about:

Terminal window
# 1472 bytes payload + 28 bytes IP/ICMP header = 1500 byte frame
mtr -r -s 1472 -c 100 target.example.com

If the 1472-byte run shows loss and the default run does not, you have an MTU or fragmentation problem. Combine with ping -M do -s 1472 to find the actual path MTU, then set it on the interface or fix the tunnel.

It cannot see the return path, as covered above. And it cannot see short-lived loss events that do not align with your sample. A link that drops 100% of traffic for 3 seconds every 20 minutes may produce a clean 1000-probe MTR run if the run happens to fall entirely inside the quiet windows. For intermittent faults, run MTR continuously in the background and log the results with timestamps, then correlate against application errors after the fact:

Terminal window
while true; do
mtr -C -c 60 -r 198.51.100.44 >> /var/log/mtr/continuous.csv
sleep 60
done

The -C output prepends the MTR version but does not include a timestamp per row, so wrap it with ts or a shell date prefix in the log file, otherwise correlating a loss spike against an application error later is guesswork.

Wrapping Up the Diagnostic Loop

The useful mental model for MTR is short. Loss that persists to the destination is real; loss isolated to a single hop is rate limiting. Latency you care about is the per-hop delta, not the absolute figure. Jitter that appears and disappears at one hop belongs to the router; jitter that persists to the destination belongs to the path. Probe counts below a few hundred are for confirming reachability, not for measuring loss rates. Run both directions when you can, and keep the raw output with the timestamp and version.

Those five rules cover the majority of MTR investigations you will do. The rest is knowing which flag to reach for, and that part is mostly about the target: ICMP when nothing filters it, TCP when something does, sub-second intervals when you need the sample volume, and -s when you suspect the path MTU. Everything else is bookkeeping.

found this useful? share it →
Written by

Dzubayyan Ahmad

System Administrator, SRE & Technical Support Engineer specialising in web hosting infrastructure — Linux servers, automation, and monitoring. Writing these notes since 2015 so future-me can find the fix again.