Introduction to Data Link Layer
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.
A communication with only three nodes
A packet at the data-link layer is normally called a frame.
Services:
Framing
Flow Control
Error Control
Congestion Control
Two Categories of Links
•Point-to-point link
•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.
Link Layer Addressing
A node with physical address 10 sends a frame to a node with physical
address 87. The two nodes are connected by a link (bus topology LAN).
As the figure shows, the computer with physical address 10 is the
sender, and the computer with physical address 87 is the receiver.
07:01:02:01:2C:4B
A 6-byte (12 hexadecimal digits) physical address.
Three Types of addresses
Some link-layer protocols define three types of addresses:
UNICAST
MULTICAST
BROADCAST.
Uni-casting means one-to-one communication.
Multi-casting means one-to-many communication.
Broadcasting means one-to-all communication.
Address Resolution Protocol (ARP)
The ARP protocol is one of the auxiliary protocols defined in
the network.
It belongs to the network layer, 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.
Position of ARP in TCP/IP protocol suite
ARP operation
ARP Packet
Data Link Control (DLC)
Framing
Organizing the bits to be carried by the physical layer is called
framing.
Data link layer needs to pack bits into frames, so that each frame is
distinguishable from another
Separate a message from one source to a destination by adding a sender
address and a destination address
Types of framing:
Fixed-size framing
No need for defining the boundaries of the frames
The size itself can be used as a delimiter. E.g: ATM-WAN
Variable-size framing
Need a way to define the end of the frame and the beginning of the next
Two approaches were used for this purpose
Character-oriented approach and
Bit -oriented approach
Character-Oriented Protocols
Frame structure
• Byte stuffing: process of adding 1 extra byte whenever there is a flag or escape
character in the text
Bit-Oriented Protocols
Frame structure
• Bit stuffing: process of adding one extra 0 whenever five consecutive 1s follow
a 0 in the data
DLC protocol
A DLC protocol can be either connectionless or connection-oriented.
Connectionless Protocol
In a connectionless protocol, there is no connection between frames. The
frames are not numbered and there is no sense of ordering. Most of the data-
link protocols for LANs are connectionless protocols.
Connection-Oriented Protocol
frames are numbered and sent in order. If they are not received in order, the
receiver needs to wait until all frames belonging to the same set are received
and then deliver them in order to the network layer.
Connection oriented protocols are rare in wired LANs, but we can see them in
some point-to-point protocols, some wireless LANs, and some WANs.
DATA-LINK LAYER PROTOCOLS
Traditionally four protocols have been defined for the data-link
layer to deal with flow and error control:
Simple protocol
Stop-and-Wait protocol
Go-Back-N and protocol
Selective-Repeat protocol
The first two protocols still are used at the data-link layer, the last two
have disappeared.
Finite State Machine
Simple Protocol
FMS
Example: Simple Protocol
Stop-and-Wait Protocol
FMS
Example: Stop-and-Wait Protocol