← Lessons

quiz vs the machine

Silver1040

Networking

The ICMP Protocol and Ping

The control messaging layer that reports errors and powers ping.

3 min read · intro · beat Silver to climb

What ICMP is for

The Internet Control Message Protocol carries diagnostic and error messages for IP. It is not used to move application data. Instead, routers and hosts use it to report problems and answer reachability checks.

Common message types

  • Echo request and echo reply implement ping, testing whether a host is reachable.
  • Destination unreachable tells a sender that a network, host, or port could not be reached.
  • Time exceeded is sent when a packet time to live drops to zero, which traceroute relies on.
  • Fragmentation needed supports path MTU discovery.

Ping sends echo requests and measures the round trip time of the replies, also reporting packet loss when replies never arrive. Because ICMP runs directly over IP without ports, firewalls often rate limit or block it, which is why a host that ignores ping may still be perfectly reachable over TCP.

Key idea

ICMP is the control channel of IP, and ping uses its echo messages to measure reachability and round trip time.

Check yourself

Answer to earn rating on the learn ladder.

1. What does ping use to test reachability?

2. Why might a host that ignores ping still be reachable?