Network Layer – ICMP (Internet Control Message Protocol)
In the previous post, we have seen three important network layer protocols i.e RARP , BOOTP and DHCP in detail. Now its time to explore the next important protocol which is ICMP (Internet Control Message Protocol) . The IP provides unreliable and connectionless datagram delivery, and makes efficient use of network resources.
The IP protocol is a best-effort delivery (which doesn’t provide any guarantee of service) service that delivers a datagram from its original source to its final destination. However, it has two vital drawbacks i.e. lack of error control and also lack of assistance mechanisms.
Let us consider some situations first :
1. What happens if a router has to discard a datagram because it cannot find a router to the final destination, or because the time-to-live field has a zero value.
2. What happens if the final destination host has to discard all fragments of a datagram because it has not received all fragments within a predetermined time limit.
These are examples of situations where an error has occurred and the IP protocol in the network layer has no built-in mechanism to notify the original host. The Internet Control Message Protocol (ICMP) is used to overcome these drawbacks. It is used along with IP. It reports the presence of errors and sends the control messages on behalf of IP.
ICMP doesn’t attempt to make IP a reliable protocol. It basically attempts to report errors and provide feedback on specific conditions. ICMP messages are carried as IP packets and are hence unreliable. ICMP is a network layer protocol.
In other words, we can say that ICMP is a companion to the IP protocol. ICMP operates in the network layer but its messages are not passed directly to the data link layer. Instead, the messages are first encapsulated inside IP datagrams and then sent to the lower layer.
Message Format in ICMP
An ICMP message basically has an 8-byte header and a variable-size data section. Although the general format of the header is very different for each message type, the first 4 bytes are common to all. As the figure shows, the first field, ICMP type, defines the type of the message.
Types of messages in ICMP
ICMP messages are of two types:
- Error reporting messages
- Query messages
Error reporting messages in ICMP
Error messages are always sent to original source, this is because the only information available in the datagram about the route is the source and destination IP addresses. ICMP uses the source IP address in order to send the error message to the source (originator) of the datagram . Five types of errors are handled:
Destination unreachable : When a router cannot forward or deliver an IP packet, it sends a destination unreachable ICMP message back to the source which originated the packet
Source quench : A host or router uses source quench messages in order to tell the original source that congestion has occurred and to request it to reduce its current rate of packet transmission.It tells the source that the packet has been discarded .
Time exceeded : If a router receives a packet with a ‘0’ in the TTL (time to live) field then it discards that datagram and sends a time exceeded message back to the source originating that packet.
Parameter problems : Any ambiguity in the header part of a datagram can create serious problems as the datagram travels through the internet.
If a router or the destination host finds an ambiguous or missing value in any field of the datagram, it discards the datagram and sends a parameter-problem message back to the source.
Redirection : The routers and hosts must have a routing table to find the address of the next router and the routing table has to be updated automatically on a continuous basis.
The redirection message is used for such updating. The ICMP sends a redirection message back to its host to carry out an automatic periodic updating.
ICMP was designed to assist IP. But ICMP does not correct the errors. It simply reports them and leaves the error correction job to the higher-level protocols.
Query in ICMP
In addition to error reporting, the ICMP can diagnose some network problems. This can be accomplished through the query messages, a group of four different pairs of messages. There are four parts :
Echo Request and Reply : This is a pair of two messages namely echo request and echo reply messages and they are designed for the purpose of diagnosis. This pair of messages. determines whether two systems (hosts or routers) can successfully communicate with each other.
Time stamp request and reply : This pair of messages can be used by the hosts and routers to find out the round trip time that an IP datagram needs to travel between them. It can also be used for synchronizing the clock signals used in the two machines (hosts or routers).
Address mask request and reply : The IP address of a host contains a network address, subnet address and host identifier. A host may know its full IP address but may not know it is divided into three parts mentioned above. So it can send an address mask request message to the router. The router then sends back the address mask reply message.
Router solicitation and advertisement : A host that wants to send data to a host on another network must know the address of routers connected to its own network. In such situations, the router solicitation and advertisement messages can help. A host can further broadcast or multicast a router solicitation message.
Different Types of Messages In ICMPv6
We know that IPv4 was modified into IPv6. Similarly, ICMPv4 is modified in ICMPv6. This new modified protocol is more suitable for IPv6. Refer to the figure below :
The ARP and IGMP protocols in version 4 are combined in ICMPv6. The RARP protocol has been dropped from the protocol suite as it is not used very frequently. Similar to ICMPv4, the messages in ICMPv6 are divided into two types :
- Error reporting messages
- Query messages
However, each category has more types of messages in ICMPv6 as compared to those in ICMPv4. Stay tuned for the next post on IGMP protocol in the network layer.
Aric is a tech enthusiast , who love to write about the tech related products and ‘How To’ blogs . IT Engineer by profession , right now working in the Automation field in a Software product company . The other hobbies includes singing , trekking and writing blogs .