CS455 Syllabus

### The Sender Window

• Send/Sender window

• Send/Sender window:

• 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 n acknowledges only 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 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: (cd /home/cs455001/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] 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 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