You are on page 1of 6

13/4/2022

CONTENTS
• Flow control
• Stop-and-Wait Flow Control
• Sliding-Window Flow Control
Chapter 7 • Error Control
• Stop-and-Wait ARQ
DATA LINK CONTROL PROTOCOLS • Go-back-N ARQ
• Selective-Reject ARQ
• High-Level Data Link Control (HDLC)
• Basic Characteristics
• Frame Structure
• Operation

1 2

Data Link Control Protocols Flow control


• need layer of logic above Physical • Receivers typically have a finite amount of memory (buffer space) to store
• to manage exchange of data over a link received data before processing.
• frame synchronization
• flow control
• error control
• addressing
• control and data
• link management

3 4

Flow control Stop-and-Wait Flow Control


• Flow control aims to ensure sending entity does not overwhelm receiving entity
• If sender sends too fast for receiver, then buffer may overflow • Frame Types
• Result of buffer overflow: data is lost, possibly need to retransmit, which reduces • DATA: contains information to be sent
performance • ACKnowledgement: acknowledges receipt of data
• Flow control tries to prevent buffer delays
• Rules
• Assume no errors but varying delays
• Source transmits a DATA frame
• Flow control is also used in transport layer, e.g. TCP
• Source waits for ACK frame before sending next DATA frame
• Transmission time • Destination receives DATA frame and replies with an ACK if ready for more data
• Time taken to emit all bits into medium • Destination can stop flow of data y not sending ACK
• Propagation time
• Time for a bit to traverse the link

5 7

1
13/4/2022

The transmission time is normalized to one, and


the propagation delay is expressed as the
Stop-and-Wait Link Utilization variable a, L is the number of bits in the frame
Stop-and-Wait Flow Control
• B = length of the link in bits; this is the
number of bits present on the link at an
instance in time when a stream of bits
fully occupies the link
• R = data rate of the link, in bps
• d = length, or distance, of the link in
meters
• V = velocity of propagation, in m/s

 Larger values of a are


consistent with higher data
rates and/or longer
distances between stations
8 10

Sliding-Window Flow Control


• Stop-and-wait allows only 1 frame to be in transit at a time
• Sliding-window flow control allows multiple frames to b e in transit at a time
Sequence Number
• Each frame header contains k-bit sequence number (wraps back to 0 after 2k -1)
• Keep track of frames sent and acknowledged

11 13

Sliding Window Diagram Example of Sliding-Window Protocol


The sender
• Sender is allowed to send up to W
frames without receiving ACK
• Sender records:
• Last frame acknowledged
• Last frame transmitted
• Current window size
The receiver
• Receiver has buffer space for W
frames
• Receiver records:
• Last frame acknowledge
• Last frame received
• Current window size
• Receiver sends an ACK (or Receiver
Ready – RR)
• ACK contains sequence number of
next expected DATA frame. 14 15

2
13/4/2022

• Assume a 3 bit sequence number is used in s sliding window flow


control protocol (that is, maximum window size is 7). The current
state of a source node is:
• Last frame ACKed = 3
• Last frame transmitted = 6
• Then the node transmits 3 DATA frames and then receives an ACK
(receive Ready) frame with number 6. After these frames have been
transmitted/received, what is the new value of the current window
size?

16 17

Sliding Window Enhancements Error Control


• Receiver can acknowledge frames without permitting further • Detection and correction of errors
• Lost frames: frame not received
transmission (Receive Not Ready) • Damaged frames: frame received with errors
• Must send a normal acknowledge to resume • Common techniques used:
• Error detection and FEC
• If duplex, use piggybacking • Positive acknowledgment: destination returns a positive ACK after successfully
• If no data to send, use acknowledgement frame receiving error-free frames
• Retransmission after timeout: source retransmits a frame that has not been ACKed
• If data but no acknowledgement to send, send last acknowledgement number after predetermined time
again, or have ACK valid flag (TCP) • Negative acknowledgement and retransmission: destination returns negative ACK for
frames in which an error is detected
• Last 3 techniques are called Automatic repeat request. Three versions:
• Stop and wait
• Go back N
• Selective reject (selective retransmission)
18 19

Stop and Wait ARQ Stop and Wait ARQ Example: Normal
• Based on Stop-and-Wait flow control
• Source transmits single frame, starts timer and maintains copy
• If ACK received, stop timer and transmit next frame
• It no ACK received before timer expires, retransmit copy of frame
• Destination sends ACK if frame received (with no errors); if damaged frame, then
discard frame
• Frames have 1-bit sequence number (alternate between 0 and 1)
• Used for destination to distinguish between duplicate DATA frames in case of damaged ACK
• Stop-and-Wait ARQ is simple, but inefficient

20 21

3
13/4/2022

Stop and Wait ARQ Stop and Wait ARQ


Example: Lost DATA Example: Lost ACK

22 23

Go-back-N ARQ Go-back-N ARQ Example


• Based on Stop-and-Wait flow control
• If no error, ACK as in sliding window (contains sequence number of next expected
frame)
• If error detected by Destination, reply with negative ACK (NACK or rejection, REJ)
• Destination will discard that frame and all future frames until error frame
received correctly
• Transmitter must go back and retransmit that frame and all subsequent frames
• If no response from Destination after timeout, then Source may send special ACK
(ACKRequest or RP (Pbit =1))
• The ACKRequest from Source to Destination, is a request for an ACK from the Destination
• Upon receipt of ACKRequest, the Destination sends an ACK
• Maximum window size 2k-1
24 25

Selective-Reject ARQ How long should Timeout interval be?


• Also called selective retransmission or selective repeat
• Only frames that are rejected or timeout are • Long enough to allow destination to process data and return ACK
retransmitted • But processing and (sometimes) propagation time are variable;
• Subsequent frames are accepted by the destination and difficult for source to estimate optimal timeout interval
buffered • Too long: source waste’s time waiting if DATA is lost
• Maximum window size: 2k-1 • Too short: source retransmits even if DATA is not lost
• Minimum retransmission (GOOD)
• Destination must maintain large enough buffer for frames
received out – of – order (BAD)
• More complex logic in transmitter (BAD)
• Not as widely used as Go-Back-N; useful for satellite links
with long propagation delays 26 27

4
13/4/2022

High Level Data Link Control HDLC Transfer Modes


• an important data link control protocol • Normal Response Mode (NRM)
• specified as ISO 33009, ISO 4335 • unbalanced config, primary initiates transfer
• station types: • used on multi-drop lines, eg host + terminals
• Primary - controls operation of link - commands • Asynchronous Balanced Mode (ABM)
• Secondary - under control of primary station - responses • balanced config, either station initiates transmission, has no polling overhead,
• Combined - issues commands and responses widely used
• link configurations • Asynchronous Response Mode (ARM)
• Unbalanced - 1 primary, multiple secondary; supports both full-duplex and • unbalanced config, secondary may initiate transmit without permission from
half-duplex transmission
primary, rarely used
• Balanced - 2 combined stations; ; supports both full-duplex and half-duplex
transmission

29 31

HDLC Frame Structure Flag Fields and Bit Stuffing


• delimit frame at both ends with 01111110 seq
• synchronous transmission of frames • receiver hunts for flag sequence to synchronize
• single frame format used • 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

35 36

Address Field Control Field


• different for different frame type
• identifies secondary station that sent or will receive frame • Information - data transmitted to user (next layer up)
• usually 8 bits long • Flow and error control piggybacked on information frames
• Supervisory - ARQ when piggyback not used
• may be extended to multiples of 7 bits
• Unnumbered - supplementary link control
• LSB indicates if is the last octet (1) or not (0)
• first 1-2 bits of control field identify frame type
• all ones address 11111111 is broadcast

37 38

5
13/4/2022

Control Field Information & FCS Fields


• use of Poll/Final bit depends on context
• in command frame is P bit set to1 to solicit (poll) response from • Information Field
peer • in information and some unnumbered frames
• in response frame is F bit set to 1 to indicate response to soliciting • must contain integral number of octets
command • variable length
• seq number usually 3 bits • Frame Check Sequence Field (FCS)
• can extend to 8 bits as shown below
• used for error detection
• either 16 bit CRC or 32 bit CRC

39 40

HDLC Operation HDLC Operation Example


• 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 ready or fault noted

41 42

HDLC Operation Example

43

You might also like