当前位置:网站首页>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 .
边栏推荐
- How to solve the error "press any to exit" when deploying multiple easycvr on one server?
- 带你穿越古罗马,元宇宙巴士来啦 #Invisible Cities
- OpenEuler 会长久吗
- 递归的方式
- Will openeuler last long
- 一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
- d绑定函数
- This article discusses the memory layout of objects in the JVM, as well as the principle and application of memory alignment and compression pointer
- F200——搭载基于模型设计的国产开源飞控系统无人机
- SQL statement optimization, order by desc speed optimization
猜你喜欢
Jerry's access to additional information on the dial [article]
Unity tips - draw aiming Center
std::true_ Type and std:: false_ type
J'aimerais dire quelques mots de plus sur ce problème de communication...
8位MCU跑RTOS有没有意义?
Today in history: the mother of Google was born; Two Turing Award pioneers born on the same day
I want to say more about this communication failure
开源与安全的“冰与火之歌”
QT中Model-View-Delegate委托代理机制用法介绍
重磅!蚂蚁开源可信隐私计算框架“隐语”,主流技术灵活组装、开发者友好分层设计...
随机推荐
Introduction to the usage of model view delegate principal-agent mechanism in QT
Interesting - questions about undefined
容器里用systemctl运行服务报错:Failed to get D-Bus connection: Operation not permitted(解决方法)
Olivetin can safely run shell commands on Web pages (Part 1)
Implementation of queue
传输层 拥塞控制-慢开始和拥塞避免 快重传 快恢复
Compilation Principle -- C language implementation of prediction table
8位MCU跑RTOS有没有意义?
Interview shock 62: what are the precautions for group by?
一体化实时 HTAP 数据库 StoneDB,如何替换 MySQL 并实现近百倍性能提升
面向程序员的精品开源字体
Distinguish between basic disk and dynamic disk RAID disk redundant array
历史上的今天:Google 之母出生;同一天诞生的两位图灵奖先驱
Wechat applet obtains mobile number
Pourquoi Li shufu a - t - il construit son téléphone portable?
Comparative examples of C language pointers *p++, * (p++), * ++p, * (++p), (*p) + +, +(*p)
酷雷曼多种AI数字人形象,打造科技感VR虚拟展厅
78 year old professor Huake has been chasing dreams for 40 years, and the domestic database reaches dreams to sprint for IPO
Codeforces Round #803 (Div. 2)
Cool Lehman has a variety of AI digital human images to create a vr virtual exhibition hall with a sense of technology