pathping - Find packet loss along a route
Table of Contents
The pathping command traces the route to a destination like tracert, and then measures how many packets are lost at each hop statistically.
ping tells you whether a destination is reachable, and tracert tells you which routers the traffic passes through. pathping does both, then sends many packets to each hop so you can see which router or link is losing them. It is useful when a connection is unstable.
Basic syntax of the pathping command
pathping [-n] [-h <maximum_hops>] [-p <period>] [-q <num_queries>] [-w <timeout>] [-4] [-6] <host_name_or_IP_address>
Only the main options are listed here. You can see the others with pathping /?.
Find packet loss along a route
Specify the host name or IP address you want to check.
pathping example.com
First, the route is displayed just like tracert. Then a message such as Computing statistics for ... seconds... appears, and after a wait the results are displayed all at once.
The output above is only an example. The number of routers, their addresses, the response times and the loss rates vary with your network and the time you run the command. The language of the messages also depends on the display language of your OS.
It takes a while to finish
After displaying the route, pathping sends 100 packets to each hop to collect statistics. By default it waits 0.25 seconds between packets, so it takes about 25 seconds per hop.
For example, a route with 10 hops can take more than 4 minutes. To stop it midway, press Ctrl + C.
How to read the output
The statistics table has the following columns.
| Column | Description |
|---|---|
Hop | The hop number counted from your PC (0 is your PC itself) |
RTT | The round-trip time to that hop |
Source to Here | Loss between your PC and that hop (lost/sent = percentage) |
This Node/Link | Loss at that hop (node) itself and at the link just before it |
Address | The host name or IP address of that hop |
The | lines between hops represent the links (the paths between hops).
Locating where the loss occurs
Use the This Node/Link column to judge where the loss comes from.
- If a hop’s row (the one with an
Address) shows loss, that router itself is dropping responses. - If a
|row shows loss, packets are being lost on the link between the hops before and after it.
Some routers limit their responses to the ICMP packets that pathping uses, to reduce load. So even if one hop shows loss, real traffic is often unaffected as long as the later hops show no loss. Focus on whether the loss carries through to the destination (Source to Here stays high until the last hop).
Shorten the run time
Because the defaults take a long time, adjust them with options as needed.
Reduce the number of packets (-q)
The -q option sets the number of packets sent to each hop. The default is 100.
pathping -q 10 example.com
Fewer packets finish faster, but the loss percentage becomes less accurate.
Shorten the interval (-p)
The -p option sets the time to wait between packets, in milliseconds. The default is 250.
pathping -q 50 -p 100 example.com
This takes about 5 seconds per hop (50 packets × 100 ms).
Skip name resolution (-n)
With the -n option, pathping does not look up host names from router IP addresses and displays only IP addresses.
pathping -n example.com
Limit the maximum number of hops (-h)
The -h option sets the maximum number of hops to trace. The default is 30.
pathping -h 15 example.com
Main options
| Option | Description |
|---|---|
-n | Do not resolve addresses to host names |
-h <maximum_hops> | Set the maximum number of hops to trace (default: 30) |
-p <period> | Set the wait between packets in milliseconds (default: 250) |
-q <num_queries> | Set the number of packets sent to each hop (default: 100) |
-w <timeout> | Set the time to wait for each reply in milliseconds (default: 3000) |
-4 | Use IPv4 |
-6 | Use IPv6 |
Using it in a batch file
If you want to keep a record of when the connection becomes unstable, save the result to a file.
@echo off
pathping -n -q 50 -p 100 example.com > "%~dp0pathping-result.txt"
echo Result saved.
> (redirection) writes the output to a file. %~dp0 is the folder where the batch file itself is located.
First check reachability with ping. If the destination is unreachable or slow, trace the route with tracert. When the connection drops intermittently or you want to know where packets are lost, use pathping.