0% found this document useful (0 votes)
54 views13 pages

A Short Module On The Internet Control Message Protocol (ICMP)

ICMP is a protocol that supports IP by providing error reporting and simple queries. It allows hosts and routers to send error messages and query messages like ping. Some key ICMP message types include Echo Request/Reply for ping, Timestamp Request/Reply, and Destination Unreachable for error reporting. ICMP messages are encapsulated in IP datagrams and include fields for type, code, checksum and optional data.

Uploaded by

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

A Short Module On The Internet Control Message Protocol (ICMP)

ICMP is a protocol that supports IP by providing error reporting and simple queries. It allows hosts and routers to send error messages and query messages like ping. Some key ICMP message types include Echo Request/Reply for ping, Timestamp Request/Reply, and Destination Unreachable for error reporting. ICMP messages are encapsulated in IP datagrams and include fields for type, code, checksum and optional data.

Uploaded by

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

Internet Control Message Protocol

(ICMP)

A short module on the Internet Control Message Protocol (ICMP).

1
Overview

• The IP (Internet Protocol) relies on several other protocols to


perform necessary control and routing functions:
• Control functions (ICMP)
• Multicast signaling (IGMP)
• Setting up routing tables (RIP, OSPF, BGP, PIM, …)

Routing
RIP OSPF BGP PIM

ICMP IGMP Control

2
Overview

• The Internet Control Message Protocol (ICMP) is a


helper protocol that supports IP with facility for
– Error reporting
– Simple queries

• ICMP messages are encapsulated as IP datagrams:

IP header ICMP message

IP payload

3
ICMP message format

bit # 0 7 8 15 16 23 24 31

type code checksum

additional information
or
0x00000000

4 byte header:
• Type (1 byte): type of ICMP message
• Code (1 byte): subtype of ICMP message
• Checksum (2 bytes): similar to IP header checksum.
Checksum is calculated over entire ICMP message
If there is no additional data, there are 4 bytes set to zero.
 each ICMP messages is at least 8 bytes long
4
ICMP Query message

ICMP Request

ICMP Reply

Host Host or router

ICMP query:
• Request sent by host to a router or host
• Reply sent back to querying host

5
Example of ICMP Queries
Type/Code: Description

8/0 Echo Request


0/0 Echo Reply

13/0 Timestamp Request


14/0 Timestamp Reply

10/0
9/0
Router Solicitation
Router Advertisement The ping command
uses Echo Request/
Echo Reply

6
Example of a Query:
Echo Request and Reply

• Ping’s are handled directly by the kernel


• Each Ping is translated into an ICMP Echo Request
• The Ping’ed host responds with an ICMP Echo Reply

ICMP ECH
O REQUES
T
Host Host
or or
Router Y router
R E PL
M P ECHO
IC

7
Example of a Query:
ICMP Timestamp
• A system (host or router) asks Sender
Timestamp
Request
another system for the current time.
• Time is measured in milliseconds Receiver

after midnight UTC (Universal


Timestamp
Coordinated Time) of the current Reply
day
• Sender sends a request, receiver
responds with reply
Type Code
Checksum
(= 17 or 18) (=0)
identifier sequence number

32-bit sender timestamp

32-bit receive timestamp

32-bit transmit timestamp

8
ICMP Error message

IP datagram IP datagram
is discarded
ICMP Error
Message

Host Host or router

• ICMP error messages report error conditions


• Typically sent when a datagram is discarded
• Error message is often passed from ICMP to the
application program

9
ICMP Error message
ICMP Message

from IP datagram that triggered the error

IP header ICMP header IP header 8 bytes of payload

type code checksum

Unused (0x00000000)

• ICMP error messages include the complete IP header and


the first 8 bytes of the payload (typically: UDP, TCP)

10
Frequent ICMP Error message

Type Code Description

3 0–15 Destination Notification that an IP datagram could not be


unreachable forwarded and was dropped. The code field
contains an explanation.
5 0–3 Redirect Informs about an alternative route for the
datagram and should result in a routing table
update. The code field explains the reason for
the route change.
11 0, 1 Time Sent when the TTL field has reached zero
exceeded (Code 0) or when there is a timeout for the
reassembly of segments (Code 1)
12 0, 1 Parameter Sent when the IP header is invalid (Code 0) or
problem when an IP header option is missing (Code 1)

11
Some subtypes of the “Destination Unreachable”

Code Description Reason for Sending


0 Network No routing table entry is available for the destination
Unreachable network.
1 Host Destination host should be directly reachable, but
Unreachable does not respond to ARP Requests.
2 Protocol The protocol in the protocol field of the IP header is
Unreachable not supported at the destination.
3 Port The transport protocol at the destination host cannot
Unreachable pass the datagram to an application.
4 Fragmentation IP datagram must be fragmented, but the DF bit in the
Needed IP header is set.
and DF Bit Set

12
Example: ICMP Port Unreachable
• RFC 792: If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is
not active, the destination host may send a destination unreachable message to the source host.
• Scenario:

Request
a
service
No process
at a por
t 80 is waiting
at port 80
Client Server

t e
Por achabl
e
Unr

13

You might also like