当前位置:网站首页>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 .
边栏推荐
- FMT开源自驾仪 | FMT中间件:一种高实时的分布式日志模块Mlog
- std::true_type和std::false_type
- 面试突击62:group by 有哪些注意事项?
- Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
- 【.NET CORE】 请求长度过长报错解决方案
- 【Android】Kotlin代码编写规范化文档
- Open source and safe "song of ice and fire"
- C language exchanges two numbers through pointers
- HMS Core 机器学习服务打造同传翻译新“声”态,AI让国际交流更顺畅
- 开源与安全的“冰与火之歌”
猜你喜欢

编译原理——自上而下分析与递归下降分析构造(笔记)

Take you through ancient Rome, the meta universe bus is coming # Invisible Cities

酷雷曼多种AI数字人形象,打造科技感VR虚拟展厅

历史上的今天:Google 之母出生;同一天诞生的两位图灵奖先驱

传输层 拥塞控制-慢开始和拥塞避免 快重传 快恢复

QT中Model-View-Delegate委托代理机制用法介绍

Getting started with pytest ----- allow generate report

30 分钟看懂 PCA 主成分分析

Selected technical experts from China Mobile, ant, SF, and Xingsheng will show you the guarantee of architecture stability
![[Android] kotlin code writing standardization document](/img/d5/53d6a75e87af15799bf7e5d6eb92a5.png)
[Android] kotlin code writing standardization document
随机推荐
The easycvr authorization expiration page cannot be logged in. How to solve it?
F200——搭载基于模型设计的国产开源飞控系统无人机
Mysqlimport imports data files into the database
ADB common commands
78 岁华科教授逐梦 40 载,国产数据库达梦冲刺 IPO
面试突击62:group by 有哪些注意事项?
std::true_type和std::false_type
sql语句优化,order by desc速度优化
面向程序员的精品开源字体
[Android] kotlin code writing standardization document
10 advanced concepts that must be understood in learning SQL
Jielizhi obtains the currently used dial information [chapter]
Wechat applet obtains mobile number
偷窃他人漏洞报告变卖成副业,漏洞赏金平台出“内鬼”
Stealing others' vulnerability reports and selling them into sidelines, and the vulnerability reward platform gives rise to "insiders"
2022暑期项目实训(三)
Compilation Principle -- C language implementation of prediction table
J'aimerais dire quelques mots de plus sur ce problème de communication...
Getting started with pytest ----- test case rules
關於這次通信故障,我想多說幾句…