Lecture 5
Lecture 5
(Lecture 5)
2
19.2 ICMPv4
20.3
19.2
ICMPv4
• What happens if the Cnal desFnaFon host must discard the received fragments of a datagram
because it has not received all fragments within a predetermined Fme limit?
These are examples of situaFons where an error has occurred and the IP protocol has no built-in
20.4
19.2 ICMPv4
2. The IP protocol also lacks a mechanism for host and management queries.
• A host sometimes needs to determine if a router or another host is
alive. And someFmes a network manager needs informaFon from another host or
router.
20.5
19. 2 ICMPv4
Important: ICMP messages are not passed directly to the data-link layer.
The messages are Brst encapsulated inside IP datagrams before going to the lower layer.
20.6
19.2.1
MESSAGES
ICMP messages are divided into two broad categories:
1. The error-repor2ng messages report problems that a router or a host (des2na2on)
may encounter when it processes an IP packet.
2. The query messages, which occur in pairs, help a host or a network manager get
speci?c informa2on from a router or another host.
1. For example, nodes can discover their neighbors.
2. Also, hosts can discover and learn about routers on their network and routers can
help a node redirect its messages.
20.7
Figure 19.8: General format of ICMP
messages
o
Rest of the header
20.8
19.2.1 Error Repor2ng Messages
• ICMP does not correct errors, it simply reports them. Error correcFon is leS to the higher-level
protocols. u A
I
am
• All error messages contain a data secFon that includes the IP header of the original datagram plus the
Crst 8 bytes of data in that datagram.
am
Tn
je
O
• The 8 bytes of data are included because the Crst 8 bytes provide informaFon about the port numbers
g
(UDP and TCP) and sequence number (TCP).
20.9
Figure 19.9: Contents of data field for the error messages
er
NetworkHer
85
i es
ands
ie
render
an a sow
w w.whisiax
a
20.10
19.2.1 Error Repor2ng Messages
• To make the error-reporFng process simple, ICMP follows some rules in reporFng messages.
1. No ICMP error message will be generated in response to a datagram carrying an
É
ICMP error message.
immacome
2.
É
No ICMP error message will be generated for a fragmented datagram that is not
9
the ?rst fragment.
no multig
Cost
20.11
1 Des2na2on Unreachable
C WE
G
• The most widely used error message is the desFnaFon unreachable (type 3). This message uses
diWerent codes (0 to 15) to deCne the type of error message and the reason why a datagram has not
by
reached its Cnal desFnaFon. É
i
• For example, code 0 tells source that a host is unreachable.
• This may happen, for example, when we use the HTTP protocol to access a web page, but the server is
down.
i
20.12
2 Source Quench
t.no
h at
• It is (type 4) message. W new
p
My
i six's
j
• It informs the sender that the network has encountered congesFon and the datagram has been
dropped; the source needs to slow down sending more datagrams.
G
• In other words, ICMP adds a kind of congesFon control mechanism to the IP protocol by using this type
of message.
83
20.13
3 Redirec2on Message
we I
• It is (type 5) message.
msn.sk
• Used when the source uses a wrong router to send out its message.
• The router redirects the message to the appropriate router, but informs the source that it needs to
change its default router in the future.
20.14
20.15
0
4 Time Exceeded Message
• When the TTL value becomes 0, the datagram is dropped by the visiFng router and a Fme exceeded
message with code 0 is sent to the source to inform it about the situaFon.
TTLon a
• The Fme-exceeded message (with code 1) can also be sent when not all fragments of a datagram arrive
within a predeCned period of Fme.
GM H u
20.16
5 Parameter Problem
20.17
Query Messages
• Query messages are used to probe or test the liveliness of hosts or routers in the Internet, Cnd the one-
way or the round-trip Fme for an IP datagram between two devices, or
• even Cnd out whether the clocks in two devices are synchronized.
20.18
Query Messages
• The echo request (type 8) and the echo reply (type 0) pair of messages are used by a host or a router to
test the liveliness of another host or router.
• A host or router sends an echo request message to another host or router; if the la_er is alive, it
responds with an echo reply message.
• The echo request (type 8) and the echo reply (type 0) pair of messages are used by a host or a
router to test the liveliness of another host or router.
• A host or router sends an echo request message to another host or router; if the la_er is alive, it
responds with an echo reply message.
20.20
FMI
They
Reporting
error
zi.sk s
unrecnableCoto's
pistenaition down nap regest type
type 3
server
ex
cannon
type
source
y
said
anarchy
up
co trio
ÉffetIl rode
iii
timeendedmassage.de
notaugment
time
arrivein
bcodeen optionsmissingorinterprets
problem
18.4.4 DHCP
20.21
Figure 18.25: DHCP message format
20.22
Figure 18.26: Option format
20.23
U
Figure 18.27: Operation of DHCP
e a
a
4 g
Gg
j_ is
as
ease s
an sis
a
É
ow is
spans six
20.24
as