Internet Control Message Protocol, ICMP, How ICMP Work, ICMP Header, ICMP Message Header

When you send data from one device to another remote device, the IPv4 Datagram often travels through one or more routers. There can be errors at routers while they try to forward the IPv4 Datagram to its final destination. The Internet Control Message Protocol (ICMP) protocol is used to report problems with delivery of IPv4 Datagrams within an IPv4 network. ICMP is also used for other diagnosis and troubleshooting functions.

An Internet Control Message Protocol (ICMP) packet header is 8 Bytes long. The first four bytes always have the same meaning, and the contents of the remaining four depend on the ICMP packet type. An ICMP header follows the IP header in an IP datagram packet and Internet Control Message Protocol (ICMP) is considered to be an integral part of IPv4.

The most common ICMP messages

Echo Request and Echo Reply: Internet Control Message Protocol (ICMP) is often used during test the connectivity between devices. We can use the ping (Packet InterNet Grouper, a command-line utility used to check the connectivity between two devices) command to check connectivity from one device with another device and the ping command is using Internet Control Message Protocol (ICMP). Ping command sends an IP datagram packet to the IPv4 address of the device we are trying to check the connectivity and requests the destination device to return the data sent in a response datagram. Ping command uses Internet Control Message Protocol (ICMP) Echo Request and Echo Reply.

Source Quench: If a device is sending large amounts of data to another remote device, the volume can flood the router with data. The router can use Internet Control Message Protocol (ICMP) to send a Source Quench message to the source IPv4 address to ask it to slow down the rate at which it is sending data.

Destination Unreachable: If a router receives a datagram that cannot be delivered, Internet Control Message Protocol (ICMP) returns a Destination Unreachable message to the source IPv4 address.

Time Exceeded: Internet Control Message Protocol (ICMP) sends this message to the source IP if a datagram is discarded because Time-to-Live (TTL) value reaches zero. One reason is the destination device is too many router hops away to reach with the current Time-to-Live (TTL) value or a routing loop (An undesirable condition when the IP Datagrams loop infinitely between the routers, without reaching the destination).

Internet Control Message Protocol (ICMP) Message Header

Internet Control Message Protocol ICMP header

Internet Control Message Protocol (ICMP) Header

Type and Code: The following table shows the values which are possible for the Type and Code fields in the Internet Control Message Protocol (ICMP) header.


Type Code Description
0 0 Echo reply (used to ping)
1 and 2


3 0 Destination network unreachable
1 Destination host unreachable
2 Destination protocol unreachable
3 Destination port unreachable
4 Fragmentation required, and DF set
5 Source route failed
6 Destination network unknown
7 Destination host unknown
8 Source host isolated
9 Network administratively prohibited
10 Host administratively prohibited
11 Network unreachable for Type Of Service
12 Host unreachable for Type of Service
13 Administratively prohibited
4 0 Traffic Congestion Control
5 0 Redirect Datagram for the Network
1 Redirect Datagram for the Host
2 Redirect Datagram for the Type of Service & network
3 Redirect Datagram for the Type of Service & host


Alternate Host Address


8 0 Echo request
9 0 Router Advertisement
10 0 Router discovery/selection/solicitation
11 0 TTL expired
1 Fragment reassembly time exceeded
12 0 Pointer indicates the error
1 Missing a required option
2 Bad length
13 0 Timestamp
14 0 Timestamp reply
15 0 Information Request
16 0 Information Reply
17 0 Address Mask Request
18 0 Address Mask Reply


Reserved for security
20 through 29


Reserved for robustness experiment
30 0 Information Request


Datagram Conversion Error


Mobile Host Redirect






Mobile Registration Request


Mobile Registration Reply


Domain Name Request


Domain Name Reply


SKIP Algorithm Discovery Protocol


Photuris, Security failures


ICMP for experimental mobility protocols such as Seamoby
42 through 255



Checksum: The checksum field in the Internet Control Message Protocol (ICMP) message contains error checking data calculated from the Internet Control Message Protocol (ICMP) header+data, with value 0 for this field.

ID: The ID field in the Internet Control Message Protocol (ICMP) message contains an ID value, should be returned in case of ECHO REPLY.

Sequence number: The sequence number field in the Internet Control Message Protocol (ICMP) message is the sequence number for each host, generally this starts at 1 and is incremented by 1 for each packet.

You have learned Internet Control Message Protocol (ICMP), use of Internet Control Message Protocol (ICMP), Internet Control Message Protocol (ICMP) message header and the fields in Internet Control Message Protocol (ICMP) message. Click "Next" to continue.

Related Tutorials
• TCP/IP Internet Layer
• IP Addresses
• Address Resolution Protocol (ARP)