Chapter 9 Introduction To Data Link Layer
Chapter 9 Introduction To Data Link Layer
•Framing
•Flow Control
•Error Control
•Congestion Control
Framing
A3:34:45:11:92:F1
Example 9.2
The multicast link-layer addresses in the most common
LAN, Ethernet, are 48 bits (six bytes) that are presented as
12 hexadecimal digits separated by colons. The second digit,
however, needs to be an even number in hexadecimal. The
following shows a multicast address:
A2:34:45:11:92:F1
Example 9.3
The broadcast link-layer addresses in the most common
LAN, Ethernet, are 48 bits, all 1s, that are presented as 12
hexadecimal digits separated by colons. The following
shows a broadcast address:
ARP (Address Resolution Protocol)
• Anytime a node has an IP datagram to send to another node in a link, it has
the IP address of the receiving node.
• The source host knows the IP address of the default router.
• Each router except the last one in the path gets the IP address of the next
router by using its forwarding table.
• The last router knows the IP address of the destination host.
• However, the IP address of the next node is not helpful in moving a frame
through a link; we need the link-layer address of the next node.
• This is the time when the Address Resolution Protocol (ARP) becomes
helpful. The ARP protocol is one of the auxiliary protocols defined in the
network layer
• It belongs to the network layer, but we discuss it in this chapter because it
maps an IP address to a logical-link address.
• ARP accepts an IP address from the IP protocol, maps the address to the
corresponding link-layer address, and passes it to the data-link layer.
Figure 9.6: Position of ARP in TCP/IP protocol suite
ARP Operation
• Let us assume that there are 20 systems connected to the network (link):
system A, system B, and 18 other systems. We also assume that system A
has 10 datagrams to send to system B in one second.
• a. Without using ARP, system A needs to send 10 broadcast frames. Each of
the 18 other systems need to receive the frames, decapsulate the frames,
remove the datagram and pass it to their network-layer to find out the
datagrams do not belong to them. This means processing and discarding 180
broadcast frames.
• b. Using ARP, system A needs to send only one broadcast frame. Each of the
18 other systems need to receive the frames, decapsulate the frames, remove
the ARP message and pass the message to their ARP protocol to find that the
frame must be discarded. This means processing and discarding only 18
(instead of 180) broadcast frames. After system B responds with its own
data-link address, system A can store the link-layer address in its cache
memory. The rest of the nine frames are only unicast. Since processing
broadcast frames is expensive (time consuming), the first method is
preferable.
ARP Packet Format
• The hardware type field defines the type of the link-layer protocol: Ethernet
is given the type 1.
• The protocol type field defines the network-layer protocol: IPv4 protocol is
(0800)16.
• The source hardware and source protocol addresses are variable-length fields
defining the link-layer and network-layer addresses of the sender.
• The destination hardware address and destination protocol address fields
define the receiver link-layer and network-layer addresses.
• An ARP packet is encapsulated directly into a data-link frame.
• The frame needs to have a field to show that the payload belongs to the ARP
and not to the network-layer datagram.
Figure 9.8: ARP packet Format
Example 9.4
A host with IP address N1 and MAC address L1 has a
packet to send to another host with IP address N2 and
physical address L2 (which is unknown to the first host).
The two hosts are on the same network. Figure 9.9 shows
the ARP request and response messages.
Figure 9.9: Example 9.4
An Example of Communication
• To show how communication is done at the data-link layer and how link-
layer addresses are found, we will go through a simple example:
• Assume Alice needs to send a datagram to Bob, who is three nodes away in
the Internet. How Alice could finds the network-layer address of Bob using
DNS.
Figure 9.10: The internet for our example
Figure 9.11: Flow of packets at Alice site
Figure 9.12: Flow of activities at router R1
Figure 9.13: Flow of activities at router R2
Figure 9.14: Activities at Bob’s site