当前位置:网站首页>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 .
边栏推荐
- Dichotomy (integer dichotomy, real dichotomy)
- UDP协议:因性善而简单,难免碰到“城会玩”
- 面试突击62:group by 有哪些注意事项?
- Appium automated test scroll and drag_ and_ Drop slides according to element position
- MarkDown语法——更好地写博客
- Insert dial file of Jerry's watch [chapter]
- Compilation Principle -- C language implementation of prediction table
- Jerry's access to additional information on the dial [article]
- The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
- 编译原理——预测表C语言实现
猜你喜欢
Jerry's access to additional information on the dial [article]
Introduction to the usage of model view delegate principal-agent mechanism in QT
C语言通过指针交换两个数
It doesn't make sense without a distributed gateway
李書福為何要親自掛帥造手機?
The easycvr platform reports an error "ID cannot be empty" through the interface editing channel. What is the reason?
Pytest learning ----- pytest confitest of interface automation test Py file details
C language exchanges two numbers through pointers
J'aimerais dire quelques mots de plus sur ce problème de communication...
传输层 拥塞控制-慢开始和拥塞避免 快重传 快恢复
随机推荐
HMS core machine learning service creates a new "sound" state of simultaneous interpreting translation, and AI makes international exchanges smoother
微信为什么使用 SQLite 保存聊天记录?
Nodejs developer roadmap 2022 zero foundation Learning Guide
C language exchanges two numbers through pointers
J'aimerais dire quelques mots de plus sur ce problème de communication...
Pytest learning ----- detailed explanation of the request for interface automation test
2019 Alibaba cluster dataset Usage Summary
VR全景婚礼,帮助新人记录浪漫且美好的场景
Rb157-asemi rectifier bridge RB157
Jerry's watch deletes the existing dial file [chapter]
【Android】Kotlin代码编写规范化文档
传统家装有落差,VR全景家装让你体验新房落成效果
开源与安全的“冰与火之歌”
There is a gap in traditional home decoration. VR panoramic home decoration allows you to experience the completion effect of your new house
Alibaba brand data bank: introduction to the most complete data bank
递归的方式
Open source and safe "song of ice and fire"
趣-关于undefined的问题
Wechat applet obtains mobile number
历史上的今天:Google 之母出生;同一天诞生的两位图灵奖先驱