CS455 Syllabus

The Sender Window

• Sender window

• Sender window:

 Sender window = the serie of send sequence numbers that the sender can use to identify a outstanding frame

• Computing the sender window:

 ``` sender window = [ next send seq# .. (next frame# + send buff. size − 1) ] ```

Example:

• Suppose:

 the next send sequence number that the sender will use = 1 sender buffer size = 4

Then the sender window is equal to:

 ``` 1, 2, 3, 4 ```

Because:

• # outstanding data frame     sender window size (4)

• Numbering 4 data frames starting with 1:

 ``` 1, 2, 3, 4 ```

• Graphically:

Note:

 The sender can send less than 4 data frames (if it does not have that many frames).

• How the sender window changes (= "moves")

• Update algorithm for the sender window:

 ``` Let Sender Window = [ A .. B ] Sender receives an ACK frame Let X = recv seq no in received ACK frame if ( X == A ) { for ( each Y = A, A+1, ..., B ) do { if ( frame Y has been acknowledged ) { Release buffer for frame Y Sender Window = [Y .. Y + (B-A) +1)] // I.e.: set sender window to [Y .....] } } } ```

• Example 1:

• Suppose the current sender window is:

 ``` Sender window = 1, 2, 3, 4 ```

• The sender transmits the next data frame:

The next data frame will use the first available number in the sender window is its send seq. no.!!!

• When the sender receives the ACK frame, the send window will be updated to [2,3,4,5]:

• Example Program: (Demo above code)

• Prog file: /home/cs455000/demo/SelAck/run

How to run the program:

 Send 1 new frames

• Example 2:

• Suppose:

 Sender window = [1,2,3,4]

Events:

 The sender transmits frames 1,2,3,4 But: Frame 1 is lost The receiver transmits back ACK frames 2,3,4

How the sender process the received ACK frames:

 ``` Sender window = [1 .. 3] ACK 2: 2 == 1 ? No (do not update sender window) ACK 3: 3 == 1 ? No (do not update sender window) ACK 4: 4 == 1 ? No (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 sender times out and retransmits frame 1 and frame 1 was received correctly

 Sender window = [1,2,3,4]

Events:

 The sender retransmits frame 1 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 release all 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

• Example Program: (Demo above code)

• Prog file: /home/cs455000/demo/SelAck/run

How to run the program:

• Send 2 new frames
• Pause
• Click on frame 0 and kill it
• Resume

Observe that:

 The Sender window will slide only when the retransmission was received and ACKed

• "Sliding" window

• The movement of the sender window is called:

• "Sliding" window:

 ``` 0 1 2 3 4 5 6 7 8 9 | | window 1 +----------+ | | window 2 +----------+ -------> sliding movement ```

• The reliability protocol that uses sender/receiver windows are called:

 Sliding window schemes