Definition of Internet Control Message Protocol
Internet Control Message Protocol is also known as ICMP. It is a network layer protocol. ICMP messages are not directly transferred to the network layer, instead, first, the ICMP messages are encapsulated in IP datagrams and then it is transferred to a lower network.
The below-mentioned diagram shows the process of encapsulation in the Internet Control Message Protocol.
Why do we need it?
The Internet protocol provides a connectionless delivery of datagram. The goal behind this is to make the use of network resources efficiently. In other words, it is designed to transfer datagram from one host to another. But it has two deficiencies i.e. lack of assistance and lack of error mechanism. To solve these two problems the Internet Control Message Protocol comes into the picture.
Internet Control Message Protocol messages
There are two types of Internet Control Message Protocol messages – 1) Error reporting messages and 2) Query messages. Error reporting messages are used to detect the problems that a router or host may face while transforming the IP packet. The query messages help the network manager to get specific information from any router or host.
Internet Control Message Protocol message Format
The below-mentioned diagram shows the format of the Internet Control Message Protocol message.
- Type: This field is of 8 bits which defines the types of messages.
- Code: This field is of 8 bits which defines the reason for the specific messages type.
- Checksum: This field is of 16 bits which is used to detect the error while transforming the datagrams.
- Rest of header: This field is for each type of message.
- Data section: This filed is an error message. It carries information about the original packet that has an error. In the case of query messages, this field carries extra information based on the query type.
Types of Internet Control Message Protocol Messages
Here are the types of Internet Control Message Protocol messages given below
1) Error Reporting Messages
Error reporting messages are used to report problems that router or host may face while transforming the datagrams. Remember that error reporting messages doesn’t correct the error that router faces, it simply gives the summarized report of the error. Error messages are always sent to the source i.e. sender site because datagrams contain only source and the destination IP address. Internet Control Message Protocol uses an IP address of the source to send an error message.
There are five types of error reporting messages –
4.5 (2,661 ratings)
- Destination unreachable message
- Source quench message
- Time exceeded message
- Parameter problem message
- Redirection message
- Destination unreachable message: The host or router sends the destination unreachable message to the source who initiated the datagram when the host or router cannot route the datagram. In other words, when the router cannot send a datagram to the recipient, it sends the destination unreachable message to the source.
- Source quench message: The router sends source quench messages to the datagram source when the host or router discards the datagram due to the lack of flow control and congestion control.
- Time exceeded message: Time exceeded message can be generated in two cases. Let’s discuss those cases
Case 1: When the host or router decrement the time to live value of datagram to zero, the Internet Control Message Protocol sends the time exceeded message to the source address and discards the datagram.
Case 2: When the destination address does not receive all datagram fragments in a specified time interval, Internet Control Message Protocol sends a time exceeded message to the source address and discards the datagram.
In time exceeded message, routers use code 0 to show the value of time to live field is 0 and destination host use code 1 to show all fragments of datagrams received at the specified time.
- Parameter problem message: This message is created by the destination host or router. If the router or destination host identifies an ambiguous activity or missing value in any field of the datagram, it sends the parameter problems message to the source address and discards the datagram.
- Redirection message: This message is sent by a router or host on the same local network.
The routing table produces traffic as it updates tables dynamically. Mostly host uses static routing. When the host comes up, its routing table has a limited number of entries. It only knows the IP address of one router and default router. Because of this reason host may send datagram of one network to another i.e wrong router. In this case, the wrong router that receives datagrams forward to the correct router. But to update the host routing table, it sends a redirection message to the host.
2) Query Messages
Query messages help network managers to get specific information from any router or host. In other words, the Internet Control Message Protocol can diagnose some network problems through query messages.
There are four types of query messages –
- Echo request and reply message
- Timestamp request and reply message
- Address mask request and reply message
- Router solicitation and advertisement message
- Echo-request and reply message: This message is designed for diagnostic purposes. These messages are used to identify whether two systems can communicate with each other or not.
The echo request message can be sent by host or router, while the echo reply message is sent by host or router that receives an echo request message.
Network managers use these messages to check that IP protocol operations.
Using ping command each request and reply message can test the reachability Of the host or router.
- Timestamp request and reply message: Timestamp request and reply message are used to determine the round trip time, each IP datagram takes while traveling from one host to another host. It can also synchronize the clocks between hosts.
- Address mask request and reply message: These messages are used to identify the mask of the host.
For example, suppose host known its IP address 192.168.1.25 but it does not know the mask of the corresponding host, In that case, to know the mask of the host it sends address mask request message for the router on LAN network. In case the host knows the IP address of the router, it sends a request directly to that router and if it does not know, then it broadcast the request message. The router that receives the address mask request responds with an address mask reply and provides the mask to the host.
- Router solicitation and advertisement message: Suppose a host wants to send data on another host that lies on another network and needs to know the IP address of the routers connected to its own network. It also wants to know whether the router of its own network is functioning or not. In that situation, router solicitation and advertisement messages can help. Host broadcast router solicitation message and router that receives the message broadcast the routing information using a router advertisement message.
This is a guide to Internet Control Message Protocol. Here we discuss the Types of Internet Control Message Protocol messages. You may also look at the following article to learn more –