0% found this document useful (0 votes)
55 views

Data Link Control Protocol.

This document discusses data link control protocols. It introduces the need for protocols to manage data exchange over a link, including flow control and error control. It describes common flow control protocols like stop-and-wait and sliding windows. It also describes error control techniques like automatic repeat request (ARQ) with variants like go-back-N and selective reject. Finally, it provides an overview of the High-Level Data Link Control (HDLC) protocol, including its frame structure, operation modes, and use of control frames for flow and error control.

Uploaded by

Fatimah Farheen
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Data Link Control Protocol.

This document discusses data link control protocols. It introduces the need for protocols to manage data exchange over a link, including flow control and error control. It describes common flow control protocols like stop-and-wait and sliding windows. It also describes error control techniques like automatic repeat request (ARQ) with variants like go-back-N and selective reject. Finally, it provides an overview of the High-Level Data Link Control (HDLC) protocol, including its frame structure, operation modes, and use of control frames for flow and error control.

Uploaded by

Fatimah Farheen
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 32

Data and Computer

Communications
Chapter 7 – Data Link Control
Protocols

Eighth Edition
by William Stallings

Lecture slides by Lawrie Brown


Data Link Control Protocols

"Great and enlightened one," said Ten-


teh, as soon as his stupor was lifted, "has this
person delivered his message competently, for
his mind was still a seared vision of snow and
sand and perchance his tongue has stumbled?"
"Bend your ears to the wall," replied the
Emperor, "and be assured."
—Kai Lung's Golden Hours, Earnest Bramah
Data Link Control Protocols
 Need layer of logic above Physical
 To manage exchange of data over a link
 Flow control
 Error control
 HDLC
Flow Control
 Ensure sending entity does not overwhelm
receiving entity
 by preventing buffer overflow
 Influenced by:
 Transmission time
• time taken to emit all bits into medium
 Propagation time
• time for a bit to traverse the link
 Assume here no errors but varying delays
Model of Frame Transmission
Stop and Wait
 source transmits frame (no need for seq. #)
 destination receives frame and replies with
acknowledgement (ACK)
 source waits for ACK before sending next
 destination can stop flow by not send ACK
 works well for a few large frames
 Stop and wait becomes inadequate if large
block of data is split into small frames
Stop and Wait Link Utilization
Stop and Wait Utilization (cont)
 B = R x (d/V)
 B: length of the link in bits
 R: data rate of the link, in bps
 d: length or distance of the link in meters
 D: velocity of propagation, in m/s
 a = B/L
 a: the propagation delay (with frame tx time = 1)
 L: the number of bits in the frame

 or d L
a( ) ( )
V R
Sliding Windows Flow Control
 Allows multiple numbered frames to be in transit
 Receiver has buffer length of W.
 transmitter sends up to W frames without ACK
 ACK includes number of next frame expected
 sequence number is bounded by size of field (k)
 frames are numbered modulo 2k
 giving max window size of up to 2k – 1 (why?)
 receiver can ack frames without permitting
further transmission (Receive Not Ready)
 must send a normal acknowledge to resume
 if have full-duplex link, can piggyback ACKs
Sliding Window Diagram
3-bit seq. #, Win size = 7
Sliding Window Example
Sliding Window Utilization
 Window size W, transmission time = 1,
propagation time = a
 Case 1: W >= 2a + 1
 Sender A can transmit continuously with no
pause and normalized throughput is 1.0
 Case 2: W < 2a + 1
 Sender A exhausts its window at t = W and
cannot send additional frames until t = 2a + 1.
 Normalized throughput is W / (2a+1)
Error Control
 detection and correction of errors such as:
 lost frames
 damaged frames
 common techniques use:
 error detection
 positive acknowledgment
 retransmission after timeout
 negative acknowledgement & retransmission
Automatic Repeat Request
(ARQ)
 collective name for such error control
mechanisms, including:
 stop and wait
 go back N
 selective reject (selective retransmission)
Stop and Wait
 source transmits single frame
 wait for ACK
 if received frame damaged, discard it
 transmitter has timeout
 if no ACK within timeout, retransmit
 if ACK damaged,transmitter will not recognize it
 transmitter will retransmit
 receive gets two copies of frame
 use alternate numbering and ACK0 / ACK1
Stop and Wait
 see example with both
types of errors
 pros and cons
 simple
 inefficient
Go Back N
 Based on sliding window
 If no error, ACK as usual
 Use window to control number of
outstanding frames
 If error, reply with rejection
 Discard that frame and all future frames until
error frame received correctly
 Transmitter must go back and retransmit that
frame and all subsequent frames
Go Back N - Handling
 Damaged Frame
 error in frame i so receiver rejects frame i
 transmitter retransmits frames from i
 Lost Frame
 Frame i lost and either
• Transmitter sends i+1 and receiver gets frame i+1
out of seq and rejects frame i
 Transmitter then retransmits frames from i
Go Back N - Handling
 Damaged Acknowledgement
 receiver gets frame i, sends ack (i+1) which is lost
 acks are cumulative, so next ack (i+n) may arrive
before transmitter times out on frame i
 if transmitter times out, it sends ack with P bit set
 can be repeated a number of times before a reset
procedure is initiated
 Damaged Rejection
 reject for damaged frame is lost
 handled as for lost frame when transmitter times out
Selective Reject
 Also called selective retransmission
 Only rejected frames are retransmitted
 Subsequent frames are accepted by the receiver
and buffered
 Minimizes retransmission
 Receiver must maintain large enough buffer
 More complex logic in transmitter
 Hence less widely used
 Useful for satellite links with long propagation
delays
Go Back N
vs
Selective
Reject
Selective-reject ARQ
 Window-size limitation
 E.g. 3 bit sequence number, window size = 7
 Station A sends frames 0 ~ 6 to station B
 Station B receives all seven frames and
cumulatively acknowledges with RR7
 If RR 7 is lost
 A times out and retransmit frame 0 (w/o P-bit
timer? Can P-bit mechanism be used in SR-ARQ?)
Selective-reject ARQ (cont)
 B has already advanced its receive window to
accept frames 7, 0, 1, 2, 3, 4, and 5. Thus, it
assumes that frame 7 has been lost and that
this is a new frame 0 which it accepts.

0 1 2 3 4 5 6 7 0 1 2 3 4 5 ...
S
RR7 lost
retx

R
High Level Data Link Control
(HDLC)
 An important data link control protocol
 Station types:
 Primary - controls operation of link
 Secondary - under control of primary station
 Combined - issues commands and responses
 Link configurations
 Unbalanced - 1 primary, multiple secondary
 Balanced - 2 combined stations
HDLC Transfer Modes
 Normal Response Mode (NRM)
 unbalanced config, primary initiates transfer
 used on multi-drop lines, eg host + terminals
 Asynchronous Balanced Mode (ABM)
 balanced config, either station initiates transmission,
widely used
 Asynchronous Response Mode (ARM)
 unbalanced config, secondary may initiate transmit
without permission from primary, rarely used
HDLC Frame Structure
 Synchronous transmission of frames
 Single frame format used
Flag Fields and Bit Stuffing
 Delimit frame at both ends with 01111110 seq
 Receiver hunts for flag sequence to synchronize
 Bit stuffing used to avoid confusion with data
containing flag seq 01111110
 0 inserted after every sequence of five 1s
 if receiver detects five 1s it checks next bit
 if next bit is 0, it is deleted (was stuffed bit)
 if next bit is 1 and seventh bit is 0, accept as flag
 if sixth and seventh bits 1, sender is indicating abort
Address Field
 Identifies secondary station that sent or will
receive frame
 Usually 8 bits long
 May be extended to multiples of 7 bits
 LSB indicates if is the last octet (1) or not (0)
 All ones address 11111111 is broadcast
Control Field
 Different for different frame type
 Information - data transmitted to user (next layer up)
• Flow and error control piggybacked on information frames
 Supervisory - ARQ when piggyback not used
 Unnumbered - supplementary link control
 First 1-2 bits of control field identify frame type
Information & FCS Fields
 Information Field
 in information and some unnumbered frames
 must contain integral number of octets
 variable length
 Frame Check Sequence Field (FCS)
 used for error detection
 either 16 bit CRC or 32 bit CRC
HDLC Operation
 consists of exchange of information,
supervisory and unnumbered frames
 have three phases
 initialization
• by either side, set mode & seq
 data transfer
• with flow and error control
• using both I & S-frames (RR, RNR, REJ, SREJ)
 disconnect
• when requested or fault noted
Summary
 introduced need for data link protocols
 flow control
 error control
 HDLC

You might also like