At Snapchat, our goal is to make our Camera the fastest way to share a moment. We do not want Snapchatters to face any delays when they are in the mom

QUIC at Snapchat - Snap Engineering

submited by
Style Pass
2021-06-25 02:30:03

At Snapchat, our goal is to make our Camera the fastest way to share a moment. We do not want Snapchatters to face any delays when they are in the moment and want to share with their real friends.

Network requests are on the critical path of using Snapchat. Compared to a UI update or disk write that takes milliseconds, network latency can take seconds with high error rate and device constraints. To reduce network latency and error, we make requests and responses smaller, reduce unnecessary sync, utilize global content distribution partners to bring media close to the people who use it, and use an efficient, next generation network protocol called Quick UDP Internet Connections, or QUIC for short.

Let’s first take a quick look at the network stack before QUIC. Take a Snap send as an example: on the application layer, we put the Snap media into the HTTP2 request payload. Then we use TLS to ensure the connection safety on the security layer and leverage TCP to split the request into chunks and upload the Snap to the server. However the TCP+TLS+HTTP2 stack is suboptimal for the mobile network environment. For example, TCP requests will fail if a Snapchatter switches between WiFi and WWAN. For a user chatting with friends, failure to send a message due to a connection drop can lead to a degraded experience.

QUIC is a transport protocol for the internet, developed by engineers at Google. QUIC is the foundation of HTTP3 that replaces the TCP+TLS+HTTP2 and is built on top of UDP. QUIC solves a number of transport-layer and application-layer problems while requiring little or no change from application developers. As the above diagram depicts, QUIC does not alter the low-level operating system network protocols nor does it alter high-level HTTP.

Leave a Comment