How did Facebook introduce the next-generation protocol 'QUIC' to speed up the service?



Communication on the Internet has been supported for many years by a group of protocols called '

TCP / IP ', but there is an increasing trend to replace TCP , which is the core protocol, with the new communication standard ' QUIC '. Facebook talks about the know-how gained from introducing QUIC, which has encryption functions and efficiency not found in TCP, into its service on its blog.

How Facebook is bringing QUIC to billions --Facebook Engineering
https://engineering.fb.com/networking-traffic/how-facebook-is-bringing-quic-to-billions/

In the first place, 'QUIC' refers to a next-generation protocol that replaces TCP, which is a transport layer protocol and one of the most famous communication standards. QUIC was originally developed by Google, but since 2015, it has been developed and standardized by the Internet standardization organization IETF . QUIC, which uses UDP to achieve both flexibility compatible with conventional network devices and high functionality such as encryption functions not found in TCP, is attracting attention as a communication standard that will support the Internet of the future.

When introducing QUIC to its own service, Facebook developed its own software called ' mvfst ' as a QUIC implementation, and first applied it to the internal network and conducted experiments to gain know-how. The first place where QUIC was applied to communications on the Internet after testing on the internal network was ' GraphQL ' in the Facebook app, which is a fully mature infrastructure that allows QUIC to be rolled out in a limited and secure manner. It was a 'dynamic API request'.



By introducing QUIC to the Facebook application, some improvements such as reduction of request error and delay were seen, but at the same time problems also occurred. Even though QUIC was used only for dynamic requests by GraphQL, it seems that download errors and stream outages of static content such as images and videos increased.

The cause of the problem is that the network bandwidth measurement was optimized for TCP. Requests made by the Facebook app have changed in format and quality based on the speed and reliability of other requests, but have been optimized for traditional TCP for QUIC, which enables high-quality communication. Since I was measuring the network bandwidth, I overestimated the quality of the network and an error occurred.



Facebook gained this know-how by using QUIC in a limited way, and then introduced it to the entire Facebook app. At that time, he said that he developed his own performance measurement tool to verify 'mvfst CPU efficiency' and '

BBR operation to measure traffic congestion', which were concerns. Facebook says that it used measurement tools to identify problems and worked to improve performance. For example, one such activity is to use UDP segmentation offload , where an application sends a chunk of data to the kernel and the kernel optimizes the data size and sends it.

Below is a graph that summarizes the request speed after introducing QUIC to all communications of the Facebook application by percentile. As the percentile increases, the difference in communication speed between TCP and QUIC widens, and it can be seen that the communication speed is raised by efficient QUIC. It seems that it was the numerical value related to the video that greatly benefited from QUIC, the MTBR indicating the interval at which buffer events occur was reduced by 22%, and the request error related to the video was reduced by 8%. In addition, the probability that the video stream will stop has decreased by 20%.



At the time of writing the article, more than 75% of all traffic on Facebook's network is done by QUIC and HTTP / 3 . In the future, it is stated that it plans to enable 0-RTT, which can shorten the handshake and encrypt, and apply QUIC not only to the Facebook application but also to the Instagram application. The standardization of QUIC by the IETF is scheduled for 2021, and it is expected that QUIC will become more widespread in the future.

in Software,   Web Service, Posted by log1n_yi