Sliding Window is the method of flow control TCP uses. The algorithm basically places a buffer between the application and the network data flow. The purpose of sliding window is to prevent from the sender to send too many packets to over flow the network resource or the receiver’s buffer. The “sliding window size” is the maximum amount of data we can send without having to wait for ACK. TCP achieve the flow control by using the sliding Window algorithm which takes into consideration 2 important parameters. The first one is the receiver advertised window size which basically tells the sender what is the current buffer of TCP receiver, the second parameter is congestion window which control the number of packets a TCP flow may have in the network in any given time.
Receiver Advertised Window
The Receiver Advertised Window (adwn) is the buffer size sent in each ACK from TCP receiver to TCP sender. The TCP header uses a 16 bit field to report the receive window size to the sender. Therefore, the largest window that can be used is 2^16=65k bytes..
Congestion Window (cwnd) controls the number of packets a TCP flow may have in the network in any given time. cwnd is dynamically adapting to changing network condition Slow-start is one of the algorithms that TCP uses in its quest to control congestion inside the network and it is also known as the exponential growth phase. Slow-start works by increasing the TCP congestion window each time the ACK is received. it increases the window size by the number segments acknowledged. If a loss event occurs, TCP assume this is due to network congestion and takes step to reduce the offered load on the network.