Based on P 248/265 [[computerNetworking]] and blogpost on AWS^SWS
Sliding window is a protocol or a design framework. AdvertizedWindowSize is an integer field in the Ack message. There are also two variables “ReceiveWindow/CongestionWindow” in the TCP sender codebase (part of kernel).
Sliding window kills two birds with one stone — 1) congestion control and 2) overflow protection on the receiving end. Without these controls, sender can pump packets too fast causing
- receiver socket buffer overflows
- congestion on the sender-to-receiver path so some of the router buffers overflow
Basic idea is limit sending rate such that
- unacknowledged bytes := lastByteSent – lastByteAcked < ReceiveWindow
- unacknowledged bytes := lastByteSent – lastByteAcked < CongestionWindow