EMZETT.
Login

Ping

In short: A command-line tool that uses an ICMP echo request to check whether a target device on the network is reachable and measures the latency this takes.

In more detail: The name comes from the sonar echo-sounding principle: a signal is sent out (“echo request”), the target device answers (“echo reply”), and the time in between is the round-trip time. The classic first tool in troubleshooting for distinguishing basic reachability from deeper problems.

In Depth

A typical ping call and its output:

$ ping emzett-digital.com
PING emzett-digital.com (76.76.21.21): 56 data bytes
64 bytes from 76.76.21.21: icmp_seq=0 ttl=58 time=12.4 ms
64 bytes from 76.76.21.21: icmp_seq=1 ttl=58 time=11.9 ms
64 bytes from 76.76.21.21: icmp_seq=2 ttl=58 time=13.1 ms

--- emzett-digital.com ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max = 11.9/12.5/13.1 ms

The time value per line is the round-trip time (RTT) — how long the ICMP echo request packet took to reach the target AND the echo reply to come back, combined. Packet loss (anything other than 0.0%) points to an unstable connection; strongly fluctuating times point to network congestion or routing problems.

What the TTL in the ping reveals

The ttl value in the output is a useful by-product: every operating system starts with a characteristic TTL initial value (Linux typically 64, Windows 128, some routers/network devices 255), which drops by 1 at every router hop passed. A reported TTL value of 58 with a Linux-typical start of 64 therefore reveals that the packet passed about 6 routers on the way — useful for roughly estimating how “far away” a destination is without resorting to traceroute.

Why ping is sometimes misleading

Some servers/firewalls deliberately block ICMP for security reasons (e.g. to protect themselves against certain network scanning techniques that use ICMP to find reachable devices) — a failed ping then doesn’t necessarily mean that the server is offline, only that it doesn’t answer ICMP. Conversely, a successful ping only says that layer 3 (network) works — a web server can still be unreachable if, for example, the actual web server process has crashed or a firewall specifically blocks only the HTTP port but lets ICMP through. Ping is therefore only the first step of systematic troubleshooting, not the only one.

See also: Echo Request, Echo Reply, ICMP