当前位置:网站首页>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 .
边栏推荐
- 78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
- The latest financial report release + tmall 618 double top, Nike energy leads the next 50 years
- declval(指导函数返回值范例)
- F200——搭载基于模型设计的国产开源飞控系统无人机
- Unity tips - draw aiming Center
- Codeforces Round #803 (Div. 2)
- FMT open source self driving instrument | FMT middleware: a high real-time distributed log module Mlog
- Manifest of SAP ui5 framework json
- Will openeuler last long
- F200 - UAV equipped with domestic open source flight control system based on Model Design
猜你喜欢
带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
Why should Li Shufu personally take charge of building mobile phones?
MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
Declval (example of return value of guidance function)
【.NET CORE】 请求长度过长报错解决方案
Rb157-asemi rectifier bridge RB157
Scratch epidemic isolation and nucleic acid detection Analog Electronics Society graphical programming scratch grade examination level 3 true questions and answers analysis June 2022
Compilation Principle -- C language implementation of prediction table
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
Today in history: the mother of Google was born; Two Turing Award pioneers born on the same day
随机推荐
d绑定函数
传统家装有落差,VR全景家装让你体验新房落成效果
What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
Fleet tutorial 13 basic introduction to listview's most commonly used scroll controls (tutorial includes source code)
Interview shock 62: what are the precautions for group by?
Reppoints: advanced order of deformable convolution
sql语句优化,order by desc速度优化
【.NET CORE】 请求长度过长报错解决方案
Jerry's setting currently uses the dial. Switch the dial through this function [chapter]
重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
2019阿里集群数据集使用总结
Growth of operation and maintenance Xiaobai - week 7
Will openeuler last long
[Android] kotlin code writing standardization document
關於這次通信故障,我想多說幾句…
Pytest learning ----- detailed explanation of the request for interface automation test
MS-TCT:Inria&SBU提出用于动作检测的多尺度时间Transformer,效果SOTA!已开源!(CVPR2022)...
std::true_ Type and std:: false_ type
Cool Lehman has a variety of AI digital human images to create a vr virtual exhibition hall with a sense of technology
SQL statement optimization, order by desc speed optimization