You are on page 1of 25

ICMP

IP addre ss
Each ICMP message contains three fields that define its
purpose and provide a checksum. They are TYPE, CODE, and
CHECKSUM fields. The TYPE field identifies the ICMP message,
the CODE field provides further information about the associated
TYPE field, and the CHECKSUM provides a method for
determining the integrity of the message.
The purpose of these control messages is to provide
feedback about problems in the communication
environment, not to make IP reliable.
Type of Messages

Error-reporting message: report problems that a


router or host (destination) may encounter when
it processes an IP packet.

Query Message: help a host or a network manger


get specific information from a router or another
host.
ICMP always reports error messages to the
original source.

Error typing:

Destination unreachable (type 3)

Source quench (type 4)

Time exceeded (type 11)

Parameter problems (type 12)

Redirection (type 5)
Destination Unreachable

When a packet is undeliverable, a Destination


Unreachable, Type 3, ICMP is generated.

Type 3 ICMPs can have a Code value of 0 to 15


Source Quench

An ICMP Source Quench message has a Type field of


4 and Code 0. Source Quench messages are sent
when the destination is unable to process traffic as fast
as the source is sending it. The Source Quench ICMP
tells the source to cut back the rate at which it is
sending data. The destination will continue to generate
Source Quench ICMPs until the source is sending at
an acceptable speed.
Redirect Message

An intermediary device will generate an ICMP


Redirect Message when it determines that a route
being requested can be reached either locally or
through a better path. Redirect Message ICMPs
are Type 5 (The router & host have routing table)
Time Exceeded

If a router or host discards a packet due to a time-


out, it will generate a Time Exceeded Type 11
ICMP. The Time Exceeded ICMP will have a Code
value of either 0 or 1.

A Code 0 is generated when the hop count of a


datagram is exceeded and the packet is discarded.
A Code 1 is generated when the reassemble of a
fragmented packet exceeds the time-out value.
Parameter Problem

When an intermediary device or host discards a


datagram because exist ambiguity in the header
part of a datagram or missing value in any field ,
an ICMP 12 is generated.
parameter-problem message back to the source.
code 0: Main header problem
code 1: problem in the option field
A router receives an IPv4 packet with source IP
address 130.45.3.3 and destination IP address
201.23.4.6. The router can’t find the destination
address in its routing table. Which ICMP
message should be sent?
What is the type of the message? What is the code? What
is the purpose of the
message?

If ICMP message has arrived with the header

03 03 10 20 00 00 00 00 (in hexadecimal).

If ICMP message has arrived with the header

05 00 11 12 11 0B 03 02
03 03 10 20 00 00 00 00 (in hexadecimal).

Type 3 code 3 destination unreachable

05 00 11 12 11 0B 03 02

Type 5 code 0 redirection message


Information query function

Help a source host or a network manager get


specific information from a router or another
host.
Echo request and reply :

Echo request is type 8, while echo reply is type 0.


When a host receives a type 8, it replies with a type 0.
Timestamp-request and
timestamp-reply message format

McGraw-Hill © The McGraw-Hill Companies, Inc., 2000


Timestamp request/reply

Timestamp-request and timestamp-reply messages


can be used to calculate the round-trip time
between a source and a destination
Sending time = value of receive timestamp −
value of original timestamp
Receiving time = time the packet returned −
value of transmit timestamp
Round-trip time = sending time + receiving time
Given the information:
Value of original timestamp: 46
Value of receive timestamp: 59
Value of transmit timestamp: 60
Time the packet arrived: 67
Calculate Sending time ,Receiving time ,Round-trip time.
What is Checksum?

A check sum is basically a value that is computed from data packet to


check its integrity.
The checksum is calculated by using both the header and the data fields
of the ICMP message
Rules of Binary Addition
•0 + 0 = 0
•0 + 1 = 1
•1 + 0 = 1
•1 + 1 = 0, and carry 1 to the next more significant bit
•1 + 1 + 1 = 1, and carry 1 to the next more significant bit
Calculate the checksum for the following ICMP
packet:
Example of checksum calculation

McGraw-Hill © The McGraw-Hill Companies, Inc., 2000

You might also like