Sliding window
|
In transmit flow control, sliding window is a variable-duration window that allows a sender to transmit a specified number of data units before an acknowledgement is received or before a specified event occurs.
An example of a sliding window in packet transmission is one in which, after the sender fails to receive an acknowledgement for the first transmitted packet, the sender "slides" the window, i.e. resets the window, and sends a second packet. This process is repeated for the specified number of times before the sender interrupts transmission. Sliding window is sometimes (loosely) called acknowledgement delay period.
For example, supposing a fixed window size of <math>m<math> packets, a sender may send out packets <math>[n \ldots (n+m-1)]<math> before receiving any acknowledgement. If acknowledgement arrives from the receiver for packet <math>n<math>, then (a) the sender is able to send out packet <math>(n+m)<math>, (b) it doesn't need acknowledgement for packet <math>n<math> anymore; thus the range (window) of unacknowledged packets slides to <math>[(n+1) \ldots (n+m)]<math>. In some way, "sliding" means a FIFO operation, trimming the range at one end, extending it at the other end.
The purpose of the sliding window is to increase throughput. Let's denote the round trip time with RTT. The time necessary to transfer and acknowledge <math>K<math> (a big number of) packets is roughly <math>\operatorname{RTT} \cdot K/(2m)<math> (in one round trip, <math>2m<math> packets and <math>2m<math> ACKs are delivered). However, the size of the window (in bytes) should not grow above "capacity of the path" (the sum of affected network buffer sizes of all hops along the path); windows too big don't increase throughput, just latency, number of packets transmitted out-of-order, and memory usage.
In practice, protocols often adapt the window size to the link's speed and actual saturation or congestion.
See also
- Federal Standard 1037C
- RFC 1323 - TCP Extensions for High Performance
- TCP window scaling and broken routers (http://lwn.net/Articles/92727/), 2004
- Sliding Window Demo (http://www2.rad.com/networks/2004/sliding_window/) (Flash required)
- Sliding Window Demo (http://www.humboldt.edu/~aeb3/telecom/SlidingWindow.html) (Shockwave required)