0% found this document useful (0 votes)
73 views

ch21 PDF

Uploaded by

Abhishek Dadhich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

ch21 PDF

Uploaded by

Abhishek Dadhich
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Ch t 21

Chapter
Network Layer:
Address Mapping,
Mapping
Error Reporting,
and Multicasting
21.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
21--1 ADDRESS MAPPING
21

The delivery of a packet to a host or a router requires


two levels of addressing
addressing:: logical and physical
physical.. We need
to be able to map a logical address to its corresponding
physical address and vice versa
versa.. This can be done by
using either static or dynamic mapping.
mapping.

Topics discussed in this section:


Mapping
pp g Logical
g to Physical
y Address
Mapping Physical to Logical Address

21.2
Figure
g 21.1 ARP operation

21.3
Figure 21.2 ARP packet

21.4
Figure 21.3 Encapsulation of ARP packet

21.5
Figure 21.4 Four cases using ARP

21.6
Note

An ARP request is broadcast;


an ARP reply
l is
i unicast.
i t

21.7
Example 21.1

A host with IP address 130.23.43.20 and physical address


B2:34:55:10:22:10 has a packet to send to another host
with IP address 130.23.43.25 and physical address
A4:6E:F4:59:83:AB. The two hosts are on the same
Ethernet network. Show the ARP request and reply
packets encapsulated in Ethernet frames.

Solution
Figure 21.5 shows the ARP request and reply packets.
Note that the ARP data field in this case is 28 bytes, and
that the individual addresses do not fit in the 4-byte
boundary. That is why we do not show the regular 4-byte
boundaries for these addresses.
21.8
Figure 21.5 Example 21.1, an ARP request and reply

21.9
Figure 21.6 Proxy ARP

21.10
Figure 21.7 BOOTP client and server on the same and different networks

21.11
Note

DHCP provides static and dynamic


address
dd allocation
ll ti that
th t can be
b
manual or automatic.

21.12
21--2 ICMP
21

The IP protocol has no error error--reporting or error


error--
correcting mechanism.
mechanism. The IP protocol also lacks a
mechanism for host and management queries queries.. The
Internet Control Message Protocol (ICMP) has been
designed to compensate for the above two deficiencies
deficiencies..
It is a companion to the IP protocol
protocol..
Topics discussed in this section:
Types of Messages
Message Format
Error Reporting and Query
Debugging Tools

21.13
Figure 21.8 General format of ICMP messages

21.14
Note

ICMP always reports error messages to


th original
the i i l source.

21.15
Figure 21.9 Error-reporting messages

21.16
Note

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.

21.17
Figure 21.10 Contents of data field for the error messages

21.18
Figure 21.11 Redirection concept

21.19
Figure 21.12 Query messages

21.20
Figure 21.13 Encapsulation of ICMP query messages

21.21
Example 21.2

Figure 21.14 shows an example of checksum calculation


for a simple echo-request message. We randomly chose
the identifier to be 1 and the sequence number to be 9.
The
h message is i divided
di id d into
i 16-bit
6 bi (2-byte)
( b ) words.
d The
h
words are added and the sum is complemented. Now the
sender
d can put thishi value
l in
i the
h checksum
h k fi ld
field.

21.22
Figure 21.14 Example of checksum calculation

21.23
Example 21.3

We use the ping program to test the server fhda.edu. The


result is shown on the next slide. The ping program sends
messages with sequence numbers starting from 0. For
each probe it gives us the RTT time. The TTL (time to
live) field in the IP datagram that encapsulates an ICMP
message has been set to 62. At the beginning, ping defines
the number of data bytes as 56 and the total number of
bytes as 84. Itt is obvious that if we add 8 bytes of ICMP C
header and 20 bytes of IP header to 56, the result is 84.
However,
oweve , noteote tthat
at iin eac
each pprobe
obe pi
pingg defi
defines
es tthee number
u be
of bytes as 64. This is the total number of bytes in the
ICMP ppacket ((56 + 8). )

21.24
Example 21.3 (continued)

21.25
Figure 21.15 The traceroute program operation

21.26
Example 21.4

We use the traceroute program to find the route from the


computer voyager.deanza.edu
voyager deanza edu to the server fhda.edu.
fhda edu The
following shows the result:

The unnumbered line after the command shows that the


destination is 153.18.8.1. The packet contains 38 bytes: 20
bytes of IP header, 8 bytes of UDP header, and 10 bytes of
application data. The application data are used by
traceroute to keep track of the packets.
21.27
Example 21.4 (continued)

The first line shows the first router visited. The router is
named Dcore.fhda.edu
Dcore fhda edu with IP address 153.18.31.254.
153 18 31 254
The first round-trip time was 0.995 ms, the second was
0 899 ms,
0.899 ms and the third was 0.878
0 878 ms.
ms The second line
shows the second router visited. The router is named
Dbackup fhda edu with IP address 153.18.251.4.
Dbackup.fhda.edu 153 18 251 4 The
three round-trip times are also shown. The third line
shows the destination host.
host We know that this is the
destination host because there are no more lines. The
destination host is the server fhda.edu,
fhda edu but it is named
tiptoe.fhda.edu with the IP address 153.18.8.1. The three
round-trip times are also shown.
shown
21.28
Example 21.5

In this example, we trace a longer route, the route to


xerox.com (see next slide). Here there are 17 hops
between source and destination. Note that some round-
trip
i times
i l k unusual.
look l It could
ld be
b that
h a router was too
busy to process the packet immediately.

21.29
Example 21.5 (continued)

21.30
21--3 IGMP
21

Th IP protocol
The t l can be b involved
i l d in i two
t t
types off
communication:: unicasting and multicasting
communication multicasting.. The
Internet
I t t Group
G Management
M t Protocol
P t l (IGMP) is i one
of the necessary, but not sufficient, protocols that is
involved
i l d in i multicasting
multicasting.
lti ti . IGMP is i a companion
i to t the
th
IP protocol
protocol..
Topics discussed in this section:
G oup Management
Group ge e
IGMP Messages and IGMP Operation
Encapsulation
Netstat Utility
21.31
Figure 21.16 IGMP message types

21.32
Figure 21.17 IGMP message format

21.33
Table 21.1 IGMP type field

21.34
Figure 21.18 IGMP operation

21.35
Note

In IGMP, a membership report is sent


t i
twice, one after
ft the
th other.
th

21.36
Note

The general query message does not


d fi a particular
define ti l group.

21.37
Example 21.6

Imagine there are three hosts in a network, as shown in


Figure 21.19. A query message was received at time 0; the
random delay time (in tenths of seconds) for each group
i shown
is h next to the
h group address.
dd Sh the
Show h sequence off
report messages.

Solution
Th events occur in
The i this
hi sequence:
a. Time 12: The timer for 228.42.0.0 in host A expires,
andd a membership
b hi report isi sent, which
hi h is
i received
i d by
b
the router and every host including host B which
cancels
l its
it timer
ti f 228.42.0.0.
for 228 42 0 0
21.38
Example 21.6 (continued)

b. Time 30: The timer for 225.14.0.0 in host A expires, and


a membership report is sent which is received by the
router and every host including host C which cancels its
timer for 225.14.0.0.
225 14 0 0
c. Time 50: The timer ffor 238.71.0.0 in host B expires,
p
and a membership report is sent, which is received by
the router and everyy host.
d. Time 70: The timer for 230.43.0.0 in host C expires,
andd a membership
b hi reportt is
i sent,
t which
hi h is
i received
i d by
b
the router and every host including host A which
cancels
l its
it timer
ti f 230.43.0.0.
for 230 43 0 0
21.39
Figure 21.19 Example 21.6

21.40
Figure 21.20 Encapsulation of IGMP packet

21.41
Note

The IP packet that carries an IGMP


packet
k thhas a value
l off 1 in
i its
it TTL fi
field.
ld

21.42
Table 21.2 Destination IP addresses

21.43
Figure 21.21 Mapping class D to Ethernet physical address

21.44
Note

An Ethernet multicast physical address


i in
is i the
th range
01:00:5E:00:00:00 to 01:00:5E:7F:FF:FF.

21.45
Example 21.7

Change the multicast IP address 230.43.14.7 to an


Ethernet multicast physical address.

Solution
We can do this in two steps:
a. We write the rightmost 23 bits of the IP address in
hexadecimal. This can be done by changing the
rightmost 3 bytes to hexadecimal and then subtracting
8 from the leftmost digit if it is greater than or equal to
8. In our example, the result is 2B:0E:07.

21.46
Example 21.7 (continued)

b. We add the result of part a to the starting Ethernet


multicast address, which is 01:00:5E:00:00:00. The
result is

21.47
Example 21.8

Change the multicast IP address 238.212.24.9 to an


Ethernet multicast address.
Solution
a. The rightmost 3 bytes in hexadecimal is D4:18:09. We
need to subtract 8 ffrom the leftmost
f digit,
g , resultingg in
54:18:09.
b We
b. W adddd the
h result
l off part a to the
h EEthernet
h multicast
li
starting address. The result is

21.48
Figure 21.22 Tunneling

21.49
Example 21.9

We use netstat (see next slide) with three options: -n, -r,
and -a. The -n option gives the numeric versions of IP
addresses, the -r option gives the routing table, and the -a
option
i gives
i all
ll addresses
dd ( i
(unicast andd multicast).
li ) Note
that we show only the fields relative to our discussion.
“G
“Gateway” ” defines
d fi the
h router, “Iface”
“ f ” defines
d fi the
h
interface.

Note that the multicast address is shown in color. Any


packet
k with
i h a multicast
li address
dd f
from 224 0 0 0 to
224.0.0.0
239.255.255.255 is masked and delivered to the Ethernet
i
interface.
f
21.50
Example 21.9 (continued)

21.51
21--4 ICMPv
21 ICMPv6
6

We discussed IPv
IPv66 in Chapter 20
20.. Another protocol
that has been modified in version 6 of the TCP/IP
protocol suite is ICMP (ICMPv
(ICMPv66). This new version
follows the same strategy and purposes of version 4.

Topics discussed in this section:


Error Reporting
Query

21.52
Figure 21.23 Comparison of network layers in version 4 and version 6

21.53
Table 21.3 Comparison of error-reporting messages in ICMPv4 and ICMPv6

21.54
Table 21.4 Comparison of query messages in ICMPv4 and ICMPv6

21.55

You might also like