0% found this document useful (0 votes)
85 views8 pages

Internet Control Message Protocol (ICMP) : CSC465 - Computer Networks

The document discusses the Internet Control Message Protocol (ICMP). ICMP addresses deficiencies in IP by providing error reporting and querying functions. It discusses the types of ICMP messages including error reporting messages like destination unreachable, source quench, and time exceeded. These messages are used to notify a source host of issues like an unreachable destination, congestion, or expired time-to-live values. The document also covers the general format of ICMP messages and includes examples of specific message formats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views8 pages

Internet Control Message Protocol (ICMP) : CSC465 - Computer Networks

The document discusses the Internet Control Message Protocol (ICMP). ICMP addresses deficiencies in IP by providing error reporting and querying functions. It discusses the types of ICMP messages including error reporting messages like destination unreachable, source quench, and time exceeded. These messages are used to notify a source host of issues like an unreachable destination, congestion, or expired time-to-live values. The document also covers the general format of ICMP messages and includes examples of specific message formats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Chapter 9

CSC465 – Computer Networks


Dr. J. Harrison Internet Control
Message Protocol
These slides were produced almost entirely from material by Behrouz Forouzan
(ICMP)
for the text “TCP/IP Protocol Suite (2nd Edition)”, McGraw Hill Publisher

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

ICMP addresses IP deficiencies

Value of protocol field in IP datagram is 1 to indicate


data is ICMP

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

General format of ICMP messages

9.2

MESSAGE
FORMAT

First 4 bytes common to all ICMP messages


Code specifies reason for particular message type

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.

Contents of data field for error messages Destination-unreachable format


When a router cannot route a datagram the datagram is
discarded and the router sends a “destination unreachable”
message back to source host.
When a host cannot deliver a datagram, the datagram is
discarded and the destination host sends a “destination
unreachable” message back to source host.

8 bytes UDP (TCP) header


(Source/Dest ports, length, checksum)

• 0: Net Unreachable 1: Host Unreachable


• 2: Protocol Unreachable 3: Port Unreachable
• 4: Frag Needed but “Don't Frag” was Set
• 5: Source Route Failed 6: Dest. Net Unknown Destination-
Destination-unreachable messages with
• 7: Dest. Host Unknown 8: Source Host Isolated codes 2 or 3 can be created only
• 9: Communication with Dest Net is Admin Prohibited by the destination host.
• 10: Communication with Dest Host is Admin Prohibited Some destination-
destination-unreachable
• 11: Dest Net Unreachable for Type of Service messages can
• 12: Dest Host Unreachable for Type of Service
be created only by routers.
• 13: Communication Administratively Prohibited
• 14: Host Precedence Violation
• 15: Precedence cutoff in effect

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.

Time Exceeded Message Time Exceeded Message


Sent in two cases: Sent in two cases:
Case 1: Case 2:

When the final destination does not receive


Whenever a router receives a datagram all of the fragments in a set time,
with a time-
time-to-
to-live value of zero, it discards the received
it discards the datagram and fragments and sends
sends a time-
time-exceeded message to a time-
time-exceeded message
the original source. to the original source.

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

Parameter-problem message format


Parameter-problem message format
Error or ambiguity in one of the header fields
(Code 0)
Required part of an IP option is missing
(Code 1)

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

Code 0: Network specific


A redirection message is Code 1: Host specific
sent from a router to Code 2: Network specific (specified service)
Code 3: Host specific (specified service)
a host on the same local network.

Query messages
In addition to error detection, ICMP can also
diagnose some network problems
9.4 Uses query/response system

QUERY

Echo Request / Reply An echo-


echo-request message can be
sent by a host or router.
• Used by network managers and users for
diagnosing network problems An echo-
echo-reply message is sent by the
• Tests if IP stack functioning on destination and host or router which receives
routers in between an echo-
echo-request message
• Tests for the “reachability” of a host
• Used to implement the PING command Echo-
Echo-request and echo-
echo-reply messages
– Packet INternet Groper can be used by network managers
to check the operation of the IP
protocol..

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

Timestamp-request format Timestamp-reply format


• Original Timestamp receives Univeral Time shown by • Original Timestamp receives value copied from request
clock at departure time
• Receive timestamp contains UT time dest received packet
• Receive/Transmit timestamps initialized to 0s
• Transmit timestamps contains UT time packet sent

Mask-request and mask-reply message format


Sending time = value of receive timestamp − • Used by Host to obtain its IP address mask
value of original timestamp • Host sends request to router if it knows IP of router
• If not, host broadcasts request and then router replies
Receiving time = time the packet returned − • Diskless workstations use RARP to first get IP
value of transmit timestamp • Then use ICMP Mask-request to get address mask

Round-Trip Time = Sending time + Receiving time

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)

Example of checksum calculation

9.5

CHECKSUM

ICMP package

9.6

ICMP
PACKAGE

You might also like