Guide to Internet Control Message Protocol (ICMP)

ICMP data


Internet Control Message Protocol (ICMP) is a network protocol for Internet Protocol (IP) networking. ICMP transfers control information for the status of the network itself rather than application data. An IP network requires ICMP in order to function properly.

ICMP messages are a specific kind of IP message distinct from TCP and UDP.

The best-known example of ICMP messaging in practice is the ping utility, which uses ICMP to probe remote hosts for responsiveness and measure overall round-trip time of the probe messages.

ICMP also supports other utilities like traceroute that identify intermediate routing devices ("hops") on the path between a given source and destination.

ICMP Versus ICMPv6

The original definition of ICMP supported Internet Protocol version 4 (IPv4) networks. IPv6 incorporates a revised form of the protocol conventionally called ICMPv6 to distinguish it from the original ICMP (occasionally called ICMPv4).

ICMP Message Types and Message Formats

ICMP messages carry data essential to the operation and administration of a computer network. The protocol reports on conditions such as unresponsive devices, transmission errors, and network congestion issues.

Like other protocols in the IP family, ICMP defines a message header. The header contains four fields in the following sequence:

  • Type (8 bits)
  • Code (8 bits)
  • Checksum (16 bits)
  • ICMP Data (32 bits)

ICMP defines a list of specific message types and assigns a unique number to each.

 As shown in the table below, ICMPv4 and ICMPv6 provide some common message types (but often with different numbers) and also some messages unique to each. (The common message types may also vary slightly in their behavior between IP versions).

Common ICMP Message Types
v4 #v6 #TypeDescription
0129Echo ReplyMessage sent in response to an Echo Request (see below)
31Destination UnreachableSent in response to an IP message being undeliverable for any of various reasons.
4-Source QuenchA device can send this message back to a sender who is generating incoming traffic at a faster rate than it can be processed. (Superseded by other methods.)
5137Redirect MessageRouting devices can generate this method if they detect a change in requested route for an IP message should be changed.
8128Echo RequestMessage sent by ping utilities to check the responsiveness of a target device
113Time ExceededRouters generated this message when the incoming data has reached its "hop" count limit. Used by traceroute.
12-Parameter ProblemGenerated when a device detects corrupted or missing data in an incoming IP message. 
13, 14-Timestamp (Request, Reply)Designed to synchronize time clocks between two devices via IPv4, (Superseded by other more reliable methods.)
-2Packet Too BigRouters generate this message when receiving a message that cannot be forwarded to its destination due to exceeding a length limit.

The protocol fills the Code and ICMP data fields depending on the message Type chosen to share additional information. For example, a Destination Unreachable message can have many different Code values depending on the nature of the failure.