当前位置:网站首页>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
边栏推荐
- JS Vanke banner rotation chart JS special effect
- Pytorch基础——(1)张量(tensor)的初始化
- 2.2 STM32 GPIO operation
- mysqldump数据备份
- SD卡报错“error -110 whilst initialising SD card
- Redis cache breakdown, cache penetration, cache avalanche
- Analyze 菜单分析
- Tidb ecological tools (backup, migration, import / export) collation
- Overview of OCR character recognition methods
- [slam] orb-slam3 parsing - track () (3)
猜你喜欢
随机推荐
教你用Pytorch搭建一个自己的简单的BP神经网络( 以iris数据集为例 )
Buuctf question brushing notes - [geek challenge 2019] easysql 1
Suggestions for new engineer team members
SAP ALV cell level set color
Shell pass parameters
svg拖动点裁剪图片js特效
Research on cooperative control of industrial robots
Edcircles: a real time circle detector with a false detection control translation
数据分析——seaborn可视化(笔记自用)
Schnuka: what is visual positioning system and how to position it
JS Vanke banner rotation chart JS special effect
C language circular statement
暑期刷题-Day3
[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board
Redis cache breakdown, cache penetration, cache avalanche
three.js网页背景动画液态js特效
C language judgment, ternary operation and switch statement usage
Eight super classic pointer interview questions (3000 words in detail)
出现Permission denied的解决办法(750权限谨慎使用)
Pytoch foundation - (2) mathematical operation of tensor