0% found this document useful (0 votes)
17 views11 pages

ICMP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views11 pages

ICMP

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

Since IP does not have an inbuilt mechanism for sending error and control

messages. It depends on Internet Control Message Protocol(ICMP) to provide an


error control. It is used for reporting errors and management queries. It is a
supporting protocol and is used by networks devices like routers for sending error
messages and operations information. e.g. the requested service is not available or
that a host or router could not be reached.

ICMPv4 Packet Format :

Source quench message :

Source quench message is a request to decrease the traffic rate for messages
sending to the host(destination). Or we can say when receiving host detects that
the rate of sending packets (traffic rate) to it is too fast it sends the source quench
message to the source to slow the pace down so that no packet can be lost.

ICMP Message Format


AN ICMP message includes an 8-byte header and a variable size data format.
 Type: It is an 8-bit field. It represents the ICMP message type. The values area
from 0 to 127 are described for ICMPv6, and the values from 128 to 255 are the
data messages.
 Code: It is an 8-bit field that represents the subtype of the ICMP message.
 Checksum: It is a 16-bit field to recognize whether the error exists in the
message or not.

Position of ICMP in the network layer


The ICMP resides in the IP layer, as shown in the below diagram.

Messages
The ICMP messages are usually divided into two categories:
o Error-reporting messages

The error-reporting message means that the router encounters a problem when it processes an IP
packet then it reports a message.

o Query messages

The query messages are those messages that help the host to get the specific information of
another host. For example, suppose there are a client and a server, and the client wants to know
whether the server is live or not, then it sends the ICMP message to the server.

ICMP will take the source IP from the discarded packet and informs the source
by sending a source quench message.
Then source will reduce the speed of transmission so that router will be free from
congestion.

When the congestion router is far away from the source the ICMP will send hop
by hop source quench message so that every router will reduce the speed of
transmission.

Parameter problem :

Whenever packets come to the router then the calculated header checksum should
be equal to the received header checksum then the only the packet is accepted by
the router.
If there is a mismatch packet will be dropped by the router.
ICMP will take the source IP from the discarded packet and informs to the source
by sending a parameter problem message.

Time exceeded message :


When some fragments are lost in a network then the holding fragment by the
router will be dropped then ICMP will take the source IP from the discarded
packet and informs the source, of discarded datagram due to time to live field
reaches zero, by sending time exceeded message.
Destination un-reachable :

Destination unreachable is generated by the host or its inbound gateway to inform


the client that the destination is unreachable for some reason.
There is no necessary condition that the only the router gives the ICMP error
message some time the destination host sends an ICMP error message when any
type of failure (link failure, hardware failure, port failure, etc) happens in the
network.

The ICMP stands for Internet Control Message Protocol. It is a network layer protocol. It
is used for error handling in the network layer, and it is primarily used on network
devices such as routers. As different types of errors can exist in the network layer, so
ICMP can be used to report these errors and to debug those errors.

For example, some sender wants to send the message to some destination, but the
router couldn't send the message to the destination. In this case, the router sends the
message to the sender that I could not send the message to that destination.

The IP protocol does not have any error-reporting or error-correcting mechanism, so it


uses a message to convey the information. For example, if someone sends the message
to the destination, the message is somehow stolen between the sender and the
destination. If no one reports the error, then the sender might think that the message
has reached the destination. If someone in-between reports the error, then the sender
will resend the message very quickly.

ICMP Message Format


The message format has two things; one is a category that tells us which type of message it is. If
the message is of error type, the error message contains the type and the code. The type defines
the type of message while the code defines the subtype of the message.

The ICMP message contains the following fields:


o Type: It is an 8-bit field. It defines the ICMP message type. The values range from 0 to
127 are defined for ICMPv6, and the values from 128 to 255 are the informational
messages.
o Code: It is an 8-bit field that defines the subtype of the ICMP message
o Checksum: It is a 16-bit field to detect whether the error exists in the message or not.

Note: The ICMP protocol always reports the error messages to the original source. For
example, when the sender sends the message, if any error occurs in the message then the
router reports to the sender rather than the receiver as the sender is sending the message.

Types of Error Reporting messages


The error reporting messages are broadly classified into the following categories:

o Destination unreachable

The destination unreachable error occurs when the packet does not reach the destination.
Suppose the sender sends the message, but the message does not reach the destination, then the
intermediate router reports to the sender that the destination is unreachable.

The above diagram shows the message format of the destination unreachable message.
In the message format:
Type: It defines the type of message. The number 3 specifies that the destination is
unreachable.

Code (0 to 15): It is a 4-bit number which identifies whether the message comes from
some intermediate router or the destination itself.

Note: If the destination creates the destination unreachable message then the code could
be either 2 or 3.

Sometimes the destination does not want to process the request, so it sends the
destination unreachable message to the source. A router does not detect all the
problems that prevent the delivery of a packet.

o Source quench

There is no flow control or congestion control mechanism in the network layer or the IP
protocol. The sender is concerned with only sending the packets, and the sender does
not think whether the receiver is ready to receive those packets or is there any
congestion occurs in the network layer so that the sender can send a lesser number of
packets, so there is no flow control or congestion control mechanism. In this case, ICMP
provides feedback, i.e., source quench. Suppose the sender resends the packet at a
higher rate, and the router is not able to handle the high data rate. To overcome such a
situation, the router sends a source quench message to tell the sender to send the
packet at a lower rate.

The above diagram shows the message format of the source quench message. It is a
type 4 message, and code is zero.
Note: A source quench message informs the sender that the datagram has been discarded
due to the congestion occurs in the network layer.

So, the sender must either stop or slow down the sending of datagrams until the
congestion is reduced. The router sends one source-quench message for each datagram
that is discarded due to the congestion in the network layer.

o Time exceeded

Sometimes the situation arises when there are many routers that exist between the
sender and the receiver. When the sender sends the packet, then it moves in a routing
loop. The time exceeded is based on the time-to-live value. When the packet traverses
through the router, then each router decreases the value of TTL by one. Whenever a
router decreases a datagram with a time-to-live value to zero, then the router discards a
datagram and sends the time exceeded message to the original source.

Each of the MAC layers has different data units. For example, some layers can handle
upto 1500 data units, and some can handle upto 300 units. When the packet is sent
from a layer having 1500 units to the layer having 300 units, then the packet is divided
into fragments; this process is known as fragmentation. These 1500 units are divided
into 5 fragments, i.e., f1, f2, f3, f4, f5, and these fragments reach the destination in a
sequence. If all the fragments are not reached to the destination in a set time, they
discard all the received fragments and send a time-exceeded message to the original
source.

In the case of fragmentation, the code will be different as compared to TTL. Let's
observe the message format of time exceeded.

The above message format shows that the type of time-exceeded is 11, and the code
can be either 0 or 1. The code 0 represents TTL, while code 1 represents fragmentation.
In a time-exceeded message, the code 0 is used by the routers to show that the time-to-
live value is reached to zero.
The code 1 is used by the destination to show that all the fragments do not reach within
a set time.

Parameter problems

The router and the destination host can send a parameter problem message. This
message conveys that some parameters are not properly set.

The above diagram shows the message format of the parameter problem. The type of
message is 12, and the code can be 0 or 1.

Redirection

When the packet is sent, then the routing table is gradually augmented and updated.
The tool used to achieve this is the redirection message. For example, A wants to send
the packet to B, and there are two routers exist between A and B. First, A sends the data
to the router 1. The router 1 sends the IP packet to router 2 and redirection message to
A so that A can update its routing table.

Note: A redirection message is sent from the router to the host on the same network.

You might also like