Internet Control Message Protocol (ICMP) is the key network layer protocol that implements the TCP/IP protocol suite. An IP is not a reliable protocol, the TCP/IP suite does provide for messages to be sent in the event of certain errors. The ICMP services send these messages which contain information for a status of the network itself rather than application data. These messages provide feedback about issues related to the processing of IP packets under certain situation, not to make IP reliable. ICMP messages are not required and are often not allowed within a network for security reasons.
ICMP messages are a specific kind of IP message separate from TCP and UDP. The top example of ICMP messaging is the ping utility, which uses ICMP to investigate remote hosts for reaction and measure overall round-trip time of the investigate messages. ICMP, also, supports additional utilities like traceroute (tracert) that discover all hops on the path between a given source and destination.
Internet Control Message Protocol (ICMP) is available for both IPv4 and IPv6. ICMPv4 is the messaging protocol for IPv4 and ICMPv6 provides these same services for IPv6 but includes supplementary functionality. We will discuss here some of the more common messages both ICMPv4 and ICMPv6 :
- Host confirmation
- Destination or Service Unreachable
- Time exceeded
- Route redirection
An Internet Control Message Protocol Echo Message can generally use to find out a host availability and connectivity. The local host sends an ICMP Echo Request to a remote host. If the host is available and connected, the destination host responds with an Echo Reply. This use of the ICMP Echo messages is the basis of the ping utility. We will discuss the ping utility in the coming lessons briefly.
Destination or Service Unreachable
When a gateway or a remote host receives a packet that it cannot send, it can use an ICMP Destination Unreachable message to alert the source host that the destination or service is unreachable. The message will contain a code that indicates why the packet could not be delivered. ICMPv6 has a similar code but a little different for Destination Unreachable messages. Some Destination Unreachable codes for ICMPv4 are the following:
- 0 – Net unreachable
- 1 – Host unreachable
- 2 – Protocol unreachable
- 3 – Port unreachable
The router uses time exceeded message to show that a packet cannot be forwarded for the reason that the TTL (Time To Live) field of the packet was decremented to 0. If a router receives a packet with the TTL field in the IPv4 packet to zero, it rejects the packet and sends a Time Exceeded message to the source host.
ICMPv6 also sends a Time Exceeded message if the router failed to forward an IPv6 packet expiration. IPv6 does use a hop limit field in place of TTL field to determine if the packet has expired.
An ICMP redirect message is an error message, sending a router to the sender of an IP packet. The router is using ICMP redirect messages to tell hosts that there is a better next hop to reach a certain destination.