Send Window =
the list of
sequence numbers
that the sender can
use to
label (= identify)
an
outstanding frames
Example:
Note:
# outstanding frame
of the sender≤
send window size !!!
Updating the send/sender window
(= "slides")
Reminder:
ACK nacknowledgesonly the
data frame n
Update algorithm for
the sender window:
Let Sender Window = [ A .. B ]
Sender receives an ACK X frame
(I.e.: X = recv seq no in received ACK frame)
/* ==============================================
X = the number in the ACK X frame
============================================== */
if ( X == A )
{
/* ==============================================
"Slide" the window forward
============================================== */
i = A;
while ( i ≤ B ) do
{
if ( frame i has been acknowledged )
{
Release buffer for frame i
i++; // Check next frame in send window
}
else
{
break; // Stops at the first unacknowledge frame
}
}
Sender Window = [i, i+1, .., i+(B-A)+1)]
// Update (slide) sender window to start at [i .....]
}
Example 1:
Suppose the currentsender window is:
Sender window = 1, 2, 3, 4
The sender transmits
the next data frame:
The nextdata frame will
use the first available
number in the
sender window is
its send seq. no.!!!
When the senderreceives the ACK frame,
the send window will
be updated to
[2,3,4,5]:
Sender window = [1 .. 3]
Received ACK 2:
Test 2 == 1 ? No - Done
(do not update sender window)
Received ACK 3:
Test 3 == 1 ? No - Done
(do not update sender window)
Received ACK 4:
Test 4 == 1 ? No - Done
(do not update sender window)
Graphically:
Note:
The sender window does
not slide forward !!!
(because
no send buffer has been
released !!!).
Example 3:previous example continues
The sendertimes out and
retransmitsframe1
and
frame 1
was received correctly
Current sender/receiver windows:
Sender window =
[1,2,3,4]
Events:
The sender
retransmits
frame1
Frame 1 is
received
The receiver transmits
ACK frame 1
How the
sender process the
received ACK frame (#1):
Send window = [1 .. 3]
ACK 1: 1 == 1 ? Yes
for each frame Y = 1, 2, 3, 4 do:
Y = 1: Y is ACKed ? Yes
===> Release buffer for frame 1
Sender Window = [2 .. 5]
Y = 2: Y is ACKed ? Yes
===> Release buffer for frame 2
Sender Window = [3 .. 6]
Y = 3: Y is ACKed ? Yes
===> Release buffer for frame 3
Sender Window = [4 .. 7]
Y = 4: Y is ACKed ? Yes
===> Release buffer for frame 4
Sender Window = [5 .. 8]
Graphically:
Result:
The sender will releaseall 4 buffered frames (1,2,3,4)
Now the sender window will
slide forward by
4 positions
The sender will now buffer
the data frames 5,6,7,8