Professional Documents
Culture Documents
Chap 09 Modified PP2003
Chap 09 Modified PP2003
Figure 9.1
Figure 9.2
ICMP encapsulation
Figure 9.4
All the ICMP messages are different. The only thing that is
common amongst all is the first 4 bytes.
Type field tells what type of message (as we saw on the
previous slide); Code field gives further information on the
type of message.
TCP/IP Protocol Suite
Figure 9.5
Error-reporting messages
Note:
The following are important points about ICMP
error messages:
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 datagram that is not the first fragment.
No ICMP error message will be generated for a
datagram having a multicast address.
No ICMP error message will be generated for a
datagram having a special address such as 127.0.0.0 or
0.0.0.0.
Figure 9.6
Destination Unreachable
When a router cannot route a datagram or a host cannot
deliver a datagram, the datagram is discarded and the router
or host sends a destination-unreachable ICMP message.
Figure 9.7
Destination-unreachable format
10
Note:
Destination-unreachable messages
with codes 2 or 3 can be created only
by the destination host. protocol unreachable ;
port unreachable
Other destination-unreachable
messages can be created only by
routers.
TCP/IP Protocol Suite
11
Figure 9.8
Source-quench format
12
Figure 9.9
13
Note:
In a time-exceeded message, code 0 is
used only by routers to show that the
value of the time-to-live field is zero.
Code 1 is used only by the destination
host to show that not all of the
fragments have arrived within a set
time.
TCP/IP Protocol Suite
14
Figure 9.10
15
16
17
Figure 9.12
18
9.4 QUERY
ICMP can also diagnose some network problems through the query
messages, a group of four different pairs of messages. In this type of
ICMP message, a node sends a message that is answered in a specific
format by the destination node.
The four different types of request and reply are:
Echo Request and Reply
Timestamp Request and Reply
Address-Mask Request and Reply
Router Solicitation and Advertisement
19
Note:
An echo-request message can be sent
by a host or router. An echo-reply
message is sent by the host or router
which receives an echo-request
message.
20
Note:
Echo-request and echo-reply messages
can be used by network managers to
check the operation of the IP protocol.
If a router returns a reply, then it and
IP are working because ICMP
messages are encapsulated in IP
datagrams.
21
Note:
Echo-request and echo-reply messages
can test the reachability of a host. This
is usually done by invoking the ping
command.
22
Figure 9.14
23
Note:
Timestamp-request and timestampreply messages can be used to
calculate the round-trip time between
a source and a destination machine
even if their clocks are not
synchronized.
TCP/IP Protocol Suite
24
Note:
The timestamp-request and timestampreply messages can be used to
synchronize two clocks in two
machines if the exact one-way time
duration is known.
25
Figure 9.15
26
Figure 9.15
27
Figure 9.16
A host may know its IP address, but may not know the
corresponding mask.
28
Figure 9.17
How does a host find out what routers are connected to its
own network? Or if those routers are functioning? It can
send out a router-solicitation message.
This can be broadcast on current network.
29
Figure 9.18
This is the reply that comes back from the previous request.
Lifetime field shows the number of seconds that the entries
are considered to be valid.
30
9.5 CHECKSUM
In ICMP the checksum is calculated over the entire message (header
and data).
31
Example 1
32
Figure 9.19
33
of
of
34
Figure 9.21
ICMP package
35