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

Lecture 6 - Networ Protocols

The document discusses address mapping, error reporting, and multicasting at the network layer. It covers topics like: - Address Resolution Protocol (ARP) which maps logical IP addresses to physical hardware addresses - Internet Control Message Protocol (ICMP) which allows nodes to report errors and includes features like ping - Internet Group Management Protocol (IGMP) which facilitates multicasting to allow nodes to join multicast groups
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Lecture 6 - Networ Protocols

The document discusses address mapping, error reporting, and multicasting at the network layer. It covers topics like: - Address Resolution Protocol (ARP) which maps logical IP addresses to physical hardware addresses - Internet Control Message Protocol (ICMP) which allows nodes to report errors and includes features like ping - Internet Group Management Protocol (IGMP) which facilitates multicasting to allow nodes to join multicast groups
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 36

Chapter 6

Network Layer:
Address Mapping,
Error Reporting,
and Multicasting
21.1
21-1 ADDRESS MAPPING

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


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

Topics discussed in this section:


Mapping Logical to Physical Address (ARP)
Mapping Physical to Logical Address

21.2
TCP/IP
Address Resolution Protocol (ARP)
• It is used to find the physical address of a host if its IP address is known
• Any time a host needs to find the physical address of another host on
its network, it follows the following :
It formats an ARP packet that includes the IP address
It broadcast it over the network
Host in possession of IP address sends station address
The IP address and station address stored in cache memory

Computer Networks 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 is unicast.

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
TCP/IP
Reverse Address Resolution Protocol (RARP)
• It allows a host to discover its IP address if it knows only its physical
address
• A host wishing to discover its IP address broadcast an RARP packet that
includes its physical address over the network
• The server returns the host’s IP address

Computer Networks 10
21-2 ICMP

The IP protocol has no error-reporting or error-


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

21.12
Note

ICMP always reports error messages to


the original source.

21.13
Figure 21.9 Error-reporting messages

21.14
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.15
Figure 21.10 Contents of data field for the error messages

21.16
Figure 21.12 Query messages

21.17
Figure 21.13 Encapsulation of ICMP query messages

21.18
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 message is divided into 16-bit (2-byte) words. The
words are added and the sum is complemented. Now the
sender can put this value in the checksum field.

21.19
Figure 21.14 Example of checksum calculation

21.20
21-3 IGMP

The IP protocol can be involved in two types of


communication: unicasting and multicasting. The
Internet Group Management Protocol (IGMP) is one
of the necessary, but not sufficient, protocols that is
involved in multicasting. IGMP is a companion to the
IP protocol.
Topics discussed in this section:
Group Management
IGMP Messages and IGMP Operation
Encapsulation
Netstat Utility
21.22
Figure 21.16 IGMP message types

21.23
Figure 21.17 IGMP message format

21.24
Table 21.1 IGMP type field

21.25
Figure 21.18 IGMP operation

21.26
Example

Imagine there are three hosts in a network, as shown in Figure. A


query message was received at time 0; the random delay time (in
tenths of seconds) for each group is shown next to the group
address. Show the sequence of report messages.

21.27
Example 21.6

Solution
The events occur in this sequence:
a. Time 12: The timer for 228.42.0.0 in host A expires,
and a membership report is sent, which is received by
the router and every host including host B which
cancels its timer for 228.42.0.0.

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.

21.28
Example 21.6 (continued)

c. Time 50: The timer for 238.71.0.0 in host B expires,


and a membership report is sent, which is received by
the router and every host.

d. Time 70: The timer for 230.43.0.0 in host C expires,


and a membership report is sent, which is received by
the router and every host including host A which
cancels its timer for 230.43.0.0.

21.29
Figure 21.20 Encapsulation of IGMP packet

21.30
Table 21.2 Destination IP addresses

21.31
Note

An Ethernet multicast physical address


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

21.32
Figure 21.21 Mapping class D to Ethernet physical address

21.33
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 43=00101011 , 14 = 00001110.
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.34
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.35
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 from the leftmost digit, resulting in
54:18:09.
b. We add the result of part a to the Ethernet multicast
starting address. The result is

21.36
21.37

You might also like