Internet Control Messaging Protocol (ICMP)

The Internet Control Messaging Protocol (ICMP) is a vital network layer protocol that implements the TCP/IP protocol suite. An Internet Protocol (IP) is unreliable because it does not provide messages to be sent in the event of specific errors. The Internet Control Message Protocol (ICMP) services send messages that include information about the network’s status rather than application data.

The Internet Control Messaging Protocol (ICMP) messages provide feedback about network-related issues, including processing IP packets under certain situations, not to make IP reliable. Internet Control Messaging Protocol (ICMP) is often not required or allowed within a network for security reasons.

Internet Control Messaging Protocol (ICMP) messages are a particular type of IP message separate from TCP and UDP. Ping is an example of an Internet Control Messaging Protocol (ICMP) message. It uses Internet Control Messaging Protocol (ICMP) to inspect remote hosts for reaction and measure the overall round-trip time of the investigated messages. It also supports additional utilities like traceroute (tracert) to discover all hops on the path between a given source and destination.

Internet Control Messaging Protocol (ICMP) is available for IPv4 and IPv6. The IPv4 address uses ICMPv4 as the messaging protocol, and ICMPv6 do the job for IPv6 but includes supplementary functionality. Some common messages for both ICMPv4 and ICMPv6 are the following:
  • The remote Host Confirmation message
  • Destination Unreachable
  • Service Unreachable
  • Router Time exceeded Exceeded Message
  • Route redirection

Remote Host Confirmation

We can use an Internet Control Messaging Protocol (ICMP)Echo Message to find out the availability and connectivity of the remote host. To find the availability and connectivity of the remote host, the local host sends an Internet Control Messaging Protocol (ICMP) Echo Request to the remote host. If the remote host is available and connected to the network and the configuration is correct, it responds with an Echo Reply. The Internet Control Messaging Protocol (ICMP) Echo messages are the base of the ping utility.

Destination or Service Unreachable

When a gateway receives an Internet Control Messaging Protocol (ICMP) echo message destined for other hosts, and the destined host is not available, or there is some problem with that host and the gateway cannot send the echo message further, it replies with Destination Unreachable message to alert the source host that the destination host or service is unreachable. The message will contain a code that indicates why the packet could not be delivered.ICMPv6 has a similar code with a little difference 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

Router Time Exceeded Message

The router uses a time-exceeded message to show that a packet cannot be forwarded because the packet’s Time To Live (TTL) field 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 fails to forward an IPv6 packet expiration. IPv6 uses a hop limit field instead of the Time To Live (TTL) field to determine if the packet has expired.

Route Redirect

It is an error message sending a router to the sender of an IP packet. The router uses Internet Control Messaging Protocol (ICMP) to redirect messages to tell hosts that there is a better next hop to reach a particular destination.