什么是 HTTP/3?

2025-05-24

什么是 HTTP/3?

互联网工程任务组(IETF)官员透露,HTTP-over-QUIC实验协议应该更名为HTTP/3。

从 HTTP/1.1(1999 年发布)到 HTTP/2(2015 年发布)的发布,发展过程中存在很大差距,而随着 2019 年 HTTP/3 的发布,事情正在加速发展。

HTTP/3 是 Google QUIC 协议的演进版本,源于Mark Nottingham 的建议。

那么 QUIC 是什么?

正如Chromium 项目主页所述
QUIC(快速 UDP 互联网连接)是一种新型传输协议,与 TCP 相比,它能够降低延迟。从表面上看,QUIC 与基于 UDP 实现的 TCP+TLS+HTTP/2 非常相似。由于 TCP 是在操作系统内核和中间件固件中实现的,因此几乎不可能对 TCP 进行重大更改。然而,由于 QUIC 构建于 UDP 之上,因此它不存在此类限制。

QUIC 在现有 TCP+TLS+HTTP2 上的主要功能包括

  • 大幅缩短连接建立时间
  • 改善拥塞控制
  • 无队头阻塞的多路复用
  • 前向纠错
  • 连接迁移

谷歌表示,从 Chrome 到谷歌服务器的所有请求中,大约有一半是通过 QUIC 处理的,并且他们正在持续提升 QUIC 的流量,最终使其成为从谷歌客户端(包括 Chrome 和移动应用)到谷歌服务器的默认传输方式。他们计划正式向 IETF 提交 QUIC 作为互联网标准,但首先需要做一些准备工作,例如更改线路格式,并将其参考实现从 SPDY-over-QUIC 更新为 HTTP2-over-QUIC(当前的HTTP-over-QUIC 协议草案使用新发布的 TLS 1.3 协议)。在接下来的几个月里,谷歌还计划降低握手开销,以提高服务器端的可扩展性,改进前向纠错和拥塞控制,并增加对多路径连接的支持。

reddit 用户对 TCP 与 QUIC 的精彩解释

TCP was developed when we still were transmitting packets over networks that had much larger packet loss than we do today and computer systems had much longer to answer TCP messages. The timeout for connecting to a host for example is still 20 seconds even though you are very unlikely to ever get an answer if the TCP handshake alone can’t even be completed within 5 seconds. These long delays are reasons why networked applications sometimes get stuck for a long time. We haven’t touched these delays since the protocol was invented in the 70s even though we saw massive improvements on reliability and speed.
Instead of finally reducing these defaults which would not alter the packets and is largely compatible with the current TCP implementations, protocol developers just started using UDP and then implement their own TCP on top of it. The transition to IPv6 would have been the ideal time to also update TCP to a version that fixes most of the issues it has, mostly timeouts, window size and TCP slow start. Some of the values can be tweaked in your OS, but the timeout, which is one of the most annoying can’t. If you kill a TCP socket that hangs for 5 seconds, your OS will still leave it open until the 20 seconds expired, consuming system resources.

最初发布于此处:https://medium.com/devgorilla/what-is-http-3-94335c57823f

文章来源:https://dev.to/grigorkh/what-is-http3--4pib
PREV
Rust for Web 面向 NodeJS 开发人员的 Rust Web 开发简介
NEXT
立即停止使用 .env 文件!