Comprendre HTTP3 en 5 minutes

Understand HTTP3 in 5 minutes

You haven’t quite figured out HTTP2 yet that you’re already starting to get pissed off by people talking about HTTP3. But there’s a reason for that: HTTP3 is fast. I bet you in five minutes you’ll agree with me.



Once upon a time

I can’t tell you about the future without telling you about the present. Do you know about HTTP ? Defined in 1991, it’s the protocol that manages the web. It means HyperText Transfer Protocol and it allows you to fetch resources from a web page.

From a web server to your browser. It’s built on a lower level protocol –TCP: it’s going to be important- and it’s stateless. It means that each request is completely independent. Each GIF present on this page is a GIF proudly independent in its life on the internet. That’s good for him and his life as a GIF. But for us it’s a bit of a broken system.

Because the problem is that each request will only look for one file at a time. Each time an expensive TCP connection is created for the occasion. Imagine if you had 10,000 Internet tips on your page.

I know a lot of people absolutely loved my pattern making skills in the previous article. So, to explain the Internets to you properly, I’m doing it again.



http


Despite the fact that a browser can make six different requests at the same time, HTTP is still slow and full of TCP connections. Plus, we developers, usualy don’t care about that. We like to put as much crap on our pages as possible. Big jQuery lib with 300 useless CSS stylesheets ending with a big transparent 8 mega PNG.

When Google saw all the crap we were doing everywhere they started talking about SPDY (it’s called speedy). The point? To speed up the Internets.

SPDY is a specification that proposes to use HTTP as is but with a change of rules. And by compressing headers, prioritizing requests and multiplexing, it will transform all TCP requests and connections into one!

Concretely, when your HTML is read, your browser looks at everything you’re going to ask in your page. Then, it’s getting everything all at once. This way you avoid doing it file by file.

The first draft of HTTP2 is SPDY based. Very quickly HTTP2 was adopted and life on the internet has become faster. Today 42.7% of the internet use HTTP2.



http2


Great, what about HTTP3?

If I piss you off with HTTP and HTTP2 when you explicitly clicked to see sexy HTTP3, there’s a good reason. HTTP2 was created by taking HTTP as a base and changing the rules. It’s the same thing with HTTP3. So by understanding the present it’s easier for me to explain the future to you.

Googlers are geeks, they never stop. After SPDY became HTTP2, they thought that it was still not fast enough. So they started talking about QUIC (it’s called Quick). This will be the second experimental technology developed by Google to become an official upgrade of the HTTP protocol. But what’s so special about this protocol?

The main big evolution of HTTP3 is the change of transport layer. No more of the heavy TCP connections I’ve been telling you about since the beginning. Now, it’s all about UDP.

By the way QUIC means “Quick UDP Internet Connections”. This change of protocol will speed up connection establishment and data transfer times enormously. Howerver, UDP is certainly faster and simpler, but it doesn’t have the reliability and error handling of TCP.

TCP has to make several round trips just to establish a connection in a square and stable way. Where UDP doesn’t give a damn and does it really fast without stability and risk of lost packets. However UDP can dramatically reduce latency in requests. Up to almost zero latency in repeated connections to the same server because no roundtrip is made to establish connections.



http3


HTTP3 is the multiplexing and compression features of HTTP2 with a protocol change from TCP to UDP. The Google guys then added their layer in the protocol to guarantee stability, order in the reception of packets and of course security.

So HTTP3 uses UDP for its high speed while keeping the stability of QUIC, without forgetting the security of TLS. Because yes, in QUIC you find TLS 1.3 which allows you to make your beautiful SSL. I’ve been talking about layers for a while, this is what it looks like under the hood.



http3


In 2018, QUIC became HTTP3. The Internet Enginerring Task Force dudes, dudes in shorts who decide on Internet protocols, have agreed. And that’s great news because the Internets will never be fast enough for us, impatient people.



Epilogue

HTTP3 is the sexy future with a HTTP base that has been tuned to the maximum by google geeks. At the time of writing, only 4.6% of the Internet uses HTTP3 but this figure is likely to grow in the coming years. We stayed on the surface today, but there are a lot of deep-dive articles everywhere that I invite you to consult if you’re more curious.

Written by

jesuisundev
I'm a dev. Right now i'm Backend Developer / DevOps in Montreal. Dev is one of my passions and I write as I speak. I talk to you daily on my Twitter. You can insult me at this e-mail or do it directly in the comments below. There's even a newsletter !

Leave a reply

Your email address will not be published. Required fields are marked *