Skip to main content
Network Security & Firewall CLI

pathping Command Reference: Troubleshoot Latency & Packet Loss

pathping is a Windows command-line utility that combines traceroute and ping to measure network latency and packet loss hop-by-hop, sending 100 queries per hop over ~25 seconds.

pathping [-n] [-h <maximum_hops>] [-g <hostlist>] [-p <period>] [-q <num_queries>] [-w <timeout>] [-i <IPaddress>] [-4] [-6] [-P] [-R] [-T] <targetname>

Options and Flags

Flag Type Default Description
-n Switch Disabled Do not resolve hostnames to IP addresses; show only IP addresses.
-h <hops> Integer 30 Maximum number of hops to search for target.
-g <hostlist> String None Loose source route along host list (IPv4 only).
-p <period> Integer (ms) 250 Wait period between pings to each intermediate hop.
-q <queries> Integer 100 Number of queries per hop.
-w <timeout> Integer (ms) 3000 Wait timeout for each reply.
-i <address> IP address Default interface Source IP address to use.
-4 Switch Auto Force using IPv4.
-6 Switch Auto Force using IPv6.
-P Switch Disabled Test RSVP PATH Hello messages (IPv4 only).
-R Switch Disabled Test RSVP RESV Hello messages (IPv4 only).
-T Switch Disabled Test Layer 2 priority tags (IPv4 only).

Usage Examples

1. Basic network diagnostic to an external server

pathping 8.8.8.8

Executes pathping to Google’s DNS. First phase traces the route (like tracert), then for each hop sends 100 ICMP queries (default). Total run time: ~25 seconds per hop (typically 10-20 hops → 4-8 minutes). Output shows per-hop packet loss and latency statistics.

See also  BPDU Guard (bpduguard) CLI Configuration and Troubleshooting

2. Rapid diagnostic with reduced query count and no DNS

pathping -n -q 10 -w 500 192.168.1.1

Speeds up the test by using only 10 queries per hop and a 500ms timeout. The -n flag avoids DNS lookups, reducing noise. Useful for quick internal gateway checks. Output still shows IP addresses and loss percentages, but with lower statistical confidence.

3. Force IPv6 and limit hops

pathping -6 -h 15 google.com

Forces pathping to use IPv6 and limits the search to 15 hops. If the target has an IPv6 address, the trace will follow the IPv6 path. The hop limit helps cut off non-responsive routers beyond the expected path.

Troubleshooting & Common Errors

Error Message / Symptom Root Cause Resolution Command
“Destination host unreachable” for all hops Firewall or ACL blocking ICMP (Type 8 or Type 30) Check inbound/outbound rules on firewalls; try ping first; use telnet or Test-NetConnection (PowerShell) to confirm.
Pathping hangs at “Computing statistics for 30 seconds…” Intermediate router not responding to ICMP; or high latency beyond read timeout Increase -w timeout: pathping -w 10000 target
“Unable to resolve target system name” DNS resolution failure Use full IP: pathping -n 8.8.8.8 or fix DNS settings.
“Timeouts displayed as * (asterisks)” Router configured to not respond to ICMP (common on cloud edge routers) Normal; indicates loss at that hop. Use -n to speed up; evaluate loss on adjacent hops to infer link health.
Pathping runs too slowly (minutes) Default 100 queries per hop × 25s/hop Reduce query count: pathping -q 10 target. Combine with -n to skip DNS.
See also  hdlc CLI Reference: WAN Encapsulation & Troubleshooting

Performance Considerations and Tuning

PathPing combines the functionality of ping and traceroute, but its performance can be tuned via several flags that control timing, parallelism, and resolution overhead. The default behavior sends 100 queries per hop with a 3-second timeout and a 250 ms pause between probes. On networks with high latency or packet loss, these defaults may need adjustment to avoid false negatives or excessive runtime.

  • Number of queries per hop (-q): Increase to improve statistical reliability; decrease to shorten test duration. The default is 100. Example: -q 200 for more accuracy.
  • Timeout per probe (-w): Sets the wait time for each reply, in milliseconds. Default 3000 ms. For high-latency links, raise to 5000 or more.
  • Pause between probes (-p): Interval in milliseconds between consecutive pings to the same hop. Default 250 ms. Lower values increase probe rate but may cause congestion.
  • Maximum hops (-h): Limits the number of hops probed, reducing total runtime. Default is 30.
  • No DNS resolution (-n): Skips reverse DNS lookups, speeding up the test significantly — especially when many hops are present.
# Tune for a high-latency path: increase queries, timeout, and pause
pathping -q 150 -w 5000 -p 500 -n 8.8.8.8

These flags are documented in the official Windows PathPing help (pathping /?) and in Microsoft’s networking troubleshooting articles. Note that PathPing does not expose a direct MTU or buffer-size knob; for MTU tuning, use ping -f -l separately before running PathPing.

Multi-Cloud Comparison

Tested on Windows 10 Pro 22H2 with default pathping utility.

Feature pathping (Windows) Linux Equivalent Cloud Environment Note
Hop-by-hop latency + loss Built-in, 25s/hop mtr (continuous), tracepath (quick) Available on EC2/VM via RDP or PowerShell remoting; no native cloud CLI.
Route discovery ICMP-based ICMP or UDP (traceroute) Internal cloud routing obscured; pathping shows only public hop IPs.
Continuous monitoring Single pass only mtr --report or mtr --report-cycles For continuous monitoring on cloud VMs, use mtr or third-party tools.
No DNS resolution -n flag -n in mtr Same across platforms.
Source IP binding -i flag -i in mtr Useful on multi-homed cloud instances.
See also  Linux ncat Command Reference: Syntax, Flags, and Examples

Frequently Asked Questions

What do the asterisks (*) mean in pathping output?

Answer: Asterisks indicate that the intermediate router did not respond to ICMP probes. This is common on cloud edge routers and firewalls configured to drop ICMP. Loss is inferred from adjacent hops; evaluate link health by comparing loss on previous and next hops.

Use -n to skip DNS and -w to increase timeout if responses are delayed.

How can I speed up pathping for quick checks?

Answer: Reduce queries per hop, skip DNS, decrease timeout, and limit maximum hops.

Example: pathping -n -q 10 -w 500 -h 15 8.8.8.8 completes in about 15 seconds instead of several minutes. The -p flag can further adjust probe interval (default 250 ms).

Does pathping work on macOS or Linux?

Answer: No. Pathping is a Windows-only utility. On macOS and Linux, use mtr for similar hop-by-hop latency and loss analysis.

Install mtr via Homebrew on macOS: brew install mtr && sudo mtr -r -c 10 1.1.1.1. On Linux, use your package manager (e.g., sudo apt install mtr).