lecture 18 - flow control
TRANSCRIPT
-
8/6/2019 Lecture 18 - Flow Control
1/14
Data Link Layer - Flow Control
1 Data & ComputerCommunications
William Stallings Ch. 7
2 Data Communications &Networking
B. A. Forouzan Ch. 11
3 Computer Networks A. S. Tanenbaum Ch. 3
Data Link Control Protocols
need layer of logic above Physical
to manage exchange of data over a link
frame synchronization
flow control
error control
addressing
control and data
link management
2
-
8/6/2019 Lecture 18 - Flow Control
2/14
Model of Frame Transmission
3
Flow Control
Flow control refers to a set of procedures used to restrict the amount of data that the
sender can send
before waiting for acknowledgment.
ensures sending entity does not overwhelmreceiving 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
4
-
8/6/2019 Lecture 18 - Flow Control
3/14
Error & Flow Control Protocols
There are two main types of flow control protocols: Stop-and-Wait
Sliding Window
There are three main types of error control protocols(ARQ-based): Stop-and-Wait ARQ
Sliding Window ARQ
Go-back-N ARQ
Selective-Reject ARQ
5
Categories of Flow Control
6
-
8/6/2019 Lecture 18 - Flow Control
4/14
Simplest protocol flow diagram
7
Simplest protocol with no flow or error control
8
-
8/6/2019 Lecture 18 - Flow Control
5/14
Sender-site algorithm for the simplest protocol
9
Receiver-site algorithm for the simplest protocol
10
-
8/6/2019 Lecture 18 - Flow Control
6/14
Stop and Wait
source transmits frame destination receives frame and replies with
acknowledgement (ACK)
source waits for ACK before sending next frame
destination can stop flow
by not sending ACK
works well for a few large frames
Stop and wait becomes inadequate
if large block of data is split into small frames
11
Design of stop & wait
12
-
8/6/2019 Lecture 18 - Flow Control
7/14
Sender-site algorithm for Stop-and-Wait Protocol
13
Receiver-site algorithm for Stop-and-Wait Protocol
14
-
8/6/2019 Lecture 18 - Flow Control
8/14
Stop & wait flow diagram
15
Stop & Wait: Drawbacks
Inefficient link utilization because only one frame issent at a time
Transmitter/sender must wait for ACK
During this waiting period no frames are sent
Inefficiency gets even worse when
Transmission speed is high
Transmitter quickly sends frame then sits idle Propagation distance is high
It takes longer for the frame and its ACK to reach destination
Both cases leave the Transmitter waiting idle for longertimes
16
-
8/6/2019 Lecture 18 - Flow Control
9/14
Stop & Wait: normal operation
17
Alternatives - Stop & wait
How to improve the efficiency?
To improve the efficiency ACK should be sent aftermultiple frames
Sliding Window protocols
18
-
8/6/2019 Lecture 18 - Flow Control
10/14
Fragmentation
Large block of data may be split into smallframes.
Why? Limited buffer size at receiver
Errors can be detected sooner
Retransmission of smaller frames is needed in case oferror
Prevents one station occupying medium for longperiods (LAN)
However, stop and wait is inadequate to cater forlong-delay links
19
Sliding Window Flow Control
allows multiple numbered frames to be in transit
receiver has buffer W long
transmitter sends up to W frames without ACK
ACK includes number of next frame expected
Sequence number is bounded by size of field (k-bit) frames are numbered modulo 2k
giving max window size of up to 2k - 1
20
-
8/6/2019 Lecture 18 - Flow Control
11/14
Sliding Window Diagram
21
Sliding Window Diagram
22
-
8/6/2019 Lecture 18 - Flow Control
12/14
Sliding Window Example
23
Sliding Window Enhancements
Receiver can acknowledge frames without permittingfurther transmission using Receive Not Ready or RNR frame
must send a normal acknowledge to resume (Receive Ready orRR frame)
If no data to send, simple ACK is sent
Use piggybacking When need to ACK and send data, use same data frame to carry
ACK number
24
-
8/6/2019 Lecture 18 - Flow Control
13/14
Piggybacking
Piggybacking is a method that combines the data and theACK in one frame
It is useful in bidirectional communications
Stations can send their data along-with ACK to datapreviously received
Piggybacking is faster and saves bandwidth
25
Stop-and-Wait ARQ Piggybacking
26
-
8/6/2019 Lecture 18 - Flow Control
14/14
Sliding Window Protocol - Piggybacking
When using sliding window protocol in full duplexconnections:
Node A maintains its own transmit window
Node B maintains its own transmit window
A frame contains: data field + ACK field
There is a sequence number for the data field, and asequence number for the ACK field
27
Assignment
28