DLL Design Issues - Part3
DLL Design Issues - Part3
Flow Control
Sejal M Chopra
Assistant Professor - Dept. of Computer Engineering
Don Bosco Institute of Technology, Mumbai
Contents to be discussed
• Flow Control
• Functions and Requirements of Data Link Protocols
• Elementary Data link Protocol types
• Noiseless Channel Protocols: Simplest and Stop and Wait
• Noisy Channel Protocols( Sliding Window):Stop and Wait
ARQ, Go back N ARQ and Selective Repeat ARQ Protocol
• Numerical
Flow Control
Two Approaches:
Feedback-based flow control:
The receiver sends back information to the sender giving it
permission to send more data or at least telling the sender how the
receiver is doing.
Rate-based flow control:
The protocol has a built-in mechanism that limits the rate at which
senders may transmit data, without using feedback from the receiver.
Functions and Requirements of Data
Link Protocol
To ensure that frames are delivered free of errors to the destination station, a
number of requirements are placed on a data link protocol.
The protocols are normally implemented using one of the programming
languages.
The protocol (control mechanism) should be capable of performing:
• The identification of a frame (i.e. recognise the first and last bits of a
frame).
• The transmission of frames of any length up to a given maximum. Any bit
pattern is permitted in a frame.
• The detection of transmission errors.
• The retransmission of frames which were damaged by errors.
• The assurance that no frames were lost.
• In a multidrop configuration -Some mechanism must be used for
preventing conflicts caused by simultaneous transmission by many
stations.
• The detection of failure or abnormal situations for control
and monitoring purposes.
Elementary Data link Protocol Types
Simplest Protocol for Noiseless Channel
In order to appreciate the step by step development of efficient and complex
protocols we will begin with a simple but unrealistic protocol. In this protocol:
• Data are transmitted in one direction only
• The transmitting (Tx) and receiving (Rx) hosts are always ready
• Processing time can be ignored
• Infinite buffer space is available
• No errors occur; i.e. no damaged frames and no lost frames (perfect channel)
Stop and Wait Protocol for Noiseless
Channel
In this protocol we assume that:
• Data is transmitted in one direction only
• No errors occur (perfect channel)
• The receiver can only process the received information at a finite rate
• These assumptions imply that the transmitter cannot send frames at a rate
faster than the receiver can process them.
• The problem here is how to prevent the sender from flooding the receiver
Sender:
Rule 1) Send one data packet at a time.
Rule 2) Send the next packet only after receiving
acknowledgement for the previous.
Receiver:
Rule 1) Send acknowledgement after receiving
and consuming a data packet.
Rule 2) After consuming packet
acknowledgement need to be sent (Flow
Control)
Problems of Stop and Wait Protocol
Assume transmission errors in the frame are detected by the
hardware checksum.
Case 1:Frame/Data is lost:
•Sender waits for ACK for an infinite amount of time.
•Receiver waits for data for an infinite amount of time
•Note : Retransmission happens if a timer is used.
Numericals:
• If the bandwidth of the line is 1.5 Mbps, RTT is 45 msec and
packet size is 1 KB, then find the link utilization in stop and wait.
Approach-1:
Two separate communication channels(physical circuits) :Forward
channel for data and Reverse channel for acknowledgement
Problems: 1. Reverse channel bandwidth wasted 2. Cost
Approach 2:
Same circuit for both directions
Problem: Data and acknowledgement are intermixed, can’t differentiate
Approach 3:
Attaching acknowledgement to outgoing data frame: Piggybacking
Piggybacking
• Temporarily delaying transmission of outgoing acknowledgement
so that they can be hooked onto the next outgoing data frame
Three Cases:
Case1: host has both data and the
acknowledgment to send
Case 2: host does not have any data
to send then it will send only the
acknowledgment
Case3: host has only data to send
then it will send the data along with
the acknowledgment of the last
frame received. The duplicate
acknowledgment will be discarded
by the receiver and the data would
be accepted.
Piggybacking
Complication (Delayed transmission):
How long to wait for a packet to piggyback?
• If longer than sender timeout period then sender retransmits
Purpose of acknowledgement is lost
Solution for timing complexion
• If a new packet arrives quickly
Piggybacking
• If no new packet arrives after a receiver ack timeout
Sending a separate acknowledgement frame
73
SLIDING WINDOW PROTOCOLS
(Noisy Channel)
The next three protocols are bidirectional protocols that belong to a
class called sliding window protocols. (max sending window size,
receiving window size)
•One-bit sliding window protocol or Stop and Wait ARQ (1, 1)
•Go back N ARQ(>1, 1)
•Selective repeat ARQ (>1, >1)
The three differ among themselves in terms of efficiency,
complexity, and buffer requirements.
Each outbound frame contains an n-bit sequence number
-Range: 0 - MAX_SEQ (MAX_SEQ = 2n - 1)
For stop-and-wait, n = 1 restricting the sequence numbers to 0 and
1 only
SENDING & RECEIVING WINDOWS
• At any instance of time
• Sender maintains a set of sequence numbers of frames
permitted to send
• These frames fall within sending window
• Receiver maintains a set of sequence numbers of frames
permitted to accept
• These frames fall within receiving window
• Lower limit, upper limit, and size of two windows need not be the
same - Fixed or variable size
• Senders Window contains frames can be sent or have been sent
but not yet acknowledged – outstanding frames
Stop-and-Wait ARQ Protocol
• In Stop-and-wait, at any point in time, there is only one frame
that is sent and waiting to be acknowledged.(uses half duplex
mode of transmission)
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be in transition
while waiting for ACK
• Solution:(Pipelining)- Allowing w frames sent before blocking
Problem: Wait for frames
Solutions:Go-Back N ARQ,
Selective repeat ARQ
Numerical:
In Stop and wait protocol every 4th packet is lost
and we need to send total 10 packets so how many n-2,… are
transmission it took to send all the packets? 87
GO BACK N ARQ Protocol
• Improves efficiency of Stop and Wait by not waiting
• Keep Channel busy by continuing to send frames
• Allow a window of upto Ws outstanding frames
• Use m-bit sequence numbering
• Receiver discards all subsequent frames following an error one, and send no
acknowledgement for those discarded
• Receiving window size = 1 (i.e., frames must be accepted in the order they were
sent)
• Sending window might get full
• If so, re-transmitting unacknowledged frames
Numerical:
In Selective Repeat Ws =
5 and we are sending 10
packets where every 5th
packet is lost find
number of
retransmissions?
SELECTIVE REPEAT ARQ
where a is ratio of propagation delay vs transmission delay and
N is number of packets sent.
References