A Short Module On The Internet Control Message Protocol (ICMP)
A Short Module On The Internet Control Message Protocol (ICMP)
(ICMP)
1
Overview
Routing
RIP OSPF BGP PIM
2
Overview
IP payload
3
ICMP message format
bit # 0 7 8 15 16 23 24 31
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
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
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
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
8
ICMP Error message
IP datagram IP datagram
is discarded
ICMP Error
Message
9
ICMP Error message
ICMP Message
Unused (0x00000000)
10
Frequent ICMP Error message
11
Some subtypes of the “Destination Unreachable”
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