TCP uses sliding windows to achieve traffic control the basic unit of data is not a data segment, but a byte
The sliding window is essentially the data that describes the size of the TCP datagram buffer for the recipient (local), and the sender calculates the maximum amount of data it can send based on that data. If the sender receives a TCP datagram with a window size of 0 for the receiver, the sender stops sending the data until the receiver sends a datagram with a window size of 0. TCP uses sliding window mechanism to achieve flow control
The sending window cannot exceed the value of the accepted window given by the receiving party. When Rwnd=0, it is not allowed to send data, only to a new window value issued by B. Suppose B sends a new window segment to a, which is lost during transmission, a waits for B to send a notification of a non-0 window, and b waits for a to send the data, which creates a deadlock situation.
To solve this problem, TCP has a continuous timer for each connection and, if the continuous timer expires, sends a probe segment (with only one byte), and the current window value is given when the caller confirms it.
TCP stipulates that even though the 0 window, it must accept the 0 window to explore the text segment, confirm the message segment and the message segment carrying the emergency data.
Sliding window protocol is a kind of traffic control method used by TCP, both sender and receiver have a certain size buffer, which allows the sender to send multiple packets in succession before stopping and waiting for confirmation, this protocol can speed up the transmission of data. It is stated in the agreement that a retransmission is required for an unconfirmed group within a window. The number of such groupings can be at most equal to the size of the sending window.
TCP Sliding window