Sub topic 13
pathping: per-hop loss statistics on Windows
This chapter assumes you can read tracert output and ping results, and that you know TTL and ICMP Time Exceeded messages are what make a traceroute work. If those are unfamiliar, review the earlier chapters first.
What pathping does
pathping is a Windows tool that combines tracert and ping. It runs in two phases:
- It traces the route to the destination, as
tracertdoes. - It then sends many echo requests to every hop along that route for a fixed period. It reports how many replies each hop returned.
A single tracert run sends only three probes per hop. That is too few to tell a lossy link from one unlucky packet. pathping collects a larger sample for each hop, so you can see where loss or latency begins.
Running it
pathping example.com
pathping -n -q 50 -p 200 example.com
pathping -h 20 -w 1000 8.8.8.8Common options:
| Option | Meaning |
|---|---|
| `-n` | Do not resolve addresses to names. This is faster. |
| `-h count` | Maximum number of hops to trace. |
| `-q count` | Number of queries sent to each hop. The default is 100. |
| `-p ms` | Milliseconds to wait between pings. The default is 250. |
| `-w ms` | Milliseconds to wait for each reply. |
With the defaults, the statistics phase takes about 25 seconds per hop. A 12-hop path therefore takes around five minutes. Lowering -q or -p shortens the run, but gives you less data.
Reading the output
The first part looks like tracert output. After a pause while statistics are computed, you get a table like this:
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 PC [192.168.1.20]
0/ 100 = 0% |
1 2ms 0/ 100 = 0% 0/ 100 = 0% 192.168.1.1
0/ 100 = 0% |
2 14ms 0/ 100 = 0% 0/ 100 = 0% 10.20.0.1
12/ 100 = 12% |
3 18ms 12/ 100 = 12% 0/ 100 = 0% 203.0.113.5
0/ 100 = 0% |
4 21ms 12/ 100 = 12% 0/ 100 = 0% 198.51.100.9There are two sets of columns:
- Source to Here is the loss and round-trip time for packets sent from your machine to that hop. It counts everything on the way.
- This Node/Link separates the hop itself (the row with an address) from the link between it and the previous hop (the row with the
|).
In the example, the link between hops 2 and 3 shows 12% loss. Every later hop also shows 12% in "Source to Here", because packets pass through that link. The loss starts at the link into hop 3, so that is where you look.
Common errors in interpretation
Loss on one hop is not always a real fault. Many routers answer ICMP probes addressed to themselves at low priority, or rate-limit them. That shows up as loss on the hop's own row ("This Node") while later hops show 0%. If traffic is flowing normally to later hops, the loss is only a limit on ICMP replies from that router. It does not drop your real traffic.
Use this rule:
- Loss that appears at one hop and continues at all later hops points to a real problem at or just before that hop.
- Loss at one hop that disappears at later hops is almost always ICMP rate limiting.
- Hops that show 100% loss but are followed by working hops are usually filtering ICMP. A destination that shows 100% loss may still serve web traffic.
Linux and macOS
Windows pathping has no single built-in counterpart. The mtr tool, which is installed separately, provides the same combined view:
mtr -n -c 100 -r example.comHere -c 100 sends 100 probes per hop, -r prints a report and exits, and -n skips name lookups.
Exercise
A pathping run shows 0% loss at hops 1 to 4, then 30% loss at hop 5 and 30% at hops 6 and 7, with the loss first appearing on the link between hops 4 and 5. Where does the problem lie, and how does this differ from a case where only hop 5 shows 30% and hops 6 and 7 show 0%?
Show answer
The loss begins on the link into hop 5, and because hops 6 and 7 also show 30% in the "Source to Here" column, real traffic is being lost there. If only hop 5 shows loss and later hops show 0%, the router at hop 5 is most likely rate-limiting ICMP replies addressed to itself, and no traffic is being dropped.