CS455 Syllabus

### Condition for unambiguity with finite sequence numbers

• Pre-requisite to understanding this material: relationship between the send window and receive window

• Consider the following sliding window setting:

 N = 4   (we use 4 sequence numbers)         Send window size = 3 Receive window size = 3

• Initially:

• The send/receive windows are lined up

• Suppose the receive window is now: [3,0,1]

Question:

 What are the possible values for the send window ???

• The possible values for the send window are:

 [0,1,2]        [1,2,3] [2,3,0] [3,0,1]

Graphically:

Reason:

• The send window can fall the farthest behind the receive window as possible:

This happens when all ACK frames were lost

• The send window can line up (= farthest ahead) with the receive window:

This happens when all ACK frames were received

• When some of the ACK frames were received (and some were lost), the send window can be [1,2,3] or [2,3,0]

• How is ambiguity "created"

• Fact:

• Ambiguity is "created" (= caused) by a sequence number x when:

 The sequence number x is inside the receiver window The sender can use the sequence number x to identify   two (2) different (data) frames

Example:

• Initially, the send window and receive window are lined up:

Without loss of generality, we can assume that:

 The sender window and receiver window are lined up at the sequence number 0 (The argument will work for any sequence number. It is easier to understand using as starting sequence number = 0)

• Pay attention the sequence number 0 inside the receive window

It is now possible for the sender to use confuse the receiver by using sequence number 0:

1. The sender could have fallen behind and re-transmit the frame #1 using the sequence number 0 to the receiver:

2. The sender could have caught up and sends the frame #(N+1) using the sequence number 0 to the receiver:

• How to prevent ambiguity:

• For every sequence number x inside the (= any) receive window

 We make sure that the sender cannot use sequence number x to identify two different frames !!!!!!

• A concrete example on how to prevent ambiguity

• Consider the following sliding window setting:

 N = 4   (we use 4 sequence numbers)         Send window size = 2 Receive window size = 2

• Suppose that the receive window is [2,3]:

• The possible values of the send window of the sender are

• [0,1]
• [1,2]
• [2,3]

• The sender cannot confuse the receiver because:

1. The sender can only use the sequence number 2 to identify frame #3

The sender can only use the sequence number 3 to identify frame #4

The sender cannot use the sequence number 2 or 3 (in the receive window) to identify 2 different frames !!!

Therefore:

 No ambiguity possible !!!!!!

• Another example to how to prevent ambiguity

• Consider the following sliding window setting:

 N = 4   (we use 4 sequence numbers)         Send window size = 3 Receive window size = 1

• Suppose that the receive window is [3]:

• The possible values of the send window of the sender are:

• [0,1,2]
• [1,2,3]
• [2,3,0]
• [3,0,1]

• The sender cannot confuse the receiver because:

1. The receive window = [3]

That mean:

 The receiver will only buffer the frame with sequence number 3 !!!

2. Within the range of the send window values:

The sender can only transmit the frame #4 using the sequence number 3:

• Sufficient condition to guarantee unambiguity (with proof)

• Sufficient condition that guarantee that a sequence number in the send window will uniquely identifies a unique frame:

• Let N = the number of different sequence numbers available
• Let Wsend = the send window size
• Let Wrecv = the receive window size

• If:

 ``` (1) Wsend + Wrecv ≤ N ```

then:

 A sequence number in the send window will uniquely identifies one specific frame

Proof:

• The labeling of the data frames is as follows:

• Consider an arbitrary receive window:

(The proof is similar for other windows, but this specific window make the explanation easier to understand)

• The farthest behind value for the send window is:

• The farthest ahead value for the send window is:

• Within the range of possible values for the send window:

each value inside the receive window (Wrecv) is used to identify one (1) specific frame:

Therefore:

 Ambiguity is not possible

 ``` Wsend = 2N-1 Wrecv = 2N-1 ```