ICMP(Internet Control Message Protocols) Error Reporting Messages Types

One of the main purposes of ICMP is error reporting.


1. Destination Unreachable:-

A packet is discarded when the destination is not found. These messages are created by the host itself or the router.

2. Source Quench:-

There is no flow control in IP protocols and because of this, there is no way to handle congestion in route. So a router or host discards some IP datagram to handle congestion.

When a packet is discarded, an ICMP packet is sent to the source informing two things:- 

  • The packet is discarded.
  • There is some congestion in the path or processing at the receiver side is slow.

3. Time To Live:-

  1. It is not time.
  2. It is the total number of hops or host that a packet has to pass before it reaches to destination.
  3. When the packet reaches to host or destination that host will decrease its value by 1.
  4. If the value of TTL =0 after reaching a host and that host is not the destination then that packets will be discarded and an ICMP packet is generated.

4. Parameter Problem:-

When a router or any host found that some value is missing in IP datagram, it discards that packets.


Suppose there is a host A wants to sends data to host B.


The best way to send data to B is through router R2 but A chooses to send through R3 which is wrong.

When packet will reach to R3 it will come to know that the best path is through R2. So it will update the path and also informs A that optimal path is R2 for sending packets to B.

ICMP (Internet Control Message Protocol) Introduction

Need for ICMP:

We know that the IP layer provides unreliable and connectionless services. It doesn't have any mechanisms for error reporting and error correction.

What will happen when:-

1. A router discards some packets because of TTL exceeds or route is not defined.

2. The destination is not accepting any of the datagrams because they did not arrive under determined time.

So ICMP is designed to overcome these problems. It is a friend of the IP protocol.


An ICMP packet has 8 Bytes of header and variable size data parts.

ICMP does not correct errors. It simply reports them. Error correction is the functionality of higher layers protocols.

Format of ICMP packet:

An ICMP error packet contains the following fields:

  • The header of an original data datagram
  • 8 Bytes of data


When a packet is discarded the source want to know three things:

  1. Who discarded?
  2. What discarded?
  3. Why discarded?

ICMP header contains information about why and who discarded.

Original datagram header contains information about what discarded.

The purpose of 8 Bytes is:-

To inform the upper layer protocols(TCP/UDP )of the sender about errors.

Some Important Points:-

  1. No ICMP packet will be generated in response to a datagram carrying ICMP messages.
  2. No ICMP packets will be generated for a datagram having multicast as the destination address.
  3. No ICMP packet is generated for datagram having a special address like
  4. If fragmentation is done ICMP packet is generated for the only first datagram. (Offset=0)