Internet Control Message Protocol ICMP 2 PDF
Internet Control Message Protocol ICMP 2 PDF
ICMP
The Context
IP-Related Protocol: ICMP
Network
ICMP IP IGMP
Layer
Network
ARP Link Layer
Access
Media
1
Internet Control Message Protocol (ICMP)
The Internet Control Message Protocol (ICMP) is used by
routers and hosts to send network control information to
each other
IP
2
ICMP Message Format
8-bit 8-bit
type code 16-bit checksum
3
ICMP Types of Messages
10
4
ICMP Error Messages
Important Points
— No ICMP error message will be generated in response to a
datagram carrying an ICMP error message
— No ICMP error message will be generated for a fragmented
12
5
ICMP Error Messages (1)
Destination Unreachable (type 3)
— When a gateway (router) cannot route a datagram (e.g., it
doesn't have an appropriate route in its local table, or it
needs to fragment and the DF bit is set), it discards the
message and returns an ICMP "destination unreachable"
message to the sending host.
13
14
6
Recall: Traceroute
Traceroute records the route that packets take
A clever use of ICMP and the TTL field
When a router receives a packet, it decrements TTL
If TTL=0, send ICMP “Time exceeded” back to sender
To determine a route
— Send a packet with TTL = 1 (hop)
— The first router discards the packet and sends ICMP “Time
occurs
15
Traceroute (contd.)
A R1 R2 R3 B
16
7
ICMP Error Messages (3)
Parameter Problem (type 12)
— When a host or gateway encounters a problem parsing an
IP datagram, it returns a parameter problem message to the
datagram's sender
Redirection (type 5)
— Sent from a router to a local host on the same network
— Informs the source of a better route to the destination
17
LAN1
R1 R2
CS Net
LAN2
18
8
ICMP Redirect Example (2)
CS Net
LAN2
19
ICMP: redirect to R1 A
CS Net
LAN2
20
9
ICMP Redirect
21
LAN1
Note: some hosts
deliberately ignore ICMP
R1 R2
Redirect messages as a
precaution against network
attacks. CS Net
LAN2
22
10
ICMP Queries
23
24
11
Ping
n Uses ICMP Echo request/reply to
— test destination reachability
— compute round trip time
25
Ping (contd.)
A R1 R2 R3 B
n Sample output:
Reply from 164.107.144.3: 48 bytes in 47 msec. TTL: 253
26
12
ICMP Echo Request / Reply Message
27
28
13
ICMP Mask Request / Reply Message
29
30
14
New ICMP Version:
ICMPv6
31
32
15
Internet Control Message Protocol ICMPv6
n ICMPv6 is more complex than ICMPv4:
— some protocols that were independent in version 4 are now part
of ICMPv6
— new messages have been added to ICMPv6 to make it more
useful
n Introduces some simplifications by eliminating obsolete
types of messages no longer in use
33
ICMPv6 Header
Type (8 bits)
— High order bit = 0 (0 – 127) indicates error message
— High-order bit = 1 (128 – 255) indicates information message.
Code ( 8 bits)
— depends on the message type
Checksum (16 bits)
— Used to detect errors in ICMP and part of IPv6
34
16
ICMPv6 Messages
35
Destination-Unreachable
Packet-Too-Big
Time-Exceeded
Parameter-Problem
36
17
ICMPv6 Error Reporting Messages
37
38
18
ICMPv6 Informational Messages
Echo-Request
Echo-Reply
Router-Solicitation
Router-Advertisement
Neighbor-Solicitation
Neighbor-Advertisement
Redirect
39
40
19
Neighbor Discovery Messages
— Neighbor-Solicitation Message
— Neighbor-Advertisement Message
41
42
20
Information Messages in ICMP (v4 vs. v6)
43
21
PMTUDv6 Overview
To enable hosts to discover the min. MTU on a path to a
particular destination.
Fragmentation in IPv6 is not performed by intermediary
routers.
The source node may fragment packets by itself only
when the path MTU is smaller than the packets to deliver
PMTUD for IPv6 uses ICMPv6 error message
— Type 2 Packet Too Big
45
46
22
How Do Hosts Know What Size to Use?
Two choices:
1. Use Default MTU
— Use the default MTU of 1280, which all physical networks must
be able to handle.
— Good choice especially for short communications or for sending
47
48
23