Without any development, it sounds like a fantasy to achieve zero freezes in live broadcast in a weak network environment? After reading this article, you will know how Qiniu Live Cloud does it.
Content directory
- Live broadcast pain point - Caton
- What is QUIC? Why can it reduce stuttering?
- Measured QUIC streaming effect in weak network environment
- How to access the Qiniu Cloud QUIC solution?
Live broadcast pain point - Caton
Caton is one of the factors that most affects the live broadcast experience, and it is also one of the most difficult problems to solve. In the transmission link of streaming media, packet loss in any link may cause users to watch freezes.
Among them, the streaming freeze on the anchor side affects the viewing experience the most, and will directly affect all end users watching the live broadcast. In some scenarios, the stream jam of the anchor will be particularly noticeable. For example, the outdoor live broadcast will test the stability of the stream in the case of complex network conditions.
Reducing stuttering has always been a major technical challenge for developers. As a pioneer in the Internet live broadcast industry, what countermeasures does Qiniu Cloud have?
Since Google launched the QUIC protocol in 2014, it has been practicing the protocol on audio and video products. Now, after more than a year of exploration and practice, Qiniuyun live streaming cloud products have embraced QUIC. The latest live streaming QUIC push solution can greatly reduce the problem of live streaming, and can provide customers with various complex network environments. Provide an excellent live broadcast experience.
What is QUIC and why can it reduce lag?
Since QUIC can solve such an important live broadcast experience problem, let's first understand the QUIC protocol as a whole.
- What is the definition of QUIC
- QUIC's place in a layered network
- Why QUIC has an advantage in transport
1. Definition of the QUIC protocol
QUIC stands for Quick UDP Internet Connection, which is a low-latency Internet transmission protocol based on UDP protocol developed by Google.
We know that the TCP/IP protocol suite is the foundation of the Internet. There are only two transport layer protocols: TCP and UDP. Compared to the TCP protocol, UDP is more lightweight, but has much less error checking. Since UDP is an unreliable protocol and does not guarantee in-order delivery, its reliability is not as good as that of TCP.
The QUIC transport layer is based on the UDP protocol but is a reliable transport protocol because it shifts many of the reliability verification strategies from the system layer to the application layer, so that congestion control strategies more suitable for modern streaming media can be used.
2. Where QUIC is in network transport
 As can be seen from the figure, the QUIC transport layer replaces TCP with the UDP protocol.
3. Why QUIC has an advantage in transport
From all the above definitions of QUIC, it is obvious that the comparison object of QUIC is TCP. So all the enumerations of advantages below are based on a comparison of QUIC and TCP.
3.1 Better congestion control
Although protocols such as HTTP/2 or SPDY now support the transfer of multiple pages of data over a data link, this feature does speed up the transfer of data. However, since the TCP protocol processes packets in a strict order, it still encounters the problem of head-of-line blocking.
For example, when the problem in the scenario shown in the figure below occurs, when one of the data is not sent successfully, the TCP connection needs to wait for the packet to be retransmitted before proceeding. Therefore, even if logically a TCP connection is multiplexed in parallel, other unrelated data will be blocked.
 The QUIC protocol uses the UDP protocol directly through the transport layer to avoid this problem. Since the UDP protocol does not have strict sequence requirements, when a data packet encounters a problem and needs to be retransmitted, only the resources corresponding to the data packet will be affected, and other independent resources will not be affected and block transmission.  3.2 QUIC is more flexible
The TCP protocol stack is usually implemented at the operating system level, such as Linux, Windows, iOS, and Android operating systems. Therefore, if you want to modify the TCP protocol, you need to do a lot of things from the operating system level, which is a complicated project. Relatively speaking, the UDP protocol is simpler to implement at the operating system level. Based on UDP, QUIC has done a lot of optimizations at the network congestion control level at the application layer to help users reduce the stall rate in complex networks and improve fluency, which TCP cannot do. arrived.
4. Summary
As can be seen from all the above introductions, if we need to use QUIC to improve the live broadcast experience, it is to use it to replace the role played by the TCP protocol in live broadcast. Everyone knows that the protocols used in live broadcast are basically RTMP protocol, and the transport layer of RTMP protocol is based on TCP protocol. Therefore, Qiniu's QUIC streaming solution is to replace the transport layer protocol in RTMP with QUIC, so as to achieve the effect of reducing the stuttering rate of streaming.
The effect of using QUIC
The above mentioned so many theoretical advantages of media transmission based on QUIC, so is there any actual experimental test as theoretical support? Let's take a look at the test data given by the Qiniuyun QA team.
Test parameter configuration: 
Test method: In the weak network environment simulated by ATC, use the srs player to play for 5 mins, and record the fluency and the number of freezes.
- Weak network configuration - ATC configuration: delay 100ms loss 1%
The results are shown in the figure:
- Weak network configuration 2 ATC configuration: delay 200ms loss 10%
Under the network configuration of TCP, it cannot be pushed up, or it will be disconnected after pushing for a while.
How to access the Qiniu Cloud QUIC solution
We believe that many customers have discovered the significance of QUIC streaming technology for their own products, and it can effectively reduce the troubles of streamers caused by network problems. Customers only need to change to the latest version of Qiniu's streaming SDK, turn on the QUIC streaming switch on the client, and cooperate with the real-time streaming network specially created by Qiniu Cloud for live streaming products to make your product experience smoother.
Follow the official account Qiniuyun for more information~