Saturday, July 13, 2013
As discussed in part 1 of this article, the sliding window protocol is a type of the packet based data transmission protocol. The sliding window protocols are used in regulating the reliability factor of the data transmission.
In this second part we discuss about the motivation behind this protocol and how it actually operates.
- There are a number of communication protocols based up on the automatic repeat request for regulating the error control.
- In such protocols, it becomes necessary for the receiver for acknowledging about the packets it received.
- If the receiver does not send an ACK to the transmitter within a specified time period, then the transmitter assumes that the packet might have got lost, re-transmits it.
- It is obvious that if a transmitter does not receives an ACK for the packet it had sent cannot actually know if the packet got delivered correctly.
- If, suppose corruption is detected during error detection process on the receiver’s side; the receiver will simply ignore this packet and hence, will not send any ACK to the transmitter.
- Now in the same way, the receiver also does not know whether the ACK it sent was received by the transmitter or it got lost or damaged during the transmission.
- In such a case, the re-transmission must be acknowledged by the receiver in order to prevent the continuous re-sending of the data by the transmission.
- In other cases it is simply ignored.
How the protocol operates?
- The current sequence numbers say nt and nr is assigned to transmitter and receiver respectively.
- Both of them have their window sizes say wt and wr respectively.
- In simple implementations of the protocols these sizes are fixed however, they may vary when it comes to the larger and complex implementations.
- For making any progress, it is necessary that the size of the window must be more than zero.
- In a typical implementation, nt denotes the packet to be transmitted.
- Similarly nr denotes the packet not received.
- Both of these numbers increase with the time monotonically.
- The receiver also has to keep an eye on the highest sequence number that has not been received yet.
- We have another variable called ns which is one number greater than the highest sequence number that has been received.
- There are simple receivers which accept the packets only in the order of wr = 1 which is nothing but same as the nr.
- But in some cases it can exceed 1.
Now we can say that:
1. Below nr no packets have been received.
2. Above ns no packets have been received.
3. It is only between nr and ns that some packets have been received.
- Whenever a packet is received, its variables are updated appropriately by the receiver and at the same time an ACK is transmitted with the updated value of nr.
- Similarly we have variable na used by the transmitter for tracking the highest ACK it has received.
- Below na all the packets have been received but there is uncertainty about the packets between ns and na i.e, the nr.
- There are certain rules that are always obeyed by the sequence numbers:
Ø Na ≤ nr: The highest ACK the transmitter has received cannot exceed the highest nr recorded by the receiver.
Ø Nr ≤ ns: The partially received packets’ end cannot be greater than the span of those fully received.
Ø Ns ≤ nt: The highest packet sent is always greater than the highest packet received.
Ø Nt ≤ na + wt: The highest ACK received and the window size set the limits for the highest packet sent.