0% found this document useful (0 votes)
17 views31 pages

CN CDT10

The Data Link Layer is the second layer of the OSI model, responsible for node-to-node message delivery and ensuring error-free data transfer. It consists of two sub-layers: Logical Link Control (LLC) for protocols and error control, and Media Access Control (MAC) for media control. Key functions include framing, physical addressing, error control, flow control, and access control, with various service types such as unacknowledged connectionless and acknowledged connection-oriented services.
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)
17 views31 pages

CN CDT10

The Data Link Layer is the second layer of the OSI model, responsible for node-to-node message delivery and ensuring error-free data transfer. It consists of two sub-layers: Logical Link Control (LLC) for protocols and error control, and Media Access Control (MAC) for media control. Key functions include framing, physical addressing, error control, flow control, and access control, with various service types such as unacknowledged connectionless and acknowledged connection-oriented services.
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/ 31

U18CS503 Computer Networks

UNIT-2
DATA LINK LAYER
Classroom Discussion Topic
W4 – L1-CDT10
Topic: Data link layer design issues

Dr. Syed Abdul Moeed


Dept of CSE
Kakatiya Institute of Technology and Science, Warangal, TS, India
• Data Link Layer is second layer of OSI Layered Model

• The data link layer is responsible for the node to node


delivery of the message.
• The main function of this layer is to make sure data
transfer is error-free from one node to another, over the
physical layer.
• When a packet arrives in a network, it is the responsibility
of DLL to transmit it to the Host using its MAC address.

Data Link Layer is divided into two sub layers :
• Logical Link Control (LLC):It deals with protocols,
flow-control, and error control
• Media Access Control (MAC):It deals with actual
control of media
• Datalink Layer lies between _____ layer and
______ layer.
• It receives data from ________ to provides
services to ________.
• DLL is responsible for transfer of datagram
from one node to other over a link to make
communication efficient and reliable in PL.
• Primary purpose is to provide error –free
data to edge nodes on same physical cable or
media.
• DLL is responsible for packaging and placing
the data on NTK Layer.
• The packet received from Network layer is
further divided into frames depending on the
frame size of NIC(Network Interface Card).
• DLL also encapsulates Sender and Receiver’s
MAC address in the header.

• The Receiver’s MAC address is obtained by


placing an ARP(Address Resolution Protocol)
request onto the wire asking “Who has that IP
address?” and the destination host will reply
with its MAC address.
OVERVIEW OF DLL
Specific responsibilities of the data link layer include framing,
addressing, flow control, error control, and media access control.

2
Functions of Data Link Layer
•Framing: Framing is a function of the data link layer. It provides a
way for a sender to transmit a set of bits that are meaningful to
the receiver. This can be accomplished by attaching special bit
patterns to the beginning and end of the frame.
•Physical addressing: After creating frames, Data link layer adds
physical addresses (MAC address) of sender and/or receiver in the
header of each frame.
•Error control: Data link layer provides the mechanism of error
control in which it detects and retransmits damaged or lost
frames.
•Flow Control: The data rate must be constant on both sides else
the data may get corrupted thus , flow control coordinates that
amount of data that can be sent before receiving
acknowledgement.
•Access control: When a single communication channel
is shared by multiple devices, MAC sub-layer of data link
layer helps to determine which device has control over
the channel at a given time.

•Packet in Data Link layer is referred as Frame.


** Data Link layer is handled by the NIC (Network
Interface Card) and device drivers of host machines.

*Switch & Bridge are Data Link Layer devices.


DLL DESIGN ISSUES
Services Provided to the Network Layer
 The network layer wants to be able to send packets to its neighbors
without worrying about the details of getting it there in one piece.
Framing
Group the physical layer bit stream into units called frames. Frames are
nothing more than "packets" or "messages". By convention, we use the
term "frames" when discussing DLL.

Error Control
 Sender checksums the frame and transmits checksum together with data.
Receiver re-computes the checksum and compares it with the received
value.

Flow Control
 Prevent a fast sender from overwhelming a slower receiver.
•the data link layer takes the packets it gets from the network layer and
encapsulates them into frames for transmission. Each frame contains a frame
header, a payload field for holding the packet, and a frame trailer

9
SERVICES PROVIDED TO THE NETWORK LAYER
 The function of the data link layer is to provide services to the network
layer. The principal service is transferring data from the network layer
on the source machine to the network layer on the destination
machine.

 The data link layer can be designed to offer various services. The
actual services offered can vary from system to system. Three
reasonable possibilities that are commonly provided are

1) Unacknowledged Connectionless service

2) Acknowledged Connectionless service

3) Acknowledged Connection-Oriented service


1
0
UNACKNOWLEDGED CONNECTIONLESS SERVICE
 Unacknowledged connectionless service consists of having the
source machine send independent frames to the destination machine
without having the destination machine acknowledge them.

 No logical connection is established beforehand or released


afterward. If a frame is lost due to noise on the line, no attempt is
made to detect the loss or recover from it in the data link layer.

 This class of service is appropriate when the error rate is very low so
that recovery is left to higher layers. It is also appropriate for real-
time traffic, such as voice, in which late data are worse than bad
data. Most LANs use unacknowledged connectionless service in the
data link layer.

1
2
ACKNOWLEDGED CONNECTIONLESS SERVICE
 When this service is offered, there are still no logical connections
used, but each frame sent is individually acknowledged.

 In this way, the sender knows whether a frame has arrived correctly.
If it has not arrived within a specified time interval, it can be sent
again.
 This service is useful over unreliable channels, such as wireless
systems.

 Adding Ack in the DLL rather than in the Network Layer is just an
optimization and not a requirement.
 If individual frames are acknowledged and transmitted, entire
packets get through much faster.
 On reliable channels, such as fiber, the overhead of a heavyweight
data link protocol may be unnecessary, but on wireless channels,
1
with their inherent unreliability, it is well worth the cost. 3
ACKNOWLEDGED CONNECTION-ORIENTED SERVICE
 Here, the source and destination machines establish a
connection before any data are transferred. Each frame sent
over the connection is numbered, and the data link layer
guarantees that each frame sent is indeed received.
Furthermore, it guarantees that each frame is received
exactly once and that all frames are received in the right
order.

 When connection-oriented service is used, transfers go


through three distinct phases.
 In the first phase, the connection is established by having both sides
initialize variables and counters needed to keep track of which frames
have been received and which ones have not.
 In the second phase, one or more frames are actually retransmitted.
 In the third and final phase, the connection is released, freeing up the
8
variables, buffers, and other resources used to maintain the
connection
PLACEMENT OF DATA LINK PROTOCOL

15
FRAMING
 DLL translates the physical layer's raw bit stream
into discrete units (messages) called frames.

 How can frame be transmitted so the receiver can


detect frame boundaries? That is, how can the
receiver recognize the start and end of a frame?
 CharacterCount
 Flag byte with Byte Stuffing
 Starting and ending flag with bit stuffing
 EncodingViolations

16
FRAMING – CHARACTER COUNT
 The first framing method uses a field in the header to specify the
number of characters in the frame. When the data link layer at the
destination sees the character count, it knows how many characters
follow and hence where the end of the frame is.

11
The trouble with this algorithm is that the count can be garbled by a
transmission error.
FRAMING – BYTE STUFFING
 Use reserved characters to indicate the start and end of a frame.
 For instance, use the two-character sequence DLE STX (Data-Link Escape,
Start of TeXt) to signal the beginning of a frame, and the sequence DLE ETX
(End of TeXt) to flag the frame's end.
 Starting and ending character stuffing, gets around the problem of
resynchronization after an error by having each frame start with the ASCII
character sequence DLE STX and end with the sequence DLE ETX.
 Problem: What happens if the two-character sequence DLE ETX
happens to appear in the frame itself?
 Solution: Use character stuffing; within the frame, replace every
occurrence of DLE with the two-character sequence DLE DLE. The
receiver reverses the processes, replacing every occurrence of DLE DLE
with a single DLE.
 Example: If the frame contained ``A B DLE D E DLE'', the characters
transmitted over the channel would be ``DLE STX A B DLE DLE D E DLE
DLE DLE ETX''.
 Disadvantage: character is the smallest unit that can be
operated on;
not all architectures are byte oriented.
20
Byte stuffing and unstuffing

• disadvantage of byte stuffing, which is that it is tied to the use of 8-bit 21


bytes. Framing can be also be done at the bit level,
FRAMING – BIT STUFFING
 This technique allows data frames to contain an arbitrary
number of bits and allows character codes with an arbitrary
number of bits per character. It works like this.
 Each frame begins and ends with a special bit pattern,
01111110 (in fact, a flag byte).
 Whenever the sender's data link layer encounters five
consecutive 1s in the data, it automatically stuffs a 0 bit into
the outgoing bit stream.
 This bit stuffing is analogous to byte stuffing

 When the receiver sees five consecutive incoming 1 bits,


followed by a 0 bit, it automatically destuffs (i.e., deletes) the 0
bit
22
Bit stuffing and unstuffing

24
BIT STUFFING EXAMPLE

25
PHYSICAL LAYER CODING VIOLATIONS
 This Framing Method is used only in those networks in which
Encoding on the Physical Medium contains some redundancy.
 Some LANs encode each bit of data by using two Physical Bits
i.e. Manchester coding is Used. Here, Bit 1 is encoded into high-
low(10) pair and Bit 0 is encoded into low-high(01) pair.
 this scheme means that every data bit has a transition in the middle,
making it easy for the receiver to locate the bit boundaries. The
combinations high-high and low-low are not used for data but are
used for delimiting frames in some protocols.
Reflection Spot-1
1Q. The functions of a Logical Link Control Layer (LLC) are ___.
A) Error control
B) Flow control
C) Creating and managing the communication link between
two devices with the help of the Transport layer.
D) All the above
Ans:D
2Q. The two sub-layers of a Data Link layer are ___.
A) LLC - Logical Link Control Layer
B) MAC - Medium Access Control Layer
C) Both A and B
D) Data Layer
Ans:C
3Q. The physical address to each machine is provided by which layer
in an OSI reference model?
A) Physical layer
B) Data Link Layer
C) Network Layer
D) Transport Layer
Ans:B
Lecture Outcomes (LOs)
After completion of this lecture, students will be
able to…
LO1. understand design issues of data link
layer
Lecture Level practice Problems (LLPs)
LLP1 (based on LO1)
1Q.What are the two 2 basic services of the data link layer?
1. Allows the upper layers to access the media using techniques such as framing.
2. Controls how data is placed onto the media and is received from the media using
techniques such as media access control and error detection.
2Q. What is the difference between network layer and data
link layer?
Network layer: Handles the routing and sending of data between different
networks. The most important protocols at this layer are IP and ICMP.
2. Data link layer: Handles communications between devices on the same
network.
3Q.What are the 4 functions of data link layer?
At the sender's side, DLL receives packets from the Network layer
divides them into small frames
sends each frame bit-by-bit to the physical layer.
It also attaches some special bits (for error control and addressing) at the header
and end of the frame.
Further Reading

1. Textbook: Andrew S.Tannenbaum, David J.Wetherall,


Computer Netwrks, 5th ed. London: Pearson, 2013.
• Reading:
• Chapter -3; Topic:
• 3.1.1 to 3: Data Link layer
THANK YOU

You might also like