Sub topic 13
pathping: per-hop loss statistics on Windows
This chapter assumes you can read tracert output, know that ping reports round-trip time (RTT) and loss, and understand that TTL limits how many routers a packet can cross. If any of that is unfamiliar, review the chapters on ping and traceroute first.
Why pathping exists
tracert sends only three probes per hop. ping tests only the final destination. Neither answers a common question: "Packets are being lost somewhere on the way to the server. Which router is losing them?"
Three probes cannot show a loss rate of 2% or 5%. You need dozens or hundreds of samples per hop. pathping is a built-in Windows tool that combines the two methods:
- It first runs a trace of the route, like
tracert. - It then sends many echo requests to every hop on that route for a fixed period and computes loss and RTT statistics for each one.
The cost is time. With default settings, the statistics phase takes about 25 seconds per hop. A 12-hop path therefore takes around five minutes.
Running pathping
The simplest form takes a destination name or address:
pathping example.comUseful options change how long the test runs and how much name lookup it does:
pathping -n -q 50 -p 200 -h 20 example.com| Option | Meaning | Default |
|---|---|---|
| `-n` | Do not resolve addresses to host names. Faster and easier to read. | Names are resolved |
| `-q num_queries` | Number of echo requests sent to each hop during the statistics phase. | 100 |
| `-p period` | Milliseconds to wait between pings. | 250 |
| `-h maximum_hops` | Maximum number of hops to search for the target. | 30 |
| `-w timeout` | Milliseconds to wait for each reply. | 3000 |
| `-4` / `-6` | Force IPv4 or IPv6. | Chosen from the destination |
The time spent on each hop is roughly queries × period. The defaults give 100 × 250 ms = 25 seconds per hop. For a quicker but rougher result, lower the query count, for example -q 20. For a more precise loss figure on a suspect path, raise it.
The two phases of output
pathping prints in two stages. The first is a normal route trace:
Tracing route to example.com [93.184.216.34]
over a maximum of 30 hops:
0 DESKTOP-01 [192.168.1.20]
1 192.168.1.1
2 10.20.0.1
3 203.0.113.9
4 198.51.100.4
5 93.184.216.34
Computing statistics for 125 seconds...The message "Computing statistics for 125 seconds..." tells you how long the second phase will run. It is a good moment to decide whether to wait or cancel with Ctrl+C.
The second phase then prints a table:
Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 DESKTOP-01 [192.168.1.20]
0/ 100 = 0% |
1 1ms 0/ 100 = 0% 0/ 100 = 0% 192.168.1.1
0/ 100 = 0% |
2 12ms 0/ 100 = 0% 0/ 100 = 0% 10.20.0.1
8/ 100 = 8% |
3 14ms 8/ 100 = 8% 0/ 100 = 0% 203.0.113.9
0/ 100 = 0% |
4 18ms 8/ 100 = 8% 0/ 100 = 0% 198.51.100.4
0/ 100 = 0% |
5 21ms 8/ 100 = 8% 0/ 100 = 0% 93.184.216.34
Trace complete.Reading the table
The table has two groups of columns, and the difference between them matters.
- Source to Here reports loss and RTT measured from your computer to that hop. It includes everything that happened on the way.
- This Node/Link separates the hop itself from the link before it. The rows with a
|character describe the link between two routers. The rows with an address describe the node, meaning the router's own handling of the probe.
In the example above, the 8/ 100 = 8% appears on the link row between hop 2 and hop 3. Every later hop shows 8% in the "Source to Here" column. That pattern means loss starts on the link between 10.20.0.1 and 203.0.113.9 and persists to the destination. The node rows show 0%, so the routers themselves answered every probe they received.
The Lost/Sent values are counts. A figure such as 8/ 100 means 8 of 100 probes got no reply.
Link loss versus node loss
Loss shown on a node row (the row with an address) usually means the router did not answer all of the probes sent to it. This can come from two different causes:
- The router is genuinely dropping traffic, for example because it is overloaded.
- The router deliberately gives low priority to ICMP replies addressed to itself, so it answers only some of them. Its forwarding of other traffic is unaffected.
Loss shown on a link row (the | row) is attributed to packets that were lost between two routers.
The key rule: loss must continue to the end
The most common mistake with pathping, mtr, and traceroute is blaming the first hop that shows loss. Use this rule instead:
- If a hop shows loss but later hops show 0%, the loss is almost always ICMP rate limiting on that router. Traffic that passes through it is not being dropped, or the later hops would show loss as well.
- If loss appears at a hop and stays at roughly the same level through the final hop, packets really are being lost at or just before that point.
- Loss only at the final hop, with clean hops before it, points to the destination host or its firewall, which may be limiting or blocking ICMP.
This is the same principle covered in the chapter on ICMP filtering. The end-to-end result is the one that reflects what applications experience.
Reading RTT in the statistics
The RTT column in "Source to Here" is the average round-trip time to that hop over all the probes. Two things to watch:
- RTT should generally rise as hops get farther away. A large jump between two consecutive hops points to a slow link, such as a long-distance or congested one.
- A single hop with high RTT, followed by lower RTT at later hops, is again usually a slow ICMP response from that router and not a real delay. The later hops pass through that router too, so they could not be faster if the router were truly slow.
Common problems and fixes
- Rows of
*or "Request timed out" in the first phase. The router does not send Time Exceeded messages, or a firewall blocks them.pathpingcannot measure that hop, but it may still measure the later ones. - 100% loss for the whole second phase. The destination or an earlier router is blocking ICMP. Try another destination, or compare with a TCP-based test from the application itself.
- The test takes too long. Reduce
-q, increase-ponly if you need to avoid rate limiting, and use-nto skip name lookups. Cancel with Ctrl+C if needed. - Results change between runs. Loss on the internet can be bursty. Run the test two or three times, and at different times of day, before concluding anything.
An mtr equivalent on Linux and macOS
mtr combines traceroute and ping in a live display and is the usual substitute. A report mode produces output similar to pathping:
mtr -n -r -c 100 example.comHere -n skips name resolution, -r prints a report and exits, and -c 100 sends 100 probes per hop. The Loss% column plays the same role as the "Source to Here" loss column in pathping, and the same rule applies: loss that does not continue to later hops is usually ICMP rate limiting.
Summary of when to use it
- Use
pingto see whether the destination responds and to measure basic loss and latency. - Use
tracertfor a fast look at the route and to see where replies stop. - Use
pathpingwhen a connection is intermittent or slow and you want to know which part of the path loses packets, and you can wait several minutes.
Exercise
A pathping run to a server shows 0% loss at hops 1 and 2, 40% loss at hop 3 in both the "Source to Here" column and the node row, and 0% loss at hops 4, 5, and 6 (the destination). What does this most likely mean, and what should you conclude about the connection?
Show answer
Hop 3 is probably rate limiting or deprioritizing ICMP replies addressed to itself. Because hops 4, 5, and 6 all show 0% loss, traffic is passing through hop 3 without being dropped. If hop 3 were really dropping forwarded packets, the later hops would show loss too. The connection is healthy, and hop 3 is not the cause of any problem.
Exercise
You run pathping with the options -q 40 -p 500 on a path with 10 hops. About how long will the statistics phase take?
Show answer
The time per hop is queries times period, so 40 × 500 ms = 20 seconds. For 10 hops, the statistics phase takes about 200 seconds, or roughly 3 minutes and 20 seconds, in addition to the initial route trace.
Exercise
In pathping output, the "Source to Here" loss is 0% at hop 4 and 12% at hop 5, and every hop after hop 5 also shows about 12%. Where does the problem most likely start, and which row type would confirm whether it is the link or the router?
Show answer
Real loss starts at or just before hop 5, because it continues to every later hop. If the 12% appears on the link row (the | row) between hops 4 and 5, the link is the suspect. If it appears on the node row for hop 5, the router itself is the suspect.