Академический Документы
Профессиональный Документы
Культура Документы
ICMP basics
ICMP : Internet Control Message Protocol
Basically ICMP is an error reporting mechanism.
ICMP is provided within IP which generates error messages to
help IP layers (best effort delivery).
there are two versions ICMPv4 and ICMPv6 corresponding to
IPv4 and IPv6.
ICMP basics
Need of ICMP
Message format
Types and classes of ICMP messages
ICMPv6 vs. ICMPv4
Some ICMPv6 messages
Function of ICMP
a node recognizes a transmission problem (TTL exceed, destination
unreachable, etc.) and generates ICMP messages
ICMP provides some useful diagnostics about network operation (ping,
traceroute)
OPM
OPM
Destination unreachable
Time exceeded, TTL hits 0
Parameter problem, bad header field
Source quench, throttling mechanism rarely used
Redirect, feedback on potential bad route
Echo Request and Echo reply, ping
Timestamp request and Timestamp reply, delay performance
ICMP Encapsulation
OPM
ICMP Header
0
1516
31
Indicateerrorproblems
Type
Containprotocol
indicateICMP
Code
Type:8bits
Code:8bits
Checksum:16bits
Contentspecifictotypeandcodevalues
IPheader
IPData
Frameheader
e.g.Ethernet
FrameData
OPM
OPM
3/3/2015
http://www.iana.org/assignments/icmp-parameters
Type
Code
Meaning
network unreachable
host is unreachable
port is unreachable
source quench
Redirect path
11
Time Exceeded
9/10
router discovery/advertisement
12
Parameter Problem
11
time exceed
13
Timestamp
12
parameter problem
14
Timestamp Reply
13/14
15
Information Request
17/18
network request/reply
16
Information Reply
OPM
Type
---17
18
19
20-29
Type Name
---- ------------------------0
Echo Reply
1
Unassigned
2
Unassigned
3
Destination Unreachable
4
Source Quench
5
Redirect
6
Alternate Host Address
7
Unassigned
8
Echo
9
Router Advertisement
10
Router Solicitation
30
31
32
33
34
35
36
37
38
39
40
41-255
Name
------------------------Address Mask Request
Address Mask Reply
Reserved (for Security)
Reserved (for Robustness Experiment)
Traceroute
Datagram Conversion Error
Mobile Host Redirect
IPv6 Where-Are-You
IPv6 I-Am-Here
Mobile Registration Request
Mobile Registration Reply
Domain Name Request
Domain Name Reply
SKIP
Photuris
Reserved now used in ICMPv6
OPM
http://www.iana.org/assignments/icmp-parameters
Codes
Codes 2 and 3 are created only by the
0 Network Unreachable
Destination Host, all others are created only by
1 Host Unreachable
routers.
2 Protocol Unreachable
3 Port Unreachable
4 Fragmentation Needed and Don't Fragment was Set
5 Source Route Failed
6 Destination Network Unknown
7 Destination Host Unknown
8 Source Host Isolated
9 Communication with Destination Network is Administratively Prohibited
10 Communication with Destination Host is Administratively Prohibited
11 Destination Network Unreachable for Type of Service
12 Destination Host Unreachable for Type of Service
13 Communication Administratively Prohibited
14 Host Precedence Violation
15 Precedence cutoff in effect
OPM
Reply
OPM
10
ICMP request message with type 0 is sent from source to other network
devices.
Time information
Connection reliability
Destination Unreachable
ICMP reply eco message with type 8 is sent form a router or destination
to source
Type=0or8
code
checksum
identifier
Sequencenumber
Optionaldata
OPM
11
OPM
12
3/3/2015
code
checksum
Type=4
code
unused
Unused(mustbe0)
IPheader+64bitsoforiginaldata
OPM
checksum
IPheader+64bitsoforiginaldata
13
OPM
ICMP source-quench
messages
14
code
checksum
IPaddressofamoresuitablerouter
IPheader+64bitsoforiginaldata
Remember, TCP/IP uses TCP mechanisms for flow control and reliability
including sliding windows.
OPM
OPM
15
Code
Checksum
Unused
16
Internetheader&8bytesofdata
Whenahostonthenetworkboots,andthehosthasnotbeenmanuallyconfigured
withadefaultgateway,itcanlearnofavailableroutersthroughtheprocessofrouter
discovery.
Thisprocessbeginswiththehostsendingaroutersolicitationmessagetoallrouters,
usingthemulticastaddress224.0.0.2asthedestinationaddress.(Mayalsobe
broadcast).
Whenarouterthatsupportsthediscoveryprocessreceivestherouterdiscovery
message,arouteradvertisementissentinreturn.
Routersmayalsoperiodicallyadvertiserouteradvertisementmessages.
OPM
17
OPM
18
3/3/2015
Type = 13 / 14
Type = 13 / 14
TheTCP/IPprotocolsuiteallowssystemstoconnecttooneanotherovervast
distancesthroughmultiplenetworks.
Eachoftheseindividualnetworksprovidesclocksynchronizationinitsownway.
Asaresult,hostsondifferentnetworkswhoaretryingtocommunicateusing
softwarethatrequirestimesynchronizationcansometimesencounter
problems.
TheICMPtimestampmessagetypeisdesignedtohelpalleviatethisproblem.
TheICMPtimestamprequestmessageallowsahosttoaskforthecurrenttime
accordingtotheremotehost.
TheremotehostusesanICMPtimestampreplymessagetorespondtothe
request.
AllICMPtimestampreplymessagescontaintheoriginate,receiveandtransmit
timestamps.
Usingthesethreetimestamps,thehostcanestimatetransittimeacrossthe
networkbysubtractingtheoriginatetimefromthetransittime.
Itisonlyanestimatehowever,astruetransittimecanvarywidelybasedontraffic
andcongestiononthenetwork.
Thehostthatoriginatedthetimestamprequestcanalsoestimatethelocaltimeon
theremotecomputer.
WhileICMPtimestampmessagesprovideasimplewaytoestimatetimeona
remotehostandtotalnetworktransittime,thisisnotthebestwaytoobtainthis
information.
Instead,morerobustprotocolssuchasNetworkTimeProtocol(NTP)attheupper
layersoftheTCP/IPprotocolstackperformclocksynchronizationinamorereliable
manner.
OPM
20
OPM
19
Address Masks
Thisnewsubnetmaskiscrucialinidentifyingnetwork,subnet,andhostbits
inanIPaddress.
Ifahostdoesnotknowthesubnetmask,itmaysendanaddressmask
requesttothelocalrouter.
Iftheaddressoftherouterisknown,thisrequestmaybesentdirectlytothe
router.
Otherwise,therequestwillbebroadcast.
Whentherouterreceivestherequest,itwillrespondwithanaddressmask
reply.
Somewhatobsolete,wasusedwithdisklessworkstationsthatusedRARPfor
theIPaddressandICMPforthesubnetmask.NowDHCPisusedtoknow
subnetmaskofanetwork.
OPM
21
OPM
22
Problem:
How path MTU discovery (PMTU-D) combined with filtering ICMP
messages can result in connectivity problems.
Path MTU discovery allows a node to dynamically discover and adjust to
differences in the MTU size of every link along a given data path.
In IPv4, the minimum link MTU size is 68 octets and the recommended
minimum is 576 octets, which is the minimum reassembly buffer size.
So, any IPv4 packet must be at least 68 octets in length.
(In IPv6, the minimum link MTU is 1280 octets, but the recommended MTU value for IPv6 links is
1500 octets. The maximum packet size supported by the basic IPv6 header is 64,000 octets.
Larger packets called jumbograms could be handled using a hop-by-hop extension header
option.)
OPM
24
3/3/2015
MTU-Discovery
A host does this by starting by sending packets that have a maximum size of the
lesser of the local MTU or the MSS announced by the remote system.
These packets are sent with the DF bit set.
If there is some MTU between the two hosts which is too small to pass the
packet successfully, then an ICMP can't fragment error will be sent back to the
source.
It will then know to lower the size; if the ICMP message includes the next hop
MTU, it can pick the correct size for that link immediately, otherwise it has to
guess.
OPM
25
OPM
26
ICMPv6
ICMPv6 Types
OPM
27
OPM
28
OPM
30
Router-solicitation message
OPM
29
3/3/2015
Router-advertisement message
Neighbor-solicitation message
OPM
31
OPM
32
Redirection message
Type: 137
16
Code: 0
31
Checksum
Reserved
Options
OPM
33
Inverse-neighbor-solicitation message
OPM
OPM
34
Inverse-neighbor-advertisement message
35
OPM
36
3/3/2015
OPM
37
OPM
38
OPM
39