Hi Everyone,
What is ICMP?
Internet Protocol (IP) is used when two or more devices connect and transcieve the information to and from each other in a network. However, there arise some instances when reporting of an error or raising a query is required from the destination towards the source. For this purpose, Internet Control Message Protocol (ICMP) is used. ICMP is a network layer protocol that uses IP address to send the query or report an error. These errors could be datagram reaching issues to the destination, datagram forwarding capacity issues of any network or node, redirection of the traffic or time exceeding issue.
Description on ICMP Message Format:
As discussed above, ICMP messages are sent to the source through the basic IP header. The 8 byte header is divided into three section. First section is Type, second is Code and third section is Checksum. Type section uses 1 byte and defines the type of the message. Code specifies the reason of the message type and it is also of 1 byte. Lastly, Checksum is a 2 bytes long one's complement of the one's complement sum of the ICMP message and used for validation purposes. The data section carries the IP header and first 8 bytes of original data of the datagram.

Type in ICMP message has two categories. First is Error reporting message and second is Query Message. For Error reporting, 3, 4, 11, 12 & 5 types are used that refer to Unreachable Destination, Source Quench, Time Exceeded, Parameter Problem and Redirections errors respectively. For Query messages, 0 or 8 is used Echo Request/Reply, 13 or 14 is used Timestamp Request/Reply, 9 or 10 is used for routing solicitation or advertisement and lastly, 17 or 18 are for Address mask Request/Reply.


Code 4 is used when fragmentation issues rises. i-e fragmentation was required but Don’t Fragment bit has been sent. Code 5 is for unsuccessful routing due to source routing issues in any of the router in the network. Code 6 is for undefined destination network. In this case, the router has no information of to which destination routing is to be done. Code 7 is similar to Code 6 as in this case destination host is unknown instead of destination network as in case of Code 6. Code 8, 9 and 10 are for source route failed, communication is administratively banned with the network and communication is administratively banned with host respectively. Code 11 & 12 are for Network or Host unreachable for any specific type of service. Code 13 is for unreachability issue due to administrative filtering. Lastly, Code 14 and 15 are for unreachability due to either of violation or cutting-off of the precedency of the host.
Thank You for reading.
