Internet Control Message Protocol (ICMP) : CSC465 - Computer Networks
Internet Control Message Protocol (ICMP) : CSC465 - Computer Networks
ICMP
• IP unreliable, connectionless datagram delivery
CONTENTS – Efficient use of network resources
– Best effort service to send from source to destination
• TYPES OF MESSAGES • No error control
• MESSAGE FORMAT – What if router must discard datagram because it
cannot find route to final destination?
• ERROR REPORTING
– What if final destination must discard all fragments
• QUERY because some don’t arrive within time limit?
• CHECKSUM – Error has occurred and IP Protocol has no built-in
• ICMP PACKAGE mechanism to notify the original host
• No method to obtain node information
– Is router or host alive?
ICMP
Encapsulation of ICMP packet
1
ICMP messages
9.1
TYPES
3 Dest Unreachable
OF 8/0 Echo Request/Reply
4 Source Quench
MESSAGES 13 / 14 Timestamp Req/Reply
11 Time Exceeded 17 / 18 Address Mask
12 Parameter Problem 10 / 9 Router Solicitation
5 Redirection
9.2
MESSAGE
FORMAT
ICMP
• ICMP reports errors
• Higher protocols must correct them
9.3 • ICMP always reports error messages to the
original source
ERROR • Source address within IP datagram
REPORTING
2
Error-reporting messages
ICMP handles five (5) types of errors Important points about ICMP error messages:
• Destination unreachable 1. No ICMP error message for a datagram
• Source Quench carrying an ICMP error message.
• Time exceeded 2. No ICMP error message for a fragmented
datagram that is not the first fragment.
• Parameter Problem
3. No ICMP error message for a datagram
• Redirection
having a multicast address.
4. No ICMP error message for a datagram
with a special address such as 127.0.0.0
or 0.0.0.0.
3
Source Quench Source-quench format
• IP offers no inherent support to guide flow
control
• The source host does not know if the routers or
dest host have been overwhelmed with datagrams
• Lack of flow control can create congestion in
routers or destination host
– Router forwarding buffers may overflow
– Host processing buffers may overflow
• Source Quench messages in ICMP
• Routers or hosts that discard packets sends SQ
– Informs source of discarding; warns source of speed
One source-
source-quench message should
be sent, from router or destination host
for each datagram that is discarded due
A source-
source-quench message informs
to congestion.
the source that a datagram has been
discarded due to congestion • There is no mechanism for telling source that congestion
in a router or the destination host. is relieved and transmission can resume at previous rate.
The source must slow down the sending • Source continues to send at reduced rate.
• If transmission is many-to-one, the destination may drop
of datagrams until the congestion packets from slower sending host but not those from faster
is relieved. (congestion causing) senders.
4
Time Exceeded Message Time-exceeded message format
In a time-
time-exceeded message,
code 0 is used only by routers
to show that the value of
the time-
time-to-
to-live field is zero.
Code 1 is used only by the destination
host to show that not all of the Code 0: Time to live
fragments have arrived within a set time. Code 1: Fragmentation
A parameter-
parameter-problem message can Code 0: Ptr field points to problem byte
be created by Code 1: Ptr field unused
a router or the destination host.
ICMP Redirection
• Router’s routing tables updated dynamically
using routing protocols
– Hosts don’t participate (for efficiency) since many A host usually starts with a small
more hosts than routers
• Hosts usually use static routing
routing table that is gradually
– Can result in misrouted datagram augmented and updated.
– In this case the recipient router forwards datagram to One of the tools to accomplish
correct router this is the redirection message.
– Sends ICMP “redirection” message to sending host to
update its routing table
5
Redirection concept
Redirection message format
Query messages
In addition to error detection, ICMP can also
diagnose some network problems
9.4 Uses query/response system
QUERY
6
Echo-request and echo-reply message format Timestamp Request/Reply
• Used by two machines to determine the roundtrip
time for an IP datagram to travel between them
• Also used to synchronize the clocks in two
machines
• Format contains three timestamps, each 32-bits
• Optional Data must be returned exactly as sent • Represents time (in milliseconds) from midnight
• Identifier and Sequence # not formally defined in Universal Time (formerly GMT)
• Identifier often Process ID of sender
• Sequence # keeps track of particular request/reply
The Round-
Round-Trip Time computation correct
even if their clocks are not synchronized.
7
Router solicitation message format Router advertisement message format
Hosts need to know addresses of routers Preference level is used to select default router
Request broadcast by host to obtain the operating If pref level is 0 then it is default. If level is 0x80000000
routers never selected as default
Routers reply with all routers they are aware of
including themselves (Sometimes reply without
request)
9.5
CHECKSUM
ICMP package
9.6
ICMP
PACKAGE