SlideShare a Scribd company logo
1 of 49
Kamar Khateeb
Abdul Rehman
Raja Mohsin
Umer Raza Rao
Chapter 11
Data Link
Control
(DLC)
Chapter 11: Outline
11.1.111.1.1 DLC SERVICESDLC SERVICES
11.1.211.1.2 DATA-LINK LAYER PROTOCOLSDATA-LINK LAYER PROTOCOLS
11.1.311.1.3 HDLCHDLC
11.1.411.1.4 PPPPPP
11.4
11-1 DLC SERVICES11-1 DLC SERVICES
The data link control (DLC) deals with procedures
for communication between two
adjacent nodes.
11.5
11-1 DLC SERVICES11-1 DLC SERVICES
Data link control functions include
● Framing,
● Flow control, and
● Error control
11.6
11.1 Framing (encapsulation)11.1 Framing (encapsulation)
The data-link layer packs bits into frames so that each
frame is distinguishable from another frame.
.
11.7
11.1 Framing11.1 Framing
The postal system practices a type of framing. The
simple act of inserting a letter into an envelope
separates one piece of information from another; the
envelope serves as the delimiter.
11.8
11.1 Framing11.1 Framing
Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.
11.9
11.1 Framing11.1 Framing
Framing in the data-link layer separates a message by
encapsulating a sender address and a destination
address into a header.
11.10
11.1 Framing11.1 Framing
Framing techniques include
● Character oriented framing (8 bit characters)
● Bit oriented framing
11.11
11.1 Framing11.1 Framing
Frames may have a particular bit pattern between
frames to help identify the start and end of a frame.
This kind of special bit pattern is referred to as a
“flag”
11.12
Figure 11.1: A frame in a character-oriented protocol
11.13
11.1 Framing11.1 Framing
Problem: the flag bit pattern could appear in the data
portion of the frame.
The problem is solved by stuffing (inserting) a special
byte pattern known as an Escape-character into the
data.
11.14
Figure 11.2: Byte stuffing and unstuffing
11.15
Figure 11.3: A frame in a bit-oriented protocol
Bit Stuffing
 Bit oriented frames face the same issue as byte-oriented frames
– the flag pattern can appear in the data.
 This is resolved by bit stuffing.
Bit Stuffing
 A zero bit is inserted after 5-consecutive one-bits.
11.18
Figure 111.4: Bit stuffing and unstuffing
11.19
11.2 Flow and Error Control11.2 Flow and Error Control
The data-link layer handles flow control and error
control.
11.20
Figure 111.5: Flow control at the data link layer
11.21
11.2 Flow and Error Control11.2 Flow and Error Control
Error Control involves two methods:
In the first method, if the frame is corrupted, it is
silently discarded; if it is not corrupted, the packet is
delivered to the network layer. This method is used
mostly in wired LANs such as Ethernet.
In the second method, if the frame is corrupted, it is
silently discarded; if it is not corrupted, an
acknowledgment is sent (for the purpose of both flow
and error control) to the sender.
Example of flow control:
● A single memory slot is used to hold information for the
receiver node at the data-link layer.
● When this single slot is empty, the data-link layer sends
a request to the sender-node to send the next frame.
Example 111.1
11.22
DATA-LINK LAYER PROTOCOLS
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.
We therefore briefly discuss the first two protocols in this chapter, in
which we need to understand some wired and wireless LANs.
The behavior of a data-link-layer protocol can be better shown as
DATA-LINK LAYER PROTOCOLS
Finite State Machine (FSM)
An FSM is thought of as a machine with a finite number of states.
The machine is always in one of the states until an event occurs.
Each event is associated with two reactions: defining the list
(possibly empty) of actions to be performed and determining the
next state (which can be the same as the current state).
 One of the states must be defined as the initial state, the state in
which the machine starts when it turns on. In Figure 11.6, we show
an example of a machine using FSM.
 We have used rounded-corner rectangles to show states, colored
text to show events, and regular black text to show actions.
Simple Protocol
Simple Protocol
Our first protocol is a simple protocol with neither flow
nor error control.We assume that
the receiver can immediately handle any frame it receives. In
other words, the receiver
can never be overwhelmed with incoming frames. Figure
11.7 shows the layout for this
protocol.
FSMs
The sender site should not send a frame until its network layer has a
message to send.
The receiver site cannot deliver a message to its network layer until a
frame arrives.We can show these requirements using two FSMs. Each FSM
has only one state, the ready
state.
The sending machine remains in the ready state until a request comes
from the process in the network layer.
When this event occurs, the sending machine encapsulates
the message in a frame and sends it to the receiving machine.
The receiving machine remains in the ready state until a frame arrives
from the sending machine.
Stop and wait:
Sender sends one data frame, waits for acknowledgement
(ACK) from receiver before proceeding to transmit next frame –
This simple flow control will break down if ACK gets lost or
errors occur sender may wait for ACK that never arrives→
 Sender States
The sender is initially in the ready state, but it can move between the ready and blocking state
 .Ready State.When the sender is in this state, it is only waiting for a packet from the network layer.
If a packet comes from the network layer, the sender creates a frame, saves a copy of the frame,
starts the only timer and sends the frame.The sender then moves to the blocking state.
 Blocking State.When the sender is in this state, three events can occur:
a. If a time-out occurs, the sender resends the saved copy of the frame and restarts the timer.
b. If a corrupted ACK arrives, it is discarded.
c. If an error-free ACK arrives, the sender stops the timer and discards the saved copy of the frame.
It then moves to the ready state.
 Receiver
The receiver is always in the ready state.Two events may occur:
a. If an error-free frame arrives, the message in the frame is delivered to the network layer and an
ACK is sent.
b. If a corrupted frame arrives, the frame is discarded.
Piggybacking
 Piggybacking
The two protocols we discussed in this section are designed for unidirectional
communication, in which data is flowing only in one direction although the
acknowledgment may travel in the other direction.
 Protocols have been designed in the past to allow data
to flow in both directions. However, to make the communication more
efficient, the data in one direction is piggybacked with the acknowledgment in
the other direction.
 In other words, when nodeA is sending data to node B, Node A also
acknowledges the data received from node B. Because piggybacking makes
communication at the data link layer more complicated, it is not a common
practice.
WHAT IS HDLC….?
 High-level Data Link Control (HDLC) is a
bit- oriented protocol i.e use bits to stuff
flags occurring in data.
 HDLC was defined by ISO for use on both
point-to-point and multipoint data links.
 It supports full-duplex communication i.e
receive and transmit at the same time.
HDLC OVERVIEW
three types of stations
Primary
Secondary
Combined
 three types of data transfer mode
Normal Response mode
Asynchronous Response mode
Asynchronous Balanced mode
Thre types of frames
Unnumbered
information
Supervisory
HDLC , three types of stations
station
HDLC
The three stations are :
Primary station
Has the responsibility of controlling the operation of data flow .
Handles error recovery
Frames issued by the primary station are called commands.
Secondary station,
Operates under the control of the primary station.
Frames issued by a secondary station are called. responses
The primary station maintains a separate logical link with each secondary
station.
Combined station,
Acts as both as primary and secondary station.
UN-
BALANCE
D MODE
BALANCED
MODE
types of data transfer mode
Transfer
Modes
Normal Response Mode (NRM)
Secondary station can send ONLY when the primary station instruct it
to do so
 Two common configurations
- Point-to-Point link (one primary station and one secondary stat
- Multipoint link (the primary station maintain different sessions with different
Asynchronous Balanced Mode (ABM)
Mainly used in point-to-point links, for communication
between combined stations
Either stations can send data, control information and
commands
secondary stations
There are three different classes of frames used in
HDLC
Unnumbered frames, U-frames are reserved for system
management. Information carried by U-frames is intended for
managing the link itself..
Information frames, I frames are used to data-link user data
and control information relating to user data
Supervisory frames, which are used for error and flow
control purposes and hence contain send and receive
sequence numbers
Let us now discuss the fields and their use in different
frame types.
❑ Flag field.This field contains synchronization pattern
01111110, which identifies
both the beginning and the end of a frame.
❑ Address field.This field contains the address of the
secondary station. If a primary
station created the frame, it contains a to address. If a
secondary station creates the
frame, it contains a from address.The address field can
be one byte or several bytes
long, depending on the needs of the network
Control field.The control field is one or two bytes used for
flow and error control.
The interpretation of bits are discussed later.
❑ Information field.The information field contains the
user’s data from the network
layer or management information. Its length can vary from
one network to another.
❑ FCS field.The frame check sequence (FCS) is the HDLC
error detection field. It
There are four different supervisory frames
SS=00, Receiver Ready (RR), and N(R)ACKs all frames
received up to and including the one with sequence number
N(R) - 1
SS=10, Receiver Not Ready (RNR), and N(R) has the same
meaning as above
SS=01, Reject; all frames with sequence number N(R) or
higher are rejected, which in turns ACKs frames with
sequence number N(R) -1 or lower.
SS=11, Selective Reject; the receive rejects the frame with
sequence number N(R)
The unnumbered frames can be grouped into the
following categories:
Mode-setting commands and responses
Recovery commends and responses
Miscellaneous commands and responses
data-link layer protocols

More Related Content

What's hot

Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
Nitesh Singh
 

What's hot (20)

MEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROLMEDIUM ACCESS CONTROL
MEDIUM ACCESS CONTROL
 
TCP/IP 3-way Handshake
TCP/IP 3-way Handshake TCP/IP 3-way Handshake
TCP/IP 3-way Handshake
 
Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer
 
Error control
Error controlError control
Error control
 
Computer Network - Network Layer
Computer Network - Network LayerComputer Network - Network Layer
Computer Network - Network Layer
 
Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...
Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...
Circuit Switching, Packet Switching, Virtual Circuit Networks and Datagram Ne...
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
 
Multiple access protocol
Multiple access protocolMultiple access protocol
Multiple access protocol
 
TCP- Transmission Control Protocol
TCP-  Transmission Control Protocol TCP-  Transmission Control Protocol
TCP- Transmission Control Protocol
 
Computer networks - Channelization
Computer networks - ChannelizationComputer networks - Channelization
Computer networks - Channelization
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Application Layer
Application Layer Application Layer
Application Layer
 
Mac sub layer
Mac sub layerMac sub layer
Mac sub layer
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
 
computer network OSI layer
computer network OSI layercomputer network OSI layer
computer network OSI layer
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
 
Transport layer
Transport layer Transport layer
Transport layer
 
Unicast multicast & broadcast
Unicast multicast & broadcastUnicast multicast & broadcast
Unicast multicast & broadcast
 
Transmission modes
Transmission modesTransmission modes
Transmission modes
 

Similar to data-link layer protocols

unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdf
ssuser3aa461
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
k2w9psdb96
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
lathass5
 
Lecture 2 Connecting LANs, Backbone Networks, and Virtual LANs.ppt
Lecture 2   Connecting LANs, Backbone Networks, and Virtual LANs.pptLecture 2   Connecting LANs, Backbone Networks, and Virtual LANs.ppt
Lecture 2 Connecting LANs, Backbone Networks, and Virtual LANs.ppt
abdnazar2003
 

Similar to data-link layer protocols (20)

DLL
DLLDLL
DLL
 
Data Link Control
Data Link ControlData Link Control
Data Link Control
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
 
Data link layer
Data link layer Data link layer
Data link layer
 
Unit 2
Unit 2Unit 2
Unit 2
 
DATA LINK CONTROL.pptx
DATA LINK CONTROL.pptxDATA LINK CONTROL.pptx
DATA LINK CONTROL.pptx
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdf
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
CN UNIT II.pptx
CN UNIT II.pptxCN UNIT II.pptx
CN UNIT II.pptx
 
Data link control & protocol concepts
Data link control & protocol conceptsData link control & protocol concepts
Data link control & protocol concepts
 
Hdlc
HdlcHdlc
Hdlc
 
Hdlc
HdlcHdlc
Hdlc
 
Unit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part AUnit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part A
 
Unit 2 ppt 3.ppt
Unit 2 ppt 3.pptUnit 2 ppt 3.ppt
Unit 2 ppt 3.ppt
 
Lecture 2 Connecting LANs, Backbone Networks, and Virtual LANs.ppt
Lecture 2   Connecting LANs, Backbone Networks, and Virtual LANs.pptLecture 2   Connecting LANs, Backbone Networks, and Virtual LANs.ppt
Lecture 2 Connecting LANs, Backbone Networks, and Virtual LANs.ppt
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 
Computer network
Computer networkComputer network
Computer network
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
 

Recently uploaded

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

data-link layer protocols

  • 3. Chapter 11: Outline 11.1.111.1.1 DLC SERVICESDLC SERVICES 11.1.211.1.2 DATA-LINK LAYER PROTOCOLSDATA-LINK LAYER PROTOCOLS 11.1.311.1.3 HDLCHDLC 11.1.411.1.4 PPPPPP
  • 4. 11.4 11-1 DLC SERVICES11-1 DLC SERVICES The data link control (DLC) deals with procedures for communication between two adjacent nodes.
  • 5. 11.5 11-1 DLC SERVICES11-1 DLC SERVICES Data link control functions include ● Framing, ● Flow control, and ● Error control
  • 6. 11.6 11.1 Framing (encapsulation)11.1 Framing (encapsulation) The data-link layer packs bits into frames so that each frame is distinguishable from another frame. .
  • 7. 11.7 11.1 Framing11.1 Framing The postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one piece of information from another; the envelope serves as the delimiter.
  • 8. 11.8 11.1 Framing11.1 Framing Framing in the data-link layer separates a message by encapsulating a sender address and a destination address into a header.
  • 9. 11.9 11.1 Framing11.1 Framing Framing in the data-link layer separates a message by encapsulating a sender address and a destination address into a header.
  • 10. 11.10 11.1 Framing11.1 Framing Framing techniques include ● Character oriented framing (8 bit characters) ● Bit oriented framing
  • 11. 11.11 11.1 Framing11.1 Framing Frames may have a particular bit pattern between frames to help identify the start and end of a frame. This kind of special bit pattern is referred to as a “flag”
  • 12. 11.12 Figure 11.1: A frame in a character-oriented protocol
  • 13. 11.13 11.1 Framing11.1 Framing Problem: the flag bit pattern could appear in the data portion of the frame. The problem is solved by stuffing (inserting) a special byte pattern known as an Escape-character into the data.
  • 14. 11.14 Figure 11.2: Byte stuffing and unstuffing
  • 15. 11.15 Figure 11.3: A frame in a bit-oriented protocol
  • 16. Bit Stuffing  Bit oriented frames face the same issue as byte-oriented frames – the flag pattern can appear in the data.  This is resolved by bit stuffing.
  • 17. Bit Stuffing  A zero bit is inserted after 5-consecutive one-bits.
  • 18. 11.18 Figure 111.4: Bit stuffing and unstuffing
  • 19. 11.19 11.2 Flow and Error Control11.2 Flow and Error Control The data-link layer handles flow control and error control.
  • 20. 11.20 Figure 111.5: Flow control at the data link layer
  • 21. 11.21 11.2 Flow and Error Control11.2 Flow and Error Control Error Control involves two methods: In the first method, if the frame is corrupted, it is silently discarded; if it is not corrupted, the packet is delivered to the network layer. This method is used mostly in wired LANs such as Ethernet. In the second method, if the frame is corrupted, it is silently discarded; if it is not corrupted, an acknowledgment is sent (for the purpose of both flow and error control) to the sender.
  • 22. Example of flow control: ● A single memory slot is used to hold information for the receiver node at the data-link layer. ● When this single slot is empty, the data-link layer sends a request to the sender-node to send the next frame. Example 111.1 11.22
  • 23. DATA-LINK LAYER PROTOCOLS 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. We therefore briefly discuss the first two protocols in this chapter, in which we need to understand some wired and wireless LANs. The behavior of a data-link-layer protocol can be better shown as
  • 24. DATA-LINK LAYER PROTOCOLS Finite State Machine (FSM) An FSM is thought of as a machine with a finite number of states. The machine is always in one of the states until an event occurs. Each event is associated with two reactions: defining the list (possibly empty) of actions to be performed and determining the next state (which can be the same as the current state).  One of the states must be defined as the initial state, the state in which the machine starts when it turns on. In Figure 11.6, we show an example of a machine using FSM.  We have used rounded-corner rectangles to show states, colored text to show events, and regular black text to show actions.
  • 25.
  • 26. Simple Protocol Simple Protocol Our first protocol is a simple protocol with neither flow nor error control.We assume that the receiver can immediately handle any frame it receives. In other words, the receiver can never be overwhelmed with incoming frames. Figure 11.7 shows the layout for this protocol.
  • 27.
  • 28. FSMs The sender site should not send a frame until its network layer has a message to send. The receiver site cannot deliver a message to its network layer until a frame arrives.We can show these requirements using two FSMs. Each FSM has only one state, the ready state. The sending machine remains in the ready state until a request comes from the process in the network layer. When this event occurs, the sending machine encapsulates the message in a frame and sends it to the receiving machine. The receiving machine remains in the ready state until a frame arrives from the sending machine.
  • 29. Stop and wait: Sender sends one data frame, waits for acknowledgement (ACK) from receiver before proceeding to transmit next frame – This simple flow control will break down if ACK gets lost or errors occur sender may wait for ACK that never arrives→
  • 30.
  • 31.
  • 32.  Sender States The sender is initially in the ready state, but it can move between the ready and blocking state  .Ready State.When the sender is in this state, it is only waiting for a packet from the network layer. If a packet comes from the network layer, the sender creates a frame, saves a copy of the frame, starts the only timer and sends the frame.The sender then moves to the blocking state.  Blocking State.When the sender is in this state, three events can occur: a. If a time-out occurs, the sender resends the saved copy of the frame and restarts the timer. b. If a corrupted ACK arrives, it is discarded. c. If an error-free ACK arrives, the sender stops the timer and discards the saved copy of the frame. It then moves to the ready state.  Receiver The receiver is always in the ready state.Two events may occur: a. If an error-free frame arrives, the message in the frame is delivered to the network layer and an ACK is sent. b. If a corrupted frame arrives, the frame is discarded.
  • 33. Piggybacking  Piggybacking The two protocols we discussed in this section are designed for unidirectional communication, in which data is flowing only in one direction although the acknowledgment may travel in the other direction.  Protocols have been designed in the past to allow data to flow in both directions. However, to make the communication more efficient, the data in one direction is piggybacked with the acknowledgment in the other direction.  In other words, when nodeA is sending data to node B, Node A also acknowledges the data received from node B. Because piggybacking makes communication at the data link layer more complicated, it is not a common practice.
  • 34. WHAT IS HDLC….?  High-level Data Link Control (HDLC) is a bit- oriented protocol i.e use bits to stuff flags occurring in data.  HDLC was defined by ISO for use on both point-to-point and multipoint data links.  It supports full-duplex communication i.e receive and transmit at the same time.
  • 35. HDLC OVERVIEW three types of stations Primary Secondary Combined  three types of data transfer mode Normal Response mode Asynchronous Response mode Asynchronous Balanced mode Thre types of frames Unnumbered information Supervisory
  • 36. HDLC , three types of stations station
  • 37. HDLC The three stations are : Primary station Has the responsibility of controlling the operation of data flow . Handles error recovery Frames issued by the primary station are called commands. Secondary station, Operates under the control of the primary station. Frames issued by a secondary station are called. responses The primary station maintains a separate logical link with each secondary station. Combined station, Acts as both as primary and secondary station.
  • 39. types of data transfer mode Transfer Modes
  • 40. Normal Response Mode (NRM) Secondary station can send ONLY when the primary station instruct it to do so  Two common configurations - Point-to-Point link (one primary station and one secondary stat - Multipoint link (the primary station maintain different sessions with different Asynchronous Balanced Mode (ABM) Mainly used in point-to-point links, for communication between combined stations Either stations can send data, control information and commands secondary stations
  • 41.
  • 42.
  • 43. There are three different classes of frames used in HDLC Unnumbered frames, U-frames are reserved for system management. Information carried by U-frames is intended for managing the link itself.. Information frames, I frames are used to data-link user data and control information relating to user data Supervisory frames, which are used for error and flow control purposes and hence contain send and receive sequence numbers
  • 44.
  • 45. Let us now discuss the fields and their use in different frame types. ❑ Flag field.This field contains synchronization pattern 01111110, which identifies both the beginning and the end of a frame. ❑ Address field.This field contains the address of the secondary station. If a primary station created the frame, it contains a to address. If a secondary station creates the frame, it contains a from address.The address field can be one byte or several bytes long, depending on the needs of the network
  • 46. Control field.The control field is one or two bytes used for flow and error control. The interpretation of bits are discussed later. ❑ Information field.The information field contains the user’s data from the network layer or management information. Its length can vary from one network to another. ❑ FCS field.The frame check sequence (FCS) is the HDLC error detection field. It
  • 47. There are four different supervisory frames SS=00, Receiver Ready (RR), and N(R)ACKs all frames received up to and including the one with sequence number N(R) - 1 SS=10, Receiver Not Ready (RNR), and N(R) has the same meaning as above SS=01, Reject; all frames with sequence number N(R) or higher are rejected, which in turns ACKs frames with sequence number N(R) -1 or lower. SS=11, Selective Reject; the receive rejects the frame with sequence number N(R)
  • 48. The unnumbered frames can be grouped into the following categories: Mode-setting commands and responses Recovery commends and responses Miscellaneous commands and responses