← Lessons

quiz vs the machine

Silver1050

Networking

The Ping and ICMP

Checking if a host is alive with echo requests.

4 min read · intro · beat Silver to climb

The First Question

When something is unreachable, the first thing to ask is whether the host is even there. The ping tool answers this by sending a small probe and waiting for a reply.

How It Works

Ping rides on a helper protocol rather than on a normal connection.

  • It sends an ICMP echo request to the target address.
  • A reachable host replies with an ICMP echo reply.
  • Ping reports the round trip time and whether any replies were lost.

The Internet Control Message Protocol carries these control and error messages, separate from your TCP or UDP data.

Reading The Output

Each line shows a sequence number and a time in milliseconds. Steady low times mean a healthy path, while missing sequence numbers signal loss. A reply does not prove an application works, only that the host and the network path to it are up.

Note that some hosts and firewalls drop ICMP on purpose, so a silent target is not always down.

Key idea

Ping uses ICMP echo requests and replies to confirm that a host is reachable and to measure round trip time, but a silent host may simply be dropping ICMP rather than being down.

Check yourself

Answer to earn rating on the learn ladder.

1. What does ping send to test reachability?

2. Why might a working host fail to answer ping?