ping

term

networking

The tool that sends ICMP Echo Requests and times the Echo Replies: the first test of whether a host is reachable.

Every IP host must answer an Echo Request, which makes ping the universal first check. A reply proves that both directions work and that the responder is alive; silence proves much less, because a filter, a rate limit and a host told to ignore echoes all look the same.

ping sends ICMP type 8 and waits for type 0; ICMPv6 uses 128 and 129. The identifier and sequence number come back unchanged so each reply can be matched to its request, and the data is returned in full: Linux ping puts a timestamp at its start to compute the round trip. The default 56 data bytes, plus the 8-byte ICMP header and a 20-byte IP header, are the 56(84) on its first line.

Each reply line shows icmp_seq, the TTL of the reply and the time; the summary gives minimum, average, maximum and mdev, a population standard deviation. The TTL hints at the distance only if you know the value the responder started from: 64 is the recommended initial value, and 128 and 255 are common. ping exits with 1 when no reply arrives at all, which scripts use as a liveness test.

Silence has many causes. Routers may be configured to ignore echo requests, Linux has icmp_echo_ignore_all, firewalls drop echoes, and Linux ignores echoes sent to broadcast addresses by default, part of the defence against the smurf amplification RFC 2644 describes. ping -t 1 makes it a one-hop probe: the first router answers with Time Exceeded.

Also known as: icmp echo, echo request, echo reply, ping6, icmp ping

← All glossary entries