Sliding Window Protocol - Protocol Operation

Protocol Operation

The transmitter and receiver each have a current sequence number nt and nr, respectively. They each also have a window size wt and wr. The window sizes may vary, but in simpler implementations they are fixed. The window size must be greater than zero for any progress to be made.

As typically implemented, nt is the next packet to be transmitted, i.e. the sequence number of the first packet not yet transmitted. Likewise, nr is the first packet not yet received. Both numbers are monotonically increasing with time; they only ever increase.

The receiver may also keep track of the highest sequence number not yet received; the variable ns is one more than the sequence number of the highest sequence number received. For simple receivers that only accept packets in order (wr = 1), this is the same as nr, but can be greater if wr > 1. Note the distinction: all packets below nr have been received, no packets above ns have been received, and between nr and ns, some packets have been received.

When the receiver receives a packet, it updates its variables appropriately and transmits an acknowledgment with the new nr. The transmitter keeps track of the highest acknowledgment it has received na. The transmitter knows that all packets up to, but not including na have been received, but is uncertain about packets between na and ns; i.e. nanrns.

The sequence numbers always obey the rule that nanrnsntna + wt. That is:

  • nanr: The highest acknowledgement received by the transmitter cannot be higher than the highest nr acknowledged by the receiver.
  • nrns: The span of fully received packets cannot extend beyond the end of the partially received packets.
  • nsnt: The highest packet received cannot be higher than the highest packet sent.
  • ntna + wt: The highest packet sent is limited by the highest acknowledgement received and the transmit window size.

Read more about this topic:  Sliding Window Protocol

Famous quotes containing the word operation:

    It requires a surgical operation to get a joke well into a Scotch understanding. The only idea of wit, or rather that inferior variety of the electric talent which prevails occasionally in the North, and which, under the name of “Wut,” is so infinitely distressing to people of good taste, is laughing immoderately at stated intervals.
    Sydney Smith (1771–1845)