The ICMP represents Internet Control Message Protocol. It is a network layer protocol. It can be used for error handling in the network layer, and it is generally used on network devices, including routers. IP Protocol is a best-effect delivery service that delivers a datagram from its original source to its final destination. It has two deficiencies−
IP protocol also lacks a structure for host and management queries. A host needs to resolve if a router or another host is alive, and sometimes a network manager needs information from another host or router.
ICMP has been created to compensate for these deficiencies. It is a partner to the IP protocol.
ICMP is a network layer protocol. But, its messages are not passed directly to the data link layer. Instead, the messages are first encapsulated inside the IP datagrams before going to the lower layer.
The cost of the protocol field in the IP datagram is I, to indicate that IP data is an ICMP message.
The error reporting messages report issues that a router or a host (destination) may encounter when it phases an IP packet.
The query messages, which appear in pairs, help a host or a network manager to get specific data from a router or another host.
AN ICMP message includes an 8-byte header and a variable size data format.