当前位置:网站首页>Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery

Transport layer congestion control - slow start and congestion avoidance, fast retransmission, fast recovery

2022-07-06 18:10:00 Zhang quandan, Foxconn quality inspector

At both ends of the communication TCP The protocol should feel whether the network is unblocked when sending data packets , If the network is blocked , Packet loss occurred , They will automatically reduce the sending speed , If the network is unblocked, it will improve the sending speed .

Congestion is a dynamic , For example, there will be traffic jams on the way to and from work , It's the jam caused by everyone's cars running on the road .

The computer on the left and the computer on the right should communicate , The traffic of communication passes through this link , The bandwidth of links is limited , such as 1G, Gigabit bandwidth , Pouring in from one side 700M The bandwidth of the , From the other side 600M bandwidth , Have to go through this 1000M The link to , The maximum value has been exceeded , There must be some packets lost .

If there is packet loss , Or nothing , How to send it , Issued 200 individual , lost 100 Resend again 100 individual , It's no use sending too much , Still have to resend , Just slow down , Issued 100 Lost one 50 individual , Then send it next time 10 individual , Hair 10 Lose your hair again 5 individual , No more 1 individual , Send it after receiving the confirmation . This will reduce the speed , Not connected . This is congestion control , Congestion avoidance .

As you can see above, throughput is the traffic over the link , Throughput is in two directions , Adding two directions to one is called throughput .

How much to send at the beginning , Throughput is how much , As the load increases , At this time, packet loss will occur , After that, the load increases, causing slight blockage , And then increase the flow inside , At this time, packet loss is more serious , Lose it - There are so many bags below , Throughput increase , Probably 1 I can't get a bag through , crashed .

As the load you input into the network increases , The throughput on the link does not increase , But lower , This is congestion , We should avoid this situation , Control congestion to mild congestion .

 

 

Congestion control methods — Slow start and congestion avoidance


  Internet recommended standards RFC2581 Four congestion control algorithms are defined , Slow start (Slow-start)、 Congestion avoidance (Congestion Avoidance)、 Fast retransmission (Fast Restransmit) And reply quickly (Fast Recovery), We assume that : Data transmission in one direction , The other direction only sends confirmation . The receiver always has enough cache space , Therefore, the size of the transmission window is determined by the congestion degree of the network .

 

 

Slow start


  When communicating ,b Computer , Will tell a How big is the computer acceptance window , maximal MSS How much is the , That is, what is the largest segment , Although I told it , The acceptance window is 3000, It also does not set the send window to 3000, Because in a There is also a congestion window at this end , At first, the sending window is equal to the congestion window , The congestion window sends a segment first , because a I don't know how the network is , Try one first , Send a packet receive confirmation , The network status is ok , It changes the sending window to 2 了 , Next time, send two consecutive paragraphs , After is 2 Multiple increase in transmission speed .

The congestion window is 2 Increase by times , The congestion window is equal to the sliding window . Until it increases to b The computer told her the size of the sending window

a The sending window is controlled by two , One is congestion window control, and the other is b Computer acceptance window control , It finds which window is the smallest , Just use which window as the sending window .

so a The sending window of is controlled by the congestion window . First hair 1 individual , then 2 4 8 Until it is as big as the receiving window .

Congestion avoidance


  On the left is the congestion window , Unit is byte , A message segment is still in accordance with 100 In bytes , Slow start from 1 Start , Send one first to see if you can receive , You can see that the congestion windows are growing in multiples , Window arrival 1600 Two bytes later , The next round is not exponential , But add 1 Linear growth , here we are 12 During the round, there is network congestion and packet loss , At this time, the slow start threshold is divided by 2 Change into 1200, Its congestion window starts from 1 Here we go ,1200 Reaching the slow start threshold , And then +1.

Each time , Start dropping packets , Slow start threshold starts to adjust , And then from 1 2 4 8 Start like this , This is called slow start , This can avoid network congestion ,

 

 

Congestion control methods — Fast retransmission and fast recovery


Send data when sending m1 m2 m3, I found the third one missing , Wait until the timeout and retransmit , In this case, the efficiency is not high , Send it immediately if it doesn't arrive here 3 A repeated confirmation , Tell the opposite end of the law the third , There's no waiting for the timeout , Send immediately , Send the paragraph immediately .

Fast retransmission means that the opposite end finds that the packets do not arrive in order , If you find a packet loss, send it continuously 3 A package , Confirm this package , On the other side 3 individual , Equivalent to urgent , I immediately lost my bag , There is no need to wait for the timeout . 

 

  Fast recovery algorithm rather than slow start algorithm

The front is the same as before , Slow start threshold +1, When packet loss is found, divide the full start threshold 2, This is the new slow start threshold , This time is not from 1 Here we go , Starting from the new full threshold . This is called quick recovery , Not from below .

If arrive 4000 Start dropping packets , Then adjust the slow start threshold to 2000, And then add , And so on . 

  You can see up here TCP The protocol can sense the network situation , Automatically adjust the sending speed .

 

 

 

The upper limit of the send window


The upper limit of the sending window is controlled by two factors , One cwnd Congestion window ,rwnd Accept window , Select the minimum value .

If the congestion control discussed in this section is considered together with the flow control of the receiver to the sender , So obviously , The upper limit of the sender's window should be the receiver's window rwnd And congestion windows cwnd The smaller of these two variables , in other words : Upper limit of sender window = Min [rwnd,cwnd] When rwnd<cwnd when , Is the receiver's receiving capacity limit the maximum value of the sender's window . conversely , When cwnd<rwnd when , The congestion limit of the network is the maximum value of the sender window . in other words ,rwnd and cwnd The smaller one controls the rate at which the sender sends data .

 

 

原网站

版权声明
本文为[Zhang quandan, Foxconn quality inspector]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061010011838.html