
The ICMP packet is encapsulated in an IPv4 packet. The packet consists of header and data (payload) sections, the Header is 8 Bytes in length, the fields of the ICMP Header are detailed below: There is no TCP or UDP port number associated with ICMP packets as these numbers are associated with the transport layer above. In many cases, it is necessary to inspect the contents of the ICMP message and deliver the appropriate error message to the application responsible for transmitting the IP packet that prompted the ICMP message to be sent. Although ICMP messages are contained within standard IP packets, ICMP messages are usually processed as a special case, distinguished from normal IP processing. ICMP uses the basic support of IP as if it were a higher-level protocol, however, ICMP is actually an integral part of IP.

The related ping utility is implemented using the ICMP echo request and echo reply messages.
