Internet Control Message Protocol

It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address.

[3] ICMP differs from transport protocols such as TCP and UDP in that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications (with the exception of some diagnostic tools like ping and traceroute).

ICMP messages are typically used for diagnostic or control purposes or generated in response to errors in IP operations (as specified in RFC 1122).

ICMP errors are directed to the source IP address of the originating packet.

If the resulting TTL is 0, the packet is discarded and an ICMP time exceeded message is sent to the datagram's source address.

The traceroute command can be implemented by transmitting IP datagrams with specially set IP TTL header fields, and looking for ICMP time exceeded in transit and destination unreachable messages generated in response.

If a higher level protocol uses port numbers, they are assumed to be in the first eight bytes of the original datagram's data.

Source Quench requests that the sender decrease the rate of messages sent to a router or host.

But as no acknowledgement mechanism is present in the network layer, the client does not know whether the data has reached the destination successfully.

When a client receives this message, it automatically slows down the outgoing data rate or waits for a sufficient amount of time, which enables the router to empty the queue.

Thus the source quench ICMP message acts as flow control in the network layer.

Furthermore, forwarding of and any kind of reaction to (flow control actions) source quench messages was deprecated from 2012 by RFC 6633.

Time exceeded messages are used by the traceroute utility to identify gateways on the path between two hosts.

The originating timestamp is set to the time (in milliseconds since midnight) the sender last touched the packet.

Where: ICMP Address Mask Request may be used as a part of reconnaissance attack to gather information on the target network, therefore ICMP Address Mask Reply is disabled by default on Cisco IOS.

An example of how an ICMPv4 redirect message works