1. traffic control is used to manage the traffic at both ends, so as not to cause the receiving end to overflow due to sending blocks, or to waste time due to the handling speed of the receiving end. Used: Sliding Window, in bytes
2. window has three actions: expand (right), collapse (left to right), and contract (Right to left). These three actions are controlled by the receiving end.
Union: indicates that the corresponding bytes have been confirmed.
Expand: allows the cache to send more bytes.
Shrink (not expected, some implementations are forbidden): indicates that the message can be sent, but cannot be sent now. However, if the scaled message is sent, the problem may occur; to avoid this, the receiving end will not communicate until there is more cache space in the cache.
The size of the Start window depends on the size of the Receiving Window rwnd (the window size field of TCP packets) and the size of the congestion window cwnd (see congestion control)
Size of the Start window = min {rwnd, cwnd };
3. Close the window: if the window is scaled back, rwnd = 0 indicates that the window is unwilling to receive data temporarily. In this case, the initiator does not contract the window, and the other is to stop sending data. (In order to avoid deadlocks, some test reports are used to send the test regularly. For details, see the timer section)
4. problem: in some cases, because the data at the initiator or receiver is slow, a large amount of 1-byte data may be pity and a lot of resources are wasted.
(1) When the originating process produces data slowly, one byte of data is sent from time to time, So TCP will send one byte and one byte, with low efficiency.
Solution (NagleAlgorithm):
A. Send the first data block
B. Then, wait until the sending cache has enough data (maximum packet segment length), or wait until the receiving end confirms the ACK before sending data.
C. Process of repeating B
(2) because the receiving process consumes a low amount of data, the receiving end may send the information with a window size of 1 and transmit the data in 1 byte.
Solution (2 types)
A. Clark method: Before half of the received cache is empty, or there is enough space for the maximum packet length, the size of the receiving window is 0.
B. Delayed confirmation: wait until the received message segment is confirmed, or wait for a period of time (usually 500 ms)