The Internet Control Message Protocol (ICMP) is a communications protocol that is a part of the Internet protocol suite. ICMP is a part of the Internet layer (there are four layers in the Internet protocol suite) of the Internet protocol suite, and is viewed as an extension of the Internet Protocol (IP). Therefore, there are two versions of ICMP, which work in conjunction with the two versions of the Internet Protocol (IP).
The Internet Protocol (IP) is the most important protocol of the Internet: it provides a numbering system (IP address) that identifies devices that connect to the Internet, and a datagram format for the data that is sent across networks (host to host). The purpose of the Internet Control Message Protocol (ICMP) is to report errors that occur when Internet Protocol (IP) datagrams are routed across the Internet (interconnected networks that use TCP/IP). Datagrams are data segment that are sent using a unreliable method - which IP is - and while similar to a data packet the difference is a datagram is unreliable. During a datagram transmission errors can occur and it is for this situation that ICMP was created. ICMP highlights datagram processing errors, alongside control and diagnostic messages, which are sent by gateway or destination hosts to the source host. ICMP does not make IP reliable, it simple provides feedback about networking issues, and some of the most common uses of ICMP is when a datagram cannot reach its destination and buffering capacity problems. RFC 792 states that no ICMP messages are sent about ICMP messages. In ICMPv6, ICMP messages are classified as either error messages or information messages.
So, how are ICMP messages sent? by being encapsulated in a IP datagram /
packet header (stated in RFC 792). IPv4 and IPv6 headers include a variety
of fields, and one of these fields is the protocol field: the protocol field
has numbers (defined by IANA) and ICMP is protocol number 1. The ICMP message
format includes a 8 byte header with the following fields: type, code, checksum
and rest of header. The type and code fields define the control messages created
by ICMP. The following control messages (in no particular order) can be produced
RFC 792 defines ICMP as an integral part of IP, but ICMP messages are differentiated from normal IP processes. While ICMP is designed to provide feedback about IP datagrams, it is, like the Internet Protocol (IP), not absolutely reliable and therefore there is no guarantee that a ICMP message will be returned.