跳至內容

HTTP/3

本頁使用了標題或全文手工轉換
維基百科,自由的百科全書

HTTP/3HTTP協議的第三個主要版本,用於在萬維網上交換信息。與之前版本(HTTP/1.1HTTP/2)不同,HTTP/3不依賴TCP協議,轉為使用基於UDP協議的多路復用傳輸協議QUIC協議實現。[1]

此變化主要為了解決HTTP/2中存在的隊頭阻塞問題。由於HTTP/2在單個TCP連接上使用了多路復用,受到TCP擁塞控制的影響,少量的丟包就可能導致整個TCP連接上的所有流被阻塞。

與該協議的早期版本相比,HTTP/3使用相似的語義,包括相同的請求方法狀態代碼消息字段,但編碼方式和會話狀態的維護方式有所不同。然而,部分由於該協議採用了QUIC,與之前的版本相比,HTTP/3在實際使用中具有更低的延遲和更快的加載速度:在某些情況下,速度是HTTP/1.1(是許多網站唯一部署的HTTP版本)的四倍以上。[2][3]

截至2024年9月,超過95%的主流網絡瀏覽器支持HTTP/3[4],並且在排名前1000萬的網站中,有34%的網站支持HTTP/3。[5]

歷史

[編輯]
HTTP/1.1傳輸層安全性協議傳輸控制協議HTTP/2TLS 1.2傳輸控制協議HTTP/3TLS 1.3QUIC用戶數據報協議網際協議
Protocol stack of HTTP/3 compared to HTTP/1.1 and HTTP/2

HTTP/3起源於QUIC工作組採納的互聯網草案英語Internet_Draft。最初的提案名為「HTTP/2 Semantics Using The QUIC Transport Protocol」[6](使用QUIC傳輸協議的HTTP/2語義),後來更名為「Hypertext Transfer Protocol (HTTP) over QUIC」[7]

在2018年10月28日的一次郵件列表討論中,IETF HTTP和QUIC工作組主席Mark Nottingham提議將HTTP-over-QUIC更名為HTTP/3,以「清晰地表明它是HTTP語義到線路協議的另一種綁定方式……讓人們意識到其與QUIC的分離」。[8]Nottingham的提議在幾天後被其他IETF成員接受。[9]HTTP工作組受命在HTTP/3的設計期間協助QUIC工作組,然後在發布後承擔維護責任。[10]

Chrome(Canary build)在2019年9月添加了對HTTP/3的支持,然後最終在穩定版本中實現,但默認情況下通過功能標誌禁用。它在2020年4月默認啟用。[11]Firefox在2019年11月通過功能標誌添加了對HTTP/3的支持[4][12][13],並於2021年4月在Firefox 88中開始默認啟用。[4][14]2020年4月8日在Safari Technology Preview中添加了對HTTP/3的實驗性支持[15],並包含在隨iOS 14macOS 11一起發布的Safari 14中[16][17],但截至macOS和iOS上的Safari 16,它仍然默認禁用。[來源請求]

2022年6月6日,IETFRFC 9114中將HTTP/3發布為提議標準

相較於HTTP/1.1與HTTP/2

[編輯]

不同HTTP版本之間的語義保持一致,如請求方法狀態代碼消息字段等通常在所有版本中都適用。差異在於這些語義到底層傳輸的映射。HTTP/1.1HTTP/2都使用TCP作為其傳輸協議。HTTP/3採用QUIC,一種傳輸層網絡協議,基於用戶數據報協議(UDP)實現了用戶空間擁塞控制。QUIC的引入旨在解決HTTP/2中被稱為 「隊頭阻塞」 的主要問題:由於HTTP/2多路復用的並行性對TCP的丟失恢復機制是不可見的,因此一旦發生數據包丟失或重排序,所有活躍的事務都會停滯,無論該事務是否受到丟失數據包的影響。相較之下,QUIC提供了原生多路復用,因此丟包只會影響數據真正丟失的那些流。

提議的DNS資源記錄SVCB(由服務綁定)和HTTPS將允許在不首先通過先前的HTTP版本接收Alt-Svc標頭的情況下進行連接,從而消除TCP握手的1個RTT。[18][19]自Firefox 92、iOS 14、報告的Safari 14支持以來,以及Chromium在標誌後支持HTTPS資源記錄。[20][21][22]

實現

[編輯]

客戶端

[編輯]
HTTP/3 瀏覽器支持
瀏覽器 實現但默認禁用的起始版本 默認開啟的起始版本 備註
Chrome 穩定版 (79) 2019年12月 87[23] 2020年4月[24] 早期版本實現了QUIC的其他草案
Edge 穩定版 (79) 2019年12月 87 2020年4月 Edge 79是基於Chromium的首個版本
Firefox 穩定版 (72.0.1) 2020年1月 88[25] 2021年4月[26]
Safari 穩定版 (14.0) 2020年9月 16.4 2023年3月 Apple從Safari 16.4開始,對部分Safari用戶測試HTTP/3的支持。[27]

[編輯]

為 QUIC and HTTP/3 實現了客戶端或服務器邏輯的開源庫有[28]

實現HTTP/3的庫
名稱 客戶端 服務端 編程語言 所屬公司 倉庫鏈接
lsquic 支持 支持 C LiteSpeed https://github.com/litespeedtech/lsquic頁面存檔備份,存於網際網路檔案館
nghttp3 支持 支持 C https://github.com/ngtcp2/nghttp3頁面存檔備份,存於網際網路檔案館
H2O英語H2O (web server) 不支持 支持 C https://github.com/h2o/h2o頁面存檔備份,存於網際網路檔案館
cURL[29][30] 支持 不支持 C https://github.com/curl/curl頁面存檔備份,存於網際網路檔案館
MsQuic[31] 支持 支持 C Microsoft https://github.com/microsoft/msquic頁面存檔備份,存於網際網路檔案館
proxygen 支持 支持 C++ Facebook https://github.com/facebook/proxygen#quic-and-http3頁面存檔備份,存於網際網路檔案館
Cronet 支持 支持 C++ Google https://github.com/chromium/chromium/tree/main/net/quic頁面存檔備份,存於網際網路檔案館
.NET[32] 支持 支持 C# (using MsQuic)[33] Microsoft https://github.com/dotnet頁面存檔備份,存於網際網路檔案館
quic-go 支持 支持 Go https://github.com/quic-go/quic-go頁面存檔備份,存於網際網路檔案館
http3 支持 支持 Haskell https://github.com/kazu-yamamoto/http3頁面存檔備份,存於網際網路檔案館
Kwik 支持 支持 Java https://github.com/ptrd/kwik頁面存檔備份,存於網際網路檔案館
Flupke 支持 支持 Java https://bitbucket.org/pjtr/flupke頁面存檔備份,存於網際網路檔案館
aioquic 支持 支持 Python https://github.com/aiortc/aioquic頁面存檔備份,存於網際網路檔案館
quiche 支持 支持 Rust Cloudflare https://github.com/cloudflare/quiche頁面存檔備份,存於網際網路檔案館
neqo 支持 支持 Rust Mozilla https://github.com/mozilla/neqo頁面存檔備份,存於網際網路檔案館
quinn 支持 支持 Rust https://github.com/quinn-rs/quinn頁面存檔備份,存於網際網路檔案館
s2n-quic 支持 支持 Rust Amazon Web Services https://github.com/aws/s2n-quic頁面存檔備份,存於網際網路檔案館

服務器

[編輯]
  • 2021年6月7日,LiteSpeed Web Server(及OpenLiteSpeed)6.0.2版本發布,並成為默認啟用HTTP/3的首個版本。[34]
  • Caddy網頁服務器v2.6.0(2022年9月20日發布)默認啟用了HTTP/3。[35]
  • Nginx自1.25.0版本(2023年5月23日發布)開始支持HTTP/3。2020年6月,發布了支持HTTP/3的nginx技術預覽版。[36] 2023年2月,發布了支持HTTP/3的nginx二進制包。[37]
  • Cloudflare在2019年發布了一個補丁,該補丁將quiche HTTP/3庫集成到nginx中。[38]
  • Microsoft IIS在Windows Server 2022/Windows 11上原生支持HTTP/3。[39]
  • HAProxy自2.6版本(2022年5月31日發布)起支持HTTP/3 over QUIC。[40][41]
  • Nimble Streamer英語Nimble Streamer中基於HTTP的協議自4.1.8-1[42]開始支持HTTP/3。

參考資料

[編輯]
  1. ^ Bishop, M. Hypertext Transfer Protocol (HTTP) over QUIC. IETF RFC. 2018-10-24 [2018-12-17]. (原始內容存檔於2018-12-19). 
  2. ^ Perna, Gianluca; Trevisan, Martino; Giordano, Danilo; Drago, Idilio. A first look at HTTP/3 adoption and performance. Computer Communications. 2022-04-01, 187: 115–124 [2025-03-15]. ISSN 0140-3664. S2CID 246936473. doi:10.1016/j.comcom.2022.02.005. hdl:11368/3025202可免費查閱. (原始內容存檔於2023-12-07) (英語). 
  3. ^ HTTP/3 is Fast. Request Metrics. [2022-07-01]. (原始內容存檔於2025-03-06) (英語). 
  4. ^ 4.0 4.1 4.2 "HTTP/3" | Can I use... Support tables for HTML5, CSS3, etc. canIuse.com. [2024-08-11]. (原始內容存檔於2025-02-22). 
  5. ^ Usage of HTTP/3 for websites. World Wide Web Technology Surveys. W3Techs. [11 August 2024]. 
  6. ^ Shade, Robbie. HTTP/2 Semantics Using The QUIC Transport Protocol. IETF. 8 July 2016. I-D draft-shade-quic-http2-mapping. 
  7. ^ Cimpanu, Catalin. HTTP-over-QUIC to be renamed HTTP/3. ZDNet. 12 November 2018 [12 November 2018]. (原始內容存檔於2018-11-13) (英語). 
  8. ^ Nottingham, Mark. Identifying our deliverables. IETF Mail Archive. 28 October 2018 [2018-12-17]. (原始內容存檔於2018-11-19). 
  9. ^ Cimpanu, Catalin. HTTP-over-QUIC to be renamed HTTP/3 | ZDNet. ZDNet. 2018-11-12 [2018-11-12]. (原始內容存檔於2018-11-13) (英語). 
  10. ^ Hypertext Transfer Protocol Charter. ietf.org. [2020-09-02]. 
  11. ^ Enabling QUIC in tip-of-tree. groups.google.com. [2021-04-08]. (原始內容存檔於2021-08-23). 
  12. ^ Daniel, Stenberg. Daniel Stenberg announces HTTP/3 support in Firefox Nightly. Twitter. [5 November 2019]. (原始內容存檔於2023-03-30). 
  13. ^ Cimpanu, Catalin. Cloudflare, Google Chrome, and Firefox add HTTP/3 support. ZDNet. 26 Sep 2019 [27 Sep 2019]. (原始內容存檔於2019-09-26).  已忽略未知參數|df= (幫助)
  14. ^ {{Cite web|last=Damjanovic|first=Dragana|date=16 April 2021|title=QUIC and HTTP/3 Support now in Firefox Nightly and Beta|url=https://hacks.mozilla.org/2021/04/quic-and- QUIC(快速UDP網絡連接)是一種實驗性的網絡傳輸協議,由Google開發,該協議旨在使網頁傳輸更快。在2018年10月28日的郵件列表討論中,互聯網工程任務組(IETF) HTTP和QUIC工作組主席Mark Nottingham英語Mark Nottingham提出了將HTTP-over-QUIC更名為HTTP/3的正式請求,以「明確地將其標識為HTTP語義的另一個綁定……使人們理解它與QUIC的不同」,並在最終確定並發布草案後,將QUIC工作組繼承到HTTP工作組。<ref>Nottingham, Mark. Identifying our deliverables. IETF Mail Archive. 28 October 2018 [2018-12-17]. (原始內容存檔於2018-11-19). 
  15. ^ Release Notes for Safari Technology Preview 104. webkit.org. 8 April 2020 [7 August 2020]. (原始內容存檔於2025-01-16). 
  16. ^ Safari 14 Release Notes. developer.apple.com. [4 December 2020]. 
  17. ^ Ng, Gary. Apple's Safari Adds Support for HTTP3 in iOS 14 and macOS 11. iphoneincanada.ca. 23 June 2020 [25 June 2021]. 
  18. ^ HTTPS RR. MDN. Mozilla. [2022-10-25]. 
  19. ^ Schwartz, Benjamin M.; Bishop, Mike; Nygren, Erik. Service binding and parameter specification via the DNS. IETF. 2020-06-12. I-D draft-ietf-dnsop-svcb-https. 
  20. ^ Firefox 92 for developers. Mozilla Corporation. 7 September 2021 [2022-10-25]. (原始內容存檔於2025-02-27). 
  21. ^ Feature: HTTP->HTTPS redirect for HTTPS DNS records. Google Inc. [2022-10-25]. (原始內容存檔於2025-02-13). 
  22. ^ Patrick Mevzek. What's the use case of SVCB (type 65, service binding) RR. Stack Exchange Inc. 24 August 2021 [2022-10-25]. 
  23. ^ "HTTP/3" | Can I use... Support tables for HTML5, CSS3, etc. canIuse.com. [2023-07-10]. (原始內容存檔於2023-07-13). 
  24. ^ Enabling QUIC in tip-of-tree. groups.google.com. [2021-04-09]. (原始內容存檔於2021-08-23). 
  25. ^ Damjanovic, Dragana. QUIC and HTTP/3 Support now in Firefox Nightly and Beta. Mozilla Hacks – the Web developer blog. 16 April 2021 [2021-04-17]. (原始內容存檔於2021-09-18) (美國英語). 
  26. ^ Firefox Release Owners - MozillaWiki. wiki.mozilla.org. [2021-04-09]. (原始內容存檔於2023-06-08). 
  27. ^ Jen Simmons. HTTP/3 support shipped in Safari 14.0. GitHub. 2023-04-04 [2023-04-07]. (原始內容存檔於2023-06-06). 
  28. ^ QUIC Implementations. GitHub. [2021-04-08]. (原始內容存檔於2021-07-15) (英語). 
  29. ^ First HTTP/3 with curl. Daniel Stenberg. August 5, 2019 [October 2, 2019]. (原始內容存檔於2023-06-06). 
  30. ^ HTTP3 (and QUIC). Daniel Stenberg. August 23, 2023 [August 27, 2023]. (原始內容存檔於2023-08-27). 
  31. ^ MsQuic is Open Source. April 28, 2020 [April 28, 2020]. (原始內容存檔於2022-02-08). 
  32. ^ HTTP/3 support in .NET 6. September 17, 2021 [September 17, 2021]. (原始內容存檔於2023-05-30). 
  33. ^ HTTP/3 support in .NET 6. .NET Blog. 2021-09-17 [2022-01-12]. (原始內容存檔於2023-05-30) (美國英語). 
  34. ^ LiteSpeed Web Server Release Log - LiteSpeed Technologies. www.litespeedtech.com. [2022-02-12]. (原始內容存檔於2023-08-15). Enable HTTP/3 v1 by default. 
  35. ^ Release 2.6.0 · caddyserver/caddy. Github. 2022-09-22 [2022-09-20]. (原始內容存檔於2023-08-10) (美國英語). 
  36. ^ Introducing a Technology Preview of NGINX Support for QUIC and HTTP/3. NGINX. 2020-06-10 [2020-06-11]. (原始內容存檔於2020-06-10) (美國英語). 
  37. ^ Binary Packages Now Available for the Preview NGINX QUIC+HTTP/3 Implementation. NGINX. 2023-02-08 [2023-03-30]. (原始內容存檔於2023-09-28) (美國英語). 
  38. ^ Experiment with HTTP/3 using NGINX and quiche. The Cloudflare Blog. 2019-10-17 [2019-11-09]. (原始內容存檔於2019-11-09) (英語). 
  39. ^ Tratcher. Use ASP.NET Core with HTTP/3 on IIS. docs.microsoft.com. [2022-04-29] (美國英語). 
  40. ^ Announcing HAProxy 2.6. HAProxy Blog. 31 May 2022. 
  41. ^ QUIC Implementation in HAProxy. HAProxyConf video presentation. [2023-10-14]. (原始內容存檔於2023-07-14). 
  42. ^ HTTP/3 and QUIC support in Nimble Streamer – Softvelum: efficient tools to build your streaming networks. 2025-02-13 [2025-03-15] (美國英語). 

外部連結

[編輯]