CS 313 Introduction To Computer Networking & Telecommunication Data Link Layer Part II - Sliding Window Protocols
CS 313 Introduction To Computer Networking & Telecommunication Data Link Layer Part II - Sliding Window Protocols
Part 2 - Topics
Full-duplex - approach 2
Same circuit for both directions
Data and acknowledgement are intermixed
How do we tell acknowledgement from data?
Approach 3
Attaching acknowledgement to outgoing data
frames
Piggybacking
4
Piggybacking
Temporarily delaying transmission of
outgoing acknowledgement so that they can
be hooked onto the next outgoing data frame
Advantage: higher channel bandwidth
utilization
Complication:
Piggybacking
Sending Window
Contains frames can be sent or
have been sent but not yet
acknowledged outstanding frames
When a packet arrives from network
layer
10
Sending Window
If the maximum window size is n,
n buffers is needed to hold
unacknowledged frames
Window full (maximum window
size reached)
shut off network layer
11
Receiving Window
Contains frames may be accepted
Frame outside the window
discarded
When a frame's sequence number
equals to lower edge
Receiving Window
Contains frames may be accepted
Always remains at initial size (different
from sending window)
Size
Actually, 1-bit
sequence
number is
enough for
this example.
The purpose
of using 3-bit
is to
demonstrate
the idea of
sliding
window.
14
15
16
Case 1: no
error
(1,0,A1)
(0,1,A0)
*
(1,1,B1) Exp=0
*
Exp=0
(0,1,A2)
*
(0,0,B2) Exp=1
*
(0,0,B0) Exp=1
*
Exp=1
Try to draw the sending
windows and receiving
windows for A and B!
17
Case 3: data
error
Time
Exp=0
A (0,1,A0)
B
Timeout
Error
Timeout
(0,1,A0)
(0,0,B0)
*
Exp=1
(0,1,A0)
Exp=0
*
(0,0,B0) Exp=1
X
(0,1,A0)
*
Exp=1
(0,0,B0)
duplicate,
discarded
*
Exp=1
Try to draw the sending
windows and receiving
windows for A and B!
18
Case 5: early
timeout
Time
Exp=0
Exp=0
Case 6: outgoing
frame timeout
Time
(0,1,A0)
A
A
B
Exp=0 (0,1,A0) Exp=0
Timeout
*
B
(0,0,B0) Exp=1
*
Exp=1
(0,1,A0)
*
Exp=1
duplicate,
(1,0,A1)
ACK 0
Timeout
discarded
*
Exp=0
(1,1,A1)
(1,1,B1)
*
*
(0,1,B0) Exp=0
Exp=0
*
Exp=1
19
Performance of Stop-and-Wait
Protocol
Assumption of previous
protocols:
Transmission time is negligible
False, when transmission time is long
t
0
20
270
520
20
Performance of Stop-and-Wait
Protocol
If channel capacity = b, frame size
= L, and round-trip propagation
delay = R, then bandwidth
utilization = _____
Conclusion:
21
Performance of Stop-and-Wait
Protocol
Solution: Pipelining
Allowing w frames sent before blocking
Problem: errors
Solutions
22
Go Back n Protocol
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
Go Back n Protocol
24
Go Back n Protocol
S
Time 0 1 2 3 0 1 2 3 0
012301230
Frame 0
012301230
012301230
012301230
Frame 1
ACK 1
012301230
Frame 2
ACK 2
012301230
012301230
012301230
Frame 3
012301230
25
Go Back n Protocol
What is the maximum sending window
size?
Maximum sending window size of =
MAX_SEQ, not MAX_SEQ+1
Why?
26
Go Back n Protocol
Implementation
Sender has to buffer
unacknowledged frames
Acknowledge n means frames n,n1,n-2, ... are acknowledged (i.e.,
received correctly) and those
buffers can be released
One timer for each outstanding
frame in sending window
28
29
Negative Acknowledgement
(NAK)
SRP is often combined with NAK
When error is suspected by receiver,
receiver request retransmission of a
frame
30
k
Na
os
,l
31
012301230
012301230
012301230
012301230
012301230
Wheres the window now?
R
Frame 0
Frame 1
ACK 1
Frame 2
X
Frame 3
NAK 2
Frame 2
ACK or NAK?
012301230
012301230
012301230
012301230
012301230
Window size=(MAX_SEQ+1)/2
E.g., if 4-bit window is used, MAX_SEQ =
15
window size = (15+1)/2 = 8
36
Acknowledgement Timer
Problem
If the reverse traffic is light, effect?
If there is no reverse traffic, effect?
Solution
Acknowledgement timer:
If no reverse traffic before timeout
send separate acknowledgement
Essential: ack timeout < data frame
timeout Why?
37
Example: ADSL
ADSL