Sliding windows and congestion control

Sliding window: used for flow control:
1. The sender and the receiver maintain an independent send buffer and receive buffer
2. The window is a sequence of bytes that are allowed to be sent
3. The receiver will tell the receiver according to the receiver buffer The sender's own receiving window size, unlike the sender, when a data segment times out, it can be considered that the network is congested
4. The sender will send data according to this window size
5. The receiver will reply to confirmation after receiving the data ACK, this ACK may be accumulated, and the end of receiving multiple messages will reply an ACK
6. The sender receives the confirmation number, moves the sending window forward, closes the retransmission timer, and deletes the data backup from the queue, otherwise it needs to Retransmission of data


Congestion control: Flow control only considers the status of the sender and the receiver itself, while congestion control is considered based on the entire network. If all timeouts in the network are retransmitted, it will lead to greater packet loss
cwnd (congestion) . Window): The sender names a dynamically changing window congestion window, the size of which depends on the degree of network congestion. The sender generally makes its own sending window equal to the congestion window. When the network is good, it will continue to grow larger
ssthresh (slow speed Start threshold): such a variable is saved by the sender. When the bytes in the congestion window reach this threshold, the congestion control algorithm needs to be adjusted. In most implementations, the ssthresh value is 65536 bytes.

Congestion control algorithm:
Example: Initial cwnd is equal to 1, ssthresh is equal to 20, network congestion is equal to 28
1. Congestion avoidance: 1, 2, 3, 4, 5, 6...28

2. Slow start (AMID: addition increases, multiplication decreases):
a. 1, 2, 4, 8, 16, 20 (can not exceed ssthresh when cwnd doubles)...28 (congestion occurs, set ssthresh to half of cwnd 14, set cwnd to 1, and then repeat this process)//multiplication and subtraction Small*1/2
b. 1, 2, 4, 8, 14, (cwnd(14) is equal to sthresh(14), slow start is disabled, congestion avoidance algorithm is used), 15, 16, 17,...27//Additional increase, +1

3. Fast retransmission: The receiver sends a repeated confirmation immediately after receiving an out-of-sequence segment, instead of waiting for it to send data before piggybacking
a.1, 2, 4, 8, 16, 20, 21...28
b. When the sender sends... 27, 28, it receives the ack of... 25, 26, 27, but does not receive the ack of 28
c. The receiver will confirm... 27 ack, but will not confirm the ack of 28, which will continuously reply to the ack of 28
d. When the sender receives three acks of 28 in the connection, it does not need to wait for the retransmission timer to expire, and directly retransmits the unacknowledged 28

4 . Fast recovery a. 1, 2, 4, 8, 16,
20...28
b. When the sender receives three 28 acks on the connection, set (ssthresh halved to 14, cwnd to half of ssthresh 7)
c.7,8...28

, whether it is slow start or fast recovery, when network congestion occurs, ssthresh and cwnd will drop rapidly to reduce the number of packets injected into the network

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326116821&siteId=291194637