Pathping is another great command tool available in Windows Operating Systems for network path tracing and troubleshooting. Pathping that works similar to ping and traceroute/tracert, but provides advanced result output. Please note that pathping command tool is only available on Windows. Similar tool in Linux is mtr.
I strongly recommend you to visit following lessons before reading further.
- Network Layer (Layer 3)
- TTL (Time-to-Live) value in IPv4 header
- IPv4 addresses, IPv4 Address Classes, IPv4 Address Classifications
- Internet Control Message Protocol, ICMP, How ICMP Work, ICMP Header, ICMP Message Header
- ICMP message types
- ICMP Echo Request and Echo Reply messages
- ICMP Time Exceeded messages
- What is hop count in routing
- What is routing loop and how TTL (Time-to-Live) value can prevent routing loop
- Traceroute/tracert command tool
- Pathping command tool
Ping command can test the network connectivity between source and destination. Traceroute/tracert command can trace the path an IPv4 datagram travels from source and destination. But pathping command can do the both, can test network latency and also packet loss between hops from source and destination.
Pathping provides information related with network latency between hops while an IPv4 datagram travel between source and a destination. Network latency is a measure of how much time it takes for an IPv4 datagram to travel from between source to destination. Lowest latency close to zero is preferred. Network latency is measured by RTT (Round-trip Time), that is by measuring the time taken by an IPv4 datagram to reach to a destination and back to source.
Pathping does its work initially similar to traceroute/tracert in tracing the path between source and destination. When you run pathping command tool, first pathping will first path tracing results similar to traceroute/tracert. Then pathping command tool will start calculating network latency related calculations. Pathping calculates network latency by sending and receiving ICMP Echo Request and Echo Reply messages between each hop along the route from source to the destination.
One drawback about pathping is about the time it takes to perform the calculation. Depending on the number of hops between the source and the destination it may take minutes to display the command output.
How pathping works
As explained above, initially pathping does a path tracing similar to traceroute/tracert command. Please visit Traceroute/tracert command tool lesson to learn how traceroute/tracert works. Here we are going to use the same topology used in Traceroute/tracert command tool lesson to learn pathping command tool. Please refer below image.
Open command prompt by typing cmd in Windows search box and then clicking the result. To run pathping command in Windows Operating Systems, type pathping in command prompt with destination IPv4 address as shown below.
Pathping tool will now perform a path tracing using TTL (Time-to-Live) value in IPv4 header, ICMP Echo Request and Echo Reply messages and ICMP Time Exceeded messages as explained in Traceroute/tracert command tool lesson. Following are the path tracing ICMP Echo Request and Echo Reply and ICMP Time Exceeded messages sent and received by pathping command.
The pathping command will display result of path tracing as shown in below image.
Now the pathping tool running at the source computer has got all the IPv4 addresses of the interfaces of routers facing the source computer up to the destination computer. Pathping tool can start computing the network latency using ICMP Echo Request and Echo Reply messages. Pathping command will be busy for some time generating, sending, receiving and then analysing the statistics of the ICMP packets. The wait time depends on number of hops between source and destination and latency.
As you can from above Wireshark screenshot, pathping start sending ICMP Echo Request and Echo Reply messages to all the IPv4 addresses it got from path tracing up to the destination computer. Again and again, it will be repeated for 100 times, by default, for computing packet lost and network latency computation. Please refer source and destination IPv4 addresses in above Wireshark capture image and then cross check with the topology diagram to get a clear picture. Pathping then will display the final result, after the computation as shown below.
You can see the Hop column showing the hop number, RTT column showing the round-trip time, Source to Here Lost/Sent = Pct showing packet lost up to that hop, This Node/Link, Lost/Sent = Pct showing the packet lost per links and finally Address column showing the links.
Packet losses at any link may indicate an issue in the network at the corresponding link.