SlideShare a Scribd company logo
FRAMING
Byte Stuffing
Byte stuffing is the process of adding 1 extra byte whenever there is a
flag or escape character in the text.
Bit Stuffing
In bit stuffing, extra bits are being added by network protocol designers
to data streams.
It is generally insertion or addition of extra bits into transmission unit or
message to be transmitted as simple way to provide and give signaling
information and data to receiver
It is type of protocol management simply performed to break up bit
pattern that results in transmission to go out of synchronization.
Each frame begins and ends with a special bit pattern called flag byte
[01111110].
Whenever the sender data link layer encounters five consecutive ones in
the data stream, it automatically stuffs a 0 bit in to the outgoing stream.
When the receiver sees five consecutive incoming ones followed by a 0
bit, it automatically destuffs the 0 bit before sending the data to the
network layer.
Physical Layer Coding Violations
Encoding violation is method that is used only for network in which
encoding on physical medium includes some sort of redundancy
Encoding of bits as signals includes redundancy. Some bit patterns will
never occur as regular data.
Ex. 4B/5B: 4 data bits (16 combinations) mapped to 5 data bits (32
combinations). Here we are representing 16 combinations, so 32-16=16
i.e., there are 16 five bit patterns which are never used as data and they
are redundant. So this means that these redundant bit patterns can be
used for other purposes.
Advantage:
Easy to distinguish from actual data i.e., easy to find start and end of each
frame.
This technique is the only one that does not require any kind of bit or
byte stuffing.
FLOW AND ERROR CONTROL
The most important responsibilities of the data link layer are flow control
and error control. Collectively, these functions are known as data link
control.
Error Control
The error frames are dropped by the receiver and acknowledgement are
not sent.
Error control in the data link layer is based on automatic repeat request,
which is the retransmission of data. The Acknowledgment (ACK) used for
reliable delivery.
If frame or ACK is lost, no ACK is sent to sender. In this case Sender uses
timer to react with average round trip time (RTT) to retransmit the frame.
If ACK is lost, receiver receives multiple copies of same frame. To identify
multiple copies and remove the duplicated copies of the frame, sequence
number is used in the frames.
Flow Control
This refers to a set of procedures used to restrict the amount of data that
the sender can send before waiting for acknowledgment.
In data link layer, flow control restricts the number of frames the sender
can send before it waits for an acknowledgment from the receiver.
Two approaches are commonly used.
Feedback based Flow Control - the sender sends frames after it has
received acknowledgments from the user. This is used in the data link
layer.
Rate based Flow Control - These protocols have built in mechanisms to
restrict the rate of transmission of data without requiring
acknowledgment from the receiver. Used in the network layer and the
transport layer.
PROTOCOLS
Data link layer can combine framing, flow control, and error control to
achieve the delivery of data from one node to another.
NOISELESS CHANNELS
An ideal channel in which no frames are lost, duplicated, or corrupted.
We introduce two protocols for this type of channel.
Traditionally four protocols have been defined for the data-link layer to
deal with flow and error control: Simple, Stop-and-Wait, Go-Back-N, and
Selective Repeat. Although the first two protocols still are used at the
data-link layer, the last two have disappeared.
Simple Protocol
This is a simple protocol with neither flow nor error control.
The data-link layer at the sender gets a packet from its network layer,
makes a frame out of it, and sends the frame. The data-link layer at the
receiver receives a frame from the link, extracts the packet from the
frame, and delivers the packet to its network layer.
The data-link layers
of the sender and
receiver provide
transmission services
for their network
layers.
Stop-and-Wait Protocol
It is still very simple. The sender sends one frame and waits for feedback
from the receiver. When the ACK arrives, the sender sends the next
frame.
Note that sending
two frames in the
protocol involves
the sender in four
events and the
receiver in two
events.
1. Problems due to lost data
Sender waits for ACK for an infinite amount time
Receiver waits for data for an infinite amount of time
2. Problems due to lost ACK
Sender waits for an infinite amount of time for ACK
3. Problems due to delayed ACK/data
After timeout on sender side, a delayed ACK might be wrongly
considered as ACK of some other frame.
Sender side
Rule 1: Send one frame at a time.
Rule 2: Send the next frame only after receiving ACK for the previous
Receiver side
Rule 1: Receive and consume frame
Rule 2: After consuming frame, ACK need to be sent (Flow Control)
NOISY CHANNELS
Although the Stop-and-Wait Protocol gives us an idea of how to add flow
control to its predecessor, noiseless channels are nonexistent.
Stop-and-Wait Automatic Repeat Request
Idea of stop-and-wait ARQ is straightforward. After transmitting one
frame, the sender waits for and acknowledgement before transmitting
the next frame.
But there are chances for the frame to be lost or ACK to be lost. If the
ACK does not arrive after certain period of time, the sender times out
and retransmits the original frame. This retransmission is automatic and
that is why we call this as automatic repeat request protocol.
Stop-and-wait ARQ = Stop-and-wait + Timeout Timer + Sequence number
Error correction in Stop-and-Wait ARQ
is done by keeping a copy of the sent
frame and retransmitting of the frame
when the timer expires.
Drawbacks
 One frame at a time
 Poor utilization of bandwidth
 Poor performance
Data Link Layer_Data Communications&Computer Neworks.pptx
Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the line is
1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the
bandwidth-delay product? If the system data frames are 1000 bits in
length, what is the utilization percentage of the link?
The bandwidth-delay product is: 1Mbps x 20ms = 20,000 bits
The system can send 20,000 bits during the time it takes for the data to
go from the sender to the receiver and then back again. However, the
system sends only 1000 bits. We can say that the link utilization is only
1000/20,000, or 5 percent. For this reason, for a link with a high
bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the
capacity of the link.
Sliding Window Protocol
Send multiple frames at a time. Number of frames to be sent is based on
Window size. Each frame is numbered i.e., sequence number
Assignment of sequence numbers to frames is between the range 0 to
2n-1 if the frames’ sequence number is an n-bit field. As a result, the
sending window has a size of 2n-1.
Modulo-n is used to number the sequence numbers. If the sending
window size is set as 3, the sequence numbers will be 0, 1, 2, 0, 1, 2, 0,
1, 2 and so on.
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx
Data Link Layer_Data Communications&Computer Neworks.pptx

More Related Content

PDF
PPTX
Data Link layer in computer netwroks.pptx
PPTX
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
PPTX
Data Communication Unit - II Data Link Layer.pptx
PPTX
Unit 2
PPTX
Computer networks unit three presentation
PDF
datalinklayermukesh
PPTX
Data link layer
Data Link layer in computer netwroks.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
Data Communication Unit - II Data Link Layer.pptx
Unit 2
Computer networks unit three presentation
datalinklayermukesh
Data link layer

Similar to Data Link Layer_Data Communications&Computer Neworks.pptx (20)

PPTX
datalinklayermukesh-150130061041-conversion-gate01.pptx
PPTX
Unit 3 - Data Link Layer - Part A
PPTX
III_UNIT.pptx
PPTX
III_UNIT.pptx
PDF
Nigga.pdf
PPT
computer_network_completenotes_unit2.ppt
PPTX
Unit 2 data link control
PPT
III_UNIT.ppt
PPT
09 Data Link LayerFlow Control.ppt
PPT
DataLinkControl.ppt
PPTX
Data link layer
PPTX
Data communication network ppt_Unit_4.pptx
PDF
CN R16 -UNIT-3.pdf
PPTX
Data link control & protocol concepts
PPT
Unit 2 ppt 3.ppt
PPTX
Computer Networks (Computer Engineering) Unit-3 Data Link Layer & its Protoco...
PPT
CN_unit2.ppt Data Link Layer characteristics, categories
PDF
Data Communication and Computer Networks unit 2
PPT
Data link layer
PPTX
Computer network
datalinklayermukesh-150130061041-conversion-gate01.pptx
Unit 3 - Data Link Layer - Part A
III_UNIT.pptx
III_UNIT.pptx
Nigga.pdf
computer_network_completenotes_unit2.ppt
Unit 2 data link control
III_UNIT.ppt
09 Data Link LayerFlow Control.ppt
DataLinkControl.ppt
Data link layer
Data communication network ppt_Unit_4.pptx
CN R16 -UNIT-3.pdf
Data link control & protocol concepts
Unit 2 ppt 3.ppt
Computer Networks (Computer Engineering) Unit-3 Data Link Layer & its Protoco...
CN_unit2.ppt Data Link Layer characteristics, categories
Data Communication and Computer Networks unit 2
Data link layer
Computer network
Ad

Recently uploaded (20)

PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
Total quality management ppt for engineering students
PPTX
UNIT - 3 Total quality Management .pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
PPT on Performance Review to get promotions
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
737-MAX_SRG.pdf student reference guides
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
Artificial Intelligence
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
introduction to high performance computing
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Information Storage and Retrieval Techniques Unit III
Nature of X-rays, X- Ray Equipment, Fluoroscopy
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Total quality management ppt for engineering students
UNIT - 3 Total quality Management .pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT on Performance Review to get promotions
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
737-MAX_SRG.pdf student reference guides
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Artificial Intelligence
R24 SURVEYING LAB MANUAL for civil enggi
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Safety Seminar civil to be ensured for safe working.
introduction to high performance computing
Categorization of Factors Affecting Classification Algorithms Selection
Information Storage and Retrieval Techniques Unit III
Ad

Data Link Layer_Data Communications&Computer Neworks.pptx

  • 2. Byte Stuffing Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text.
  • 3. Bit Stuffing In bit stuffing, extra bits are being added by network protocol designers to data streams. It is generally insertion or addition of extra bits into transmission unit or message to be transmitted as simple way to provide and give signaling information and data to receiver It is type of protocol management simply performed to break up bit pattern that results in transmission to go out of synchronization.
  • 4. Each frame begins and ends with a special bit pattern called flag byte [01111110]. Whenever the sender data link layer encounters five consecutive ones in the data stream, it automatically stuffs a 0 bit in to the outgoing stream. When the receiver sees five consecutive incoming ones followed by a 0 bit, it automatically destuffs the 0 bit before sending the data to the network layer.
  • 5. Physical Layer Coding Violations Encoding violation is method that is used only for network in which encoding on physical medium includes some sort of redundancy Encoding of bits as signals includes redundancy. Some bit patterns will never occur as regular data. Ex. 4B/5B: 4 data bits (16 combinations) mapped to 5 data bits (32 combinations). Here we are representing 16 combinations, so 32-16=16 i.e., there are 16 five bit patterns which are never used as data and they are redundant. So this means that these redundant bit patterns can be used for other purposes. Advantage: Easy to distinguish from actual data i.e., easy to find start and end of each frame. This technique is the only one that does not require any kind of bit or byte stuffing.
  • 6. FLOW AND ERROR CONTROL
  • 7. The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data link control. Error Control The error frames are dropped by the receiver and acknowledgement are not sent. Error control in the data link layer is based on automatic repeat request, which is the retransmission of data. The Acknowledgment (ACK) used for reliable delivery. If frame or ACK is lost, no ACK is sent to sender. In this case Sender uses timer to react with average round trip time (RTT) to retransmit the frame. If ACK is lost, receiver receives multiple copies of same frame. To identify multiple copies and remove the duplicated copies of the frame, sequence number is used in the frames.
  • 8. Flow Control This refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment. In data link layer, flow control restricts the number of frames the sender can send before it waits for an acknowledgment from the receiver. Two approaches are commonly used. Feedback based Flow Control - the sender sends frames after it has received acknowledgments from the user. This is used in the data link layer. Rate based Flow Control - These protocols have built in mechanisms to restrict the rate of transmission of data without requiring acknowledgment from the receiver. Used in the network layer and the transport layer.
  • 10. Data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another.
  • 11. NOISELESS CHANNELS An ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. Traditionally four protocols have been defined for the data-link layer to deal with flow and error control: Simple, Stop-and-Wait, Go-Back-N, and Selective Repeat. Although the first two protocols still are used at the data-link layer, the last two have disappeared.
  • 12. Simple Protocol This is a simple protocol with neither flow nor error control. The data-link layer at the sender gets a packet from its network layer, makes a frame out of it, and sends the frame. The data-link layer at the receiver receives a frame from the link, extracts the packet from the frame, and delivers the packet to its network layer. The data-link layers of the sender and receiver provide transmission services for their network layers.
  • 13. Stop-and-Wait Protocol It is still very simple. The sender sends one frame and waits for feedback from the receiver. When the ACK arrives, the sender sends the next frame. Note that sending two frames in the protocol involves the sender in four events and the receiver in two events.
  • 14. 1. Problems due to lost data Sender waits for ACK for an infinite amount time Receiver waits for data for an infinite amount of time 2. Problems due to lost ACK Sender waits for an infinite amount of time for ACK 3. Problems due to delayed ACK/data After timeout on sender side, a delayed ACK might be wrongly considered as ACK of some other frame. Sender side Rule 1: Send one frame at a time. Rule 2: Send the next frame only after receiving ACK for the previous Receiver side Rule 1: Receive and consume frame Rule 2: After consuming frame, ACK need to be sent (Flow Control)
  • 15. NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. Stop-and-Wait Automatic Repeat Request Idea of stop-and-wait ARQ is straightforward. After transmitting one frame, the sender waits for and acknowledgement before transmitting the next frame. But there are chances for the frame to be lost or ACK to be lost. If the ACK does not arrive after certain period of time, the sender times out and retransmits the original frame. This retransmission is automatic and that is why we call this as automatic repeat request protocol.
  • 16. Stop-and-wait ARQ = Stop-and-wait + Timeout Timer + Sequence number
  • 17. Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires. Drawbacks  One frame at a time  Poor utilization of bandwidth  Poor performance
  • 19. Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link? The bandwidth-delay product is: 1Mbps x 20ms = 20,000 bits The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link.
  • 20. Sliding Window Protocol Send multiple frames at a time. Number of frames to be sent is based on Window size. Each frame is numbered i.e., sequence number
  • 21. Assignment of sequence numbers to frames is between the range 0 to 2n-1 if the frames’ sequence number is an n-bit field. As a result, the sending window has a size of 2n-1. Modulo-n is used to number the sequence numbers. If the sending window size is set as 3, the sequence numbers will be 0, 1, 2, 0, 1, 2, 0, 1, 2 and so on.