I basically know the difference in my head but I'm having trouble formulating it on paper. If someone could tell me a little more detailed explanation about the two I'd really appreciate it.

So basically my question is can someone give me a more detailed explanation about the differences between the ping and tracert functions in cmd?


Sounds like you're talking about Windows, eh?

PING sends ICMP echo request datagrams to the destination host specified. The destination host will send back ICMP echo reply datagrams, if it is so configured. People typically think of using PING to judge the "reachability" of a host. You can vary the size of PING packets and watch the round-trip time to learn a little about the network bandwidth conditions (as well as, obviously, measuring latency) between the source and destination hosts.

A rookie mistake, BTW, is thinking that because you never receive a reply your echo request datagram isn't getting to the remote host. The absense of replies tells you that your echo request didn't reach the destination host OR the reply from the destination host didn't make it back to you. The absense of PING replies doesn't tell you anything conclusive.

The Microsoft TRACERT utility seeks to provide similiar functionality to the Unix "traceroute" utility. Microsoft's TRACERT sends out ICMP echo request datagrams with increasing "time to live" (TTL) values. The TTL determines how many hosts an IP datagram can be forwarded through. Each host that forwards the datagram decrements the TTL until it reaches zero, at which point the host that decremended the count to zero sends an ICMP time to live exceeded datagram to the host that sourced the datagram that has ceased to "live". By sending out datagrams with increasing TTL values and watching where the time to live exceeded datagrams come from one can produce a "map" of the "hops" that the outbound datagram moved through, along information about how long it took for the datagram to round-trip.

Incidently, the Unix "traceroute" uses UDP datagrams rather than ICMP to perform a similar function.

  • +1 didn't know that was how it worked. – sybreon Sep 24 '09 at 8:52
  • thanks alot it was really helpful. i think i get a bit more of the bigger picture now to. – Anonymous Sep 24 '09 at 13:04
  • Most Unix/Linux traceroute implementations support ICMP using the "-I" flag. Modern versions also support TCP, e.g. on Linux "traceroute -n -T www.example.com" can be used to bypass example.com's firewall. – Gerald Combs Sep 24 '09 at 15:36
  • The absence of replies could also be because the host might not support ICMP – Kent Pawar May 1 '13 at 15:44

Think of ping like sonar pings on a submarine. You send packets to a particular host, and receive packets back. It's letting you know that host is running and responding to ICMP ping traffic. If it doesn't respond, it's either down or configured not to respond to pings, or there are other connection issues between you and the host (either outgoing or incoming).

Tracert shows you the path that packets take from your local system to a remote host. You see the response time to each step along the way, because each datagram has a TTL (time-to-live) that's one hop longer than the previous one. This can be used to troubleshoot connection problems, as you can localize the source of your issues.

On Windows, both of these tool use ICMP to accomplish their tasks.

  • thanks alot i just started my first year in university studying network administration so feel quite like the rookie for the time being – Anonymous Sep 24 '09 at 13:04

ping is essentially a point to point traffic tcp traffic time. tracert is the time taken for a packet to get to each point in its route from point to point.

  • Hay... why -1? I know its short, but its what it is... – Peter Nunn Sep 24 '09 at 9:32
  • thanks man im still in the start of all this networking stuff so all help is welcome :) – Anonymous Sep 24 '09 at 13:06

Tracert lists the places that a message passes from source to destination. Ping only says the computer destination is answering "yes, I'm here." Traceroute is like when you are making directions for friends to come to your house as you ride the route - "Turn right on 5th, left on 10th, 640 north, left on highway 251" Ping is a phone call where the other person picks up and says "I'm home" then hangs up. ---- Naga Royal

  • ping is processed in the data plane and shows latency
  • tracert is processed in the control plane and shows path selection

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy