Tuesday, 6 June 2017

ICMP (Error handling or feedback messaging)

 

Before you start with this tutorial I recommend you to read my earlier post on overview of ICMP, where I gave some insight into this topic. You can check it out here.

As I have already told where all ICMP feedback messaging is used, now it's time to study them in detail. The following diagram gives the complete picture of this post.

ICMP Feedback messaging:

1. TTL exceed:

There is a field called TTL in IPv4 packet (and Hop Limit in IPv6). It is used to specify how many hops at max the packets can cross to reach the destination. If before reaching the destination the TTL value reaches 0 then the packet is discarded by the router and an ICMP packet is generated.
The sender A sends a packet with TTL = 2. But TTL reaches zero at router R2 before it could reach the destination B. The router R2 generates an ICMP back to the sender A. Which contains the reason for discarding the packet.

2.Source quench:

This is a situation where source generates a lot of data and pushes everything onto the network. The router on the way might not be able to handle such huge amount of data and might get congested.
In this kind of situation, the congested router sends back an ICMP to the sender saying, please stop till I process the previous packet. Quench itself means stop.

3.Parameter problem:

If you know strict source routing you will understand this. In strict source routing, we predefine the path in the packet itself by providing it with the next hop information. If I want to send a packet from A to B which have many routers between them, but we want the packet to follow a specific path then we can mention the path in the packet. Such as A→R1→R4→R7→B.

Now if a packet is travelling through that path and in-between it encountered a problem saying there is no path from router R4 to router R7, such problem is called parameter problem.
Parameter problem says that the parameters provided for strict source routing are wrong. The router R4 then generates an ICMP and sends it back to A.

4.Destination unreachable:

There are two types of destination unreachable problem:
  • Destination host unreachable
  • Destination port unreachable
Destination host unreachable: This problem occurs when we send a packet and the targetted host is down. Also if the link between the router and the destination is down. In both the cases, the router sends back an ICMP to source specifying Destination host unreachable.

Destination port unreachable: This problem occurs when you have reached the destined host but the port number to which the packet has to be delivered is not open. In that case, the destination host sends back an ICMP to the source, specifying destination port unreachable.

5.Source redirect:

When A sends a packet to B. It first reaches router R0. If R0 by mistake forwards the packet to R3 instead of R1. Then R3 sends back an ICMP to R0, saying that there is a shorter path through R1 and it can use it.
But the good thing is the first time the packet is forwarded by R3. The ICMP is for the next packet.
There is one more application of Feedback messaging PMTU i.e Path MTU discovery. This topic is big and needs a lot of explaining. I have created a separate post for it. You can check it out here.

Hope this was helpful. If you have any questions related to any of my posts feel free to ask. I will be happy to help you. At the same time, if you have any suggestions for me, you can put it in the comments section below. Do follow us on Facebook and google+ to get latest updates.

Thank you!