ICMP
© CSS Corp | Confidential | www.csscorp.com
1
© CSS Corp | Confidential | www.csscorp.com
Learning Objective
• ICMP Introduction
• ICMP Messages
• Message Format
• Error Reporting Messages
© CSS Corp | Confidential | www.csscorp.com 2
ICMP
• The Internet Control Message Protocol (ICMP) is a companion to the IP
protocol & has been designed to compensate for below deficiencies
The IP protocol has no error-reporting or error-correcting mechanism
The IP protocol also lacks a mechanism for host and management
queries
• ICMP itself is a network layer protocol but its messages are not passed
directly to the data link layer instead, the messages are first encapsulated
inside IP datagram's before going to the lower layer.
• The value of the protocol field in the IP datagram is 1 to indicate that the
IP data is an ICMP message.
© CSS Corp | Confidential | www.csscorp.com 3
ICMP MESSAGES
• ICMP messages are divided into two broad categories:
error-reporting messages and query messages.
Category Type Message
Error-Reporting 3 Destination Unreachable
Messages 4 Source Quench
11 Time Exceeded
12 Parameter Problem
5 Redirection
Query Messages 8 or 0 Echo Request or Reply
13 or 14 Timestamp Request or Reply
• The error-reporting messages report problems that a router or a host
(destination) may encounter when it processes an IP packet.
• The query messages, which occur in pairs, help a host or a network
manager get specific information from a router or another host.
© CSS Corp | Confidential | www.csscorp.com 4
Message Format
• An ICMP message has an 8-byte header and a variable-size data section.
Although the general format of the header is different for each message
type, the first 4 bytes are common to all.
8 bits 8 bits 16 bits
• The first field, ICMP type, defines the type of the message.
• The code field specifies the reason for the particular message type.
• The last common field is the checksum field
• The rest of the header is specific for each message type.
• The data section in error messages carries information for finding the
original packet that had the error.
© CSS Corp | Confidential | www.csscorp.com 5
Error Reporting Messages
Error Reporting
Destination Parameter
Source Quench Time Exceeded Redirection
Unreachable Problems
• One of the main responsibilities of ICMP is to report errors.
• ICMP does not correct errors, it simply reports them.
• Error messages are always sent to the original source because the
only information available in the datagram about the route is the
source and destination IP addresses.
• ICMP uses the source IP address to send the error message to the
source (originator) of the datagram
© CSS Corp | Confidential | www.csscorp.com 6
Destination Unreachable
• When a router cannot route a datagram or a host cannot deliver a
datagram, the datagram is discarded and the router or the host sends a
destination-unreachable message back to the source host that initiated
the datagram.
• The code field for this type specifies the reason for discarding the
datagram:
Code 0. The network is unreachable
Code 1. The host is unreachable.
Code 2. The protocol is unreachable.
Code 3. The port is unreachable.
© CSS Corp | Confidential | www.csscorp.com 7
Destination Unreachable - Codes
Code 4. Fragmentation is required, but the DF (do not fragment)
field of the datagram has been set.
Code 5. Source routing cannot be accomplished
Code 6. The destination network is unknown.
Code 7. The destination host is unknown.
Code 8. The source host is isolated.
Code 9. Communication with the destination network is
administratively prohibited.
Code 10. Communication with the destination host is
administratively prohibited.
Code 11. The network is unreachable for the specified type of
service.
© CSS Corp | Confidential | www.csscorp.com 8
Destination Unreachable - Codes
• Code 12. The host is unreachable for the specified type of service.
• Code 13. The host is unreachable because the administrator has put
a filter on it.
• Code 14. The host is unreachable because the host precedence is
violated.
• Code 15. The host is unreachable because its precedence was cut
off.
© CSS Corp | Confidential | www.csscorp.com 9
Source Quench
• The source-quench message in ICMP was designed to add flow control
and congestion control to the IP.
• When a router or host discards a datagram due to congestion, it sends a
source-quench message to the sender of the datagram.
• This message has two purposes –
First, it informs the source that the datagram has been discarded.
Second, it warns the source that there is congestion somewhere in
the path and that the source should slow down (quench) the sending
process.
© CSS Corp | Confidential | www.csscorp.com 10
Time Exceeded
The time-exceeded message is generated in two cases:
• When the time-to-live value reaches 0, the datagram is discarded
and time-exceeded message is sent by the router to the original
source.
• When all fragments that make up a message do not arrive at the
destination host within a certain time limit.
© CSS Corp | Confidential | www.csscorp.com 11
Parameter Problem
• If a router or the destination host discovers an ambiguous or missing
value in any field of the datagram, it discards the datagram and sends a
parameter-problem message back to the source.
• The code field in this case specifies the reason for discarding the
datagram:
Code 0. There is an error or ambiguity in one of the header fields.
Code 1. The required part of an option is missing.
© CSS Corp | Confidential | www.csscorp.com 12
Redirection
• A redirection message is considered an error-reporting message but
the router does not discard the datagram in this case; it is sent to the
appropriate router.
• The code field for the redirection message narrows down the
redirection:
Code 0. Redirection for a network-specific route.
Code 1. Redirection for a host-specific route.
Code 2. Redirection for a network-specific route based on a
specified type of service.
Code 3. Redirection for a host-specific route based on a specified
type of service. © CSS Corp | Confidential | www.csscorp.com 13
Echo Request and Reply
• The echo-request and echo-reply messages are designed for diagnostic
purposes.
• The combination of echo-request and echo-reply messages determines
whether two systems (hosts or routers) can communicate with each
other.
• A host or router can send an echo-request message to another host or
router. The host or router that receives an echo-request message
creates an echo-reply message and returns it to the original sender.
• Echo-request and echo-reply messages can test the reachability of a
host. This is usually done by invoking the ping command.
© CSS Corp | Confidential | www.csscorp.com 14
Timestamp Request and Reply
• Two machines (hosts or routers) can use the timestamp-request
and timestamp-reply messages to determine the round-trip time
needed for an IP datagram to travel between them.
• The source creates a timestamp-request message.
• The destination creates the timestamp-reply message.
© CSS Corp | Confidential | www.csscorp.com 15
Thank You
© CSS Corp
The information contained herein is subject to change without
notice. All other trademarks mentioned herein are the property of
their respective owners.
© CSS Corp | Confidential | www.csscorp.com 16