Chapter 9
Chapter 9
The first node is the source host; the last node is the destination host.
The other four nodes are four routers.
The first, the third, and the fifth links represent the three LANs; the second and the fourth links represent
the two WANs.
Services
The data-link layer is located between the physical and the network layers.
The duty scope of the data-link layer is node-to-node.
When a packet is travelling in the Internet, the data-link layer of a node (host or router) is responsible
for delivering a datagram to the next node in the path.
the data-link layer of the sending node needs to encapsulate the datagram received from the network in
a frame, and the data-link layer of the receiving node needs to decapsulate the datagram from the frame.
the data-link layer of the source host needs only to encapsulate, the data-link layer of the destination
host needs to decapsulate, but each intermediate node needs to both encapsulate and decapsulate
Flow Control
we have a producer and a consumer, we need to think about flow control. If the producer produces
items that cannot be consumed, accumulation of items occurs.
The sending data-link layer at the end of a link is a producer of frames; the receiving data-link layer at
the other end of a link is a consumer.
If the rate of produced frames is higher than the rate of consumed frames, frames at the receiving end
need to be buffered while waiting to be consumed (processed).
Definitely, we cannot have an unlimited buffer size at the receiving side. We have two choices.
The first choice is to let the receiving data-link layer drop the frames if its buffer is full.
The second choice is to let the receiving data-link layer send a feedback to the sending data-link layer
to ask it to stop or slow down.
Error Control
At the sending node, a frame in a data-link layer needs to be changed to bits, transformed to
electromagnetic signals, and transmitted through the transmission media.
At the receiving node, electromagnetic signals are received, transformed to bits, and put together to
create a frame.
Since electromagnetic signals are susceptible to error, a frame is susceptible to error.
The error needs first to be detected. After detection, it needs to be either corrected at the receiver node
or discarded and retransmitted by the sending node.
error detection nd correction is an issue in every layer (node-to node or host-to-host)
Congestion Control
a link may be congested with frames, which may result in frame loss,
most data-link-layer protocols do not directly use a congestion control to alleviate congestion,
congestion control is considered an issue in the network layer or the transport layer because of its end-
to-end nature.
Two Categories of Links
two nodes are physically connected by a transmission medium such as cable or air.
We can have a data-link layer that uses the whole capacity of the medium; or a data-link layer that uses
only part of the capacity of the link.
we can have a point-to-point link or a broadcast link.
In a point-to-point link, the link is dedicated to the two devices;
In a broadcast link, the link is shared between several pairs of devices.
For example, when two friends use the traditional home phones to chat, they are using a point-to-point
link;
when the same two friends use their cellular phones, they are using a broadcast link (the air is shared
among many cell phone users).
Two Sublayers
we can divide the data-link layer into two sublayers: data link control (DLC) and media access
control (MAC).
The data link control sublayer deals with all issues common to both point-to-point and broadcast links;
the media access control sublayer deals only with issues specific to broadcast links.
we separate these two types of links at the data-link layer
Three Types of addresses
three types of addresses: unicast, multicast, and broadcast.
Unicast Address
Each host or each interface of a router is assigned a unicast address.
Unicasting means one-to-one communication. A frame with a unicast address destination is destined
only for one entity in the link.
Multicast Address
Some link-layer protocols define multicast addresses.
Multicasting means one-to-many communication.
Broadcast Address
Broadcasting means one-to-all communication.
A frame with a destination broadcast address is sent to all entities in the link.
Address Resolution Protocol (ARP)
a node has an IP datagram to send to another node in a link.
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.
we need the link-layer address of the next node. This is the time when the Address Resolution
Protocol (ARP) becomes helpful.
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.
a host or a router needs to find the link-layer address of another host or router in its network, it sends an
ARP request packet.
The packet includes the link-layer and IP addresses of the sender and the IP address of the receiver.
Because the sender does not know the link-layer address of the receiver, the query is broadcast over the
link using the link-layer broadcast address.
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.