Internet control message protocol.
ICMP is an error reporting protocol that network devices like routers use to generate error messages
to the source IP address when network problems prevent delivery of IP packets.
ICMP messages are sent in several situations.
For example, when a datagram cannot reach its destination.
When the gateway does not have the buffering capacity to forward a datagram.
And when the gateway can direct the host to send traffic on a shorter route.
The Internet protocol is not designed to be absolutely reliable.
I'll explain why.
Hold on.
The purpose of these control messages is to provide feedback about problems in the communication environment,
not to make IP reliable.
There's still no guarantees that a datagram will be delivered or a control message will be returned.
Some datagrams may still be undelivered without any report of their loss.
The higher level protocols that use IP must implement their own reliability.
Procedures if reliable communication is required.
So the ICMP header starts after the IPv4 header.
All ICMP packets have an eight byte header and variable size data section.
The first four bytes of the header have a fixed format.
While the last four bytes depend on the type and code of that ICMP packet.
ICMP type and code in the header identifies the control message.
Some of the ICMP control messages are shown in this slide.
So Ping is the most well known application of the ICMP.
It operates by sending ICMP echo request packets to the target host and then waiting for an ICMP echo
reply.