当前位置:网站首页>UDP reliable transport protocol (quic)
UDP reliable transport protocol (quic)
2022-07-06 03:33:00 【Four in the domain】
UDP And TCP contrast
TCP Sticky subcontracting may occur
UDP impossible , And a frame of data must be read at one time , Otherwise, the unread part will be lost
Reliability mechanism
ACK Mechanism
That is, the response mechanism , Every time you receive a package, you will give it back ack, Let the sender know that the other party has received
Retransmission mechanism
ARQ Three modes of agreement
(1) Stop equation ARQ : wait for ACK, The opposite party was not received within the specified event ACK, Then retransmit the frame
(2) Back off n frame ARQ : Don't wait for the opposite ACK, Each package has a lifecycle , I didn't receive it before the end of my life ACK, Then go back to the package and re contract ( The packet after the error frame has been sent , Still need to resend )
(3) Selective retransmission ARQ : Don't wait for the opposite ACK, Each package has a lifecycle , I didn't receive it before the end of my life ACK, There is no need to go back to the package and re contract , Just resend the package
Flow control
Control the sending rate of the sender , To prevent the recipient from reading data in time , Cause the packet to be discarded after the cache is full
(1) The recipient informs the sender of the remaining cache space , So that the sender can control the sending rate
(2) If the sender stops sending because the other party's cache is full , Then the recipient needs to notify the sender to start sending
4. Congestion control
(1) Slow start : After network congestion , Try sending from a few packets , Gradually send packets exponentially , Until the number of packets returns to the normal number ( Because the bandwidth is getting larger , The scheme has been abandoned )
(2) Fast recovery : After network congestion , Try sending from half the packets , Increase gradually
Serial number mechanism
Rearrangement mechanism
Window mechanism
UDP Reliability design
UDP Window flow control
KCP( For real-time reasons )
RTO Double
TCP The timeout is calculated as RTO Time keeps doubling
KCP The medium super time is calculated as RTO Time is multiplied by 1.5( Empirical value , The test shows that this value is better )Retransmission mechanism
TCP Use fallback N frame ARQ Mechanism ( All retransmission )
KCP Use selective retransmission ARQ MechanismThe fast retransmission
Packet skipping occurs ( The packets received by the receiver are discontinuous , Several tundish are missing ), Don't consider... At this time RTO, Optimize the transmission efficiency in case of packet lossACK Delay
TCP In order to make better use of broadband , Delay to send ACK, such RRT Time is large
KCP You can set whether to delayACK、UNA
5.1 explain UNA: such as UNA 3, Means to inform sender, package 0、1、2 Have received , This is the time sender The swap will be released 0、1、2, If subsequent retransmission is required , These three packets will not enter the retransmission queue ,
5.2 KCP yes ACK+UNA Mechanism
5.3 TCP It's one of twoNo surrender, no flow control
TCP Use The law of fair concession ( Sending window size determinants : Send cache size , The remaining cache size at the receiving end , Packet loss concession , Slow start ),
KCP You can configure skipping Packet loss concession as well as Slow start , Make timeliness more powerfulCode path :https://github.com/skywind3000/kcp
Above for KCP Those who don't clear the explanation can go github Learn from , Again readme The optimized performance part is explained in detail in .
8. KCP The code architecture
QUIC
sketch
- Fast UDP network connections
- Google The proposed experimental network transmission protocol
- be located OSI Network model transport layer
- User mode is based on UDP Implemented transport layer
- To solve TCP The defects of the agreement will eventually replace TCP agreement , Reduce data transmission , Reduce connection setup latency , Speed up Web page transmission
- Document connection :https://quicwg.org/base-drafts/rfc9000.html
advantage
- Flexible congestion control mechanism ( Self actualization , You can also decide whether to use )
- No queue head blocking ( Every stream Separate from each other , Do not affect each other )
- Easy data migration ( After switching the network environment , No need to reconnect , Continue the previous connection channel and continue to transmit data )
- Baotou needs authentication , Data encryption in the package , Safety is better than TLS go beyond
- FEC Forward correction
shortcoming
- Putting it into the kernel has a great impact , All systems should be updated
- Router 、 A firewall 、 There are many intermediate devices that need to be changed
Message format
among Connection ID Is the connection number , It can reduce the number of three handshakes and four waves
Frame Type:
- bit01: stream ID length
- bit234: offset length
- bit5 : Yes no Data Length Field
- bit6: Indicates that the stream On the channel Whether sending data has ended , Whether it is half closed
- bit7: Identify whether the frame is stream frame
Stream ID One UDP There can be multiple Stream flow , The integrity of messages in each flow is independent of each other , In order to reduce abnormal times , Number of frames fallback
Establish low latency
边栏推荐
- SD卡報錯“error -110 whilst initialising SD card
- Research on cooperative control of industrial robots
- JS music online playback plug-in vsplayaudio js
- How to do function test well
- Remote Sensing Image Super-resolution and Object Detection: Benchmark and State of the Art
- [slam] orb-slam3 parsing - track () (3)
- Edcircles: a real time circle detector with a false detection control translation
- February 14, 2022 Daily: Google long article summarizes the experience of building four generations of TPU
- 【paddle】加载模型权重后预测报错AttributeError: ‘Model‘ object has no attribute ‘_place‘
- Shell pass parameters
猜你喜欢
SAP ALV单元格级别设置颜色
MySQL Server层四个日志
2.1 rtthread pin设备详解
3.1 detailed explanation of rtthread serial port device (V1)
蓝色样式商城网站页脚代码
Four logs of MySQL server layer
MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board
Recommended foreign websites for programmers to learn
指针笔试题~走近大厂
随机推荐
The next industry outlet: NFT digital collection, is it an opportunity or a foam?
Record the process of reverse task manager
Teach you to build your own simple BP neural network with pytoch (take iris data set as an example)
SAP ALV单元格级别设置颜色
Remote Sensing Image Super-resolution and Object Detection: Benchmark and State of the Art
. Net 6 and Net core learning notes: Important issues of net core
[concept] Web basic concept cognition
Introduction to DeNO
February 14, 2022 Daily: Google long article summarizes the experience of building four generations of TPU
[padding] an error is reported in the prediction after loading the model weight attributeerror: 'model' object has no attribute '_ place‘
Pytorch基础——(1)张量(tensor)的初始化
Canvas cut blocks game code
Brush questions in summer -day3
Pytoch foundation - (2) mathematical operation of tensor
Pointer written test questions ~ approaching Dachang
如何做好功能测试
Data analysis Seaborn visualization (for personal use)
Pytoch foundation - (1) initialization of tensors
【RISC-V】外部中断
Svg drag point crop image JS effect