ICMP (Internet Control Packet Protocol)
To forward IP data packets more effectively and improve the chances of successful delivery, the network layer uses the Internet Control Packet protocol ICMP. ICMP acts as the IP datagram data and adds the header of the datagram to form the IP datagram forwarding.
ICMP allows the host or router to report errors and reports exceptions.
ICMP messages are classified into two types: Error Report messages and inquiry messages.
Error Report Message types include: inaccessibility to the end point, source point suppression, time exceeding, parameter problems, route change (redirection ).
The types of inquiry messages include: Send-back request or answer, timestamp request or answer.
An important application of ICMP is packet inter-net groper, which is used to test the connectivity between two hosts. ICMP uses send-back requests and send-back response packets.
Ping is an example of using ICMP directly at the application layer without passing through TCP or UDP.
Another very useful application is traceroute (which is a keyword in UNIX) and tracert in windows. This application is used to track the path of a group from the source point to the end point.
The traceroute application sends a series of IP datagram to the target host, which encapsulates the undeliverable UDP user datagram.
The ttl of the first datagram P1 is set to 1. When the datagram reaches the first router R1 that receives it, the TTL is reduced by 1 because it becomes 0, therefore, router R1 discards the datagram and sends an ICMP packet to the source host that exceeds the error report time.
Then, the source host sends the second datagram P2 and sets the TTL to 2. P2 first reduces TTL by 1 after arriving at router R1, and then forwards the datagram to the next router R2, when R2 receives P2, the TTL is 1, and the value is 0 after it minus 1. Therefore, vror2 R2 discards this datagram P2 and sends an ICMP packet to the source host that exceeds the error report time.
This continues .......
When the last datagram arrives at the target host, the TTL of the datagram is exactly 1. The host does not forward the datagram, nor reduces the TTL by 1, however, because the IP datagram encapsulates a UDP User Datagram that cannot be delivered, the destination host sends an error report that is inaccessible to the source host.