HTTP/3灞曟湜

Posted 娣卞叆鍘熺悊

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP/3灞曟湜相关的知识,希望对你有一定的参考价值。

鐐瑰嚮馃憜钃濊壊鈥?nbsp;娣卞叆鍘熺悊鈥濓紝鍏虫敞骞垛€?/span>璁句负鏄熸爣鈥?/span>

鎶€鏈共璐э紝绗竴鏃堕棿鎺ㄩ€?/span>

鍦ㄥ墠闈㈢殑涓よ閲岋紝鎴戜滑涓€璧峰涔犱簡 HTTP/2锛屼綘涔熷簲璇ョ湅鍒颁簡 HTTP/2 鍋氬嚭鐨勮澶氬姫鍔涳紝姣斿澶撮儴鍘嬬缉銆佷簩杩涘埗鍒嗗抚銆佽櫄鎷熺殑鈥滄祦鈥濅笌澶氳矾澶嶇敤锛屾€ц兘鏂归潰姣?HTTP/1 鏈変簡寰堝ぇ鐨勬彁鍗囷紝鈥滃熀鏈笂鈥濊В鍐充簡鈥滈槦澶撮樆濉炩€濊繖涓€滆€佸ぇ闅锯€濋棶棰樸€?/span>

HTTP/2 鐨勨€滈槦澶撮樆濉炩€?/span>

绛夌瓑锛屼綘鍙兘瑕佸彂鍑虹枒闂簡锛氫负浠€涔堣鏄€滃熀鏈笂鈥濓紝鑰屼笉鏄€滃畬鍏ㄢ€濊В鍐充簡鍛紵

杩欐槸鍥犱负 HTTP/2 铏界劧浣跨敤鈥滃抚鈥濃€滄祦鈥濃€滃璺鐢ㄢ€濓紝娌℃湁浜嗏€滈槦澶撮樆濉炩€濓紝浣嗚繖浜涙墜娈甸兘鏄湪搴旂敤灞傞噷锛岃€屽湪涓嬪眰锛屼篃灏辨槸 TCP 鍗忚閲岋紝杩樻槸浼氬彂鐢熲€滈槦澶撮樆濉炩€濄€?/span>

杩欐槸鎬庝箞鍥炰簨鍛紵

璁╂垜浠粠鍗忚鏍堢殑瑙掑害鏉ヤ粩缁嗙湅涓€涓嬨€傚湪 HTTP/2 鎶婂涓€滆姹?- 鍝嶅簲鈥濆垎瑙f垚娴侊紝浜ょ粰 TCP 鍚庯紝TCP 浼氬啀鎷嗘垚鏇村皬鐨勫寘渚濇鍙戦€侊紙鍏跺疄鍦?TCP 閲屽簲璇ュ彨 segment锛屼篃灏辨槸鈥滄鈥濓級銆?/span>

鍦ㄧ綉缁滆壇濂界殑鎯呭喌涓嬶紝鍖呭彲浠ュ緢蹇€佽揪鐩殑鍦般€備絾濡傛灉缃戠粶璐ㄩ噺姣旇緝宸紝鍍忔墜鏈轰笂缃戠殑鏃跺€欙紝灏辨湁鍙兘浼氫涪鍖呫€傝€?TCP 涓轰簡淇濊瘉鍙潬浼犺緭锛屾湁涓壒鍒殑鈥滀涪鍖呴噸浼犫€濇満鍒讹紝涓㈠け鐨勫寘蹇呴』瑕佺瓑寰呴噸鏂颁紶杈撶‘璁わ紝鍏朵粬鐨勫寘鍗充娇宸茬粡鏀跺埌浜嗭紝涔熷彧鑳芥斁鍦ㄧ紦鍐插尯閲岋紝涓婂眰鐨勫簲鐢ㄦ嬁涓嶅嚭鏉ワ紝鍙兘鈥滃共鐫€鎬モ€濄€?/span>

鎴戜妇涓畝鍗曠殑渚嬪瓙锛?/span>

瀹㈡埛绔敤 TCP 鍙戦€佷簡涓変釜鍖咃紝浣嗘湇鍔″櫒鎵€鍦ㄧ殑鎿嶄綔绯荤粺鍙敹鍒颁簡鍚庝袱涓寘锛岀涓€涓寘涓簡銆傞偅涔堝唴鏍搁噷鐨?TCP 鍗忚鏍堝氨鍙兘鎶婂凡缁忔敹鍒扮殑鍖呮殏瀛樿捣鏉ワ紝鈥滃仠涓嬧€濈瓑鐫€瀹㈡埛绔噸浼犻偅涓涪澶辩殑鍖咃紝杩欐牱灏卞張鍑虹幇浜嗏€滈槦澶撮樆濉炩€濄€?/span>

鐢变簬杩欑鈥滈槦澶撮樆濉炩€濇槸 TCP 鍗忚鍥烘湁鐨勶紝鎵€浠?HTTP/2 鍗充娇璁捐鍑哄啀澶氱殑鈥滆姳鏍封€濅篃鏃犳硶瑙e喅銆?/span>

Google 鍦ㄦ帹 SPDY 鐨勬椂鍊欏氨宸茬粡鎰忚瘑鍒颁簡杩欎釜闂锛屼簬鏄氨鍙堝彂鏄庝簡涓€涓柊鐨勨€淨UIC鈥濆崗璁紝璁?HTTP 璺戝湪 QUIC 涓婅€屼笉鏄?TCP 涓娿€?/span>

鑰岃繖涓€淗TTP over QUIC鈥濆氨鏄?HTTP 鍗忚鐨勪笅涓€涓ぇ鐗堟湰锛?/span>HTTP/3銆傚畠鍦?HTTP/2 鐨勫熀纭€涓婂張瀹炵幇浜嗚川鐨勯璺冿紝鐪熸鈥滃畬缇庘€濆湴瑙e喅浜嗏€滈槦澶撮樆濉炩€濋棶棰樸€?/span>

涓嶈繃 HTTP/3 鐩墠杩樺浜庤崏妗堥樁娈碉紝姝e紡鍙戝竷鍓嶅彲鑳戒細鏈夊彉鍔紝鎵€浠ヤ粖澶╂垜灏介噺涓嶈皥閭d簺涓嶇ǔ瀹氱殑缁嗚妭銆?/span>

杩欓噷鍏堣创涓€涓?HTTP/3 鐨勫崗璁爤鍥撅紝璁╀綘瀵瑰畠鏈変釜澶ф鐨勪簡瑙c€?/span>

QUIC 鍗忚

浠庤繖寮犲浘閲岋紝浣犲彲浠ョ湅鍒?HTTP/3 鏈変竴涓叧閿殑鏀瑰彉锛岄偅灏辨槸瀹冩妸涓嬪眰鐨?TCP鈥滄娊鎺夆€濅簡锛屾崲鎴愪簡 UDP銆傚洜涓?UDP 鏄棤搴忕殑锛屽寘涔嬮棿娌℃湁渚濊禆鍏崇郴锛屾墍浠ュ氨浠庢牴鏈笂瑙e喅浜嗏€滈槦澶撮樆濉炩€濄€?/span>

浣犱竴瀹氱煡閬擄紝UDP 鏄竴涓畝鍗曘€佷笉鍙潬鐨勪紶杈撳崗璁紝鍙槸瀵?IP 鍗忚鐨勪竴灞傚緢钖勭殑鍖呰锛屽拰 TCP 鐩告瘮锛屽畠瀹為檯搴旂敤鐨勮緝灏戙€?/span>

涓嶈繃姝f槸鍥犱负瀹冪畝鍗曪紝涓嶉渶瑕佸缓杩炲拰鏂繛锛岄€氫俊鎴愭湰浣庯紝涔熷氨闈炲父鐏垫椿銆侀珮鏁堬紝鈥滃彲濉戞€р€濆緢寮恒€?/span>

鎵€浠ワ紝QUIC 灏遍€夊畾浜?UDP锛屽湪瀹冧箣涓婃妸 TCP 鐨勯偅涓€濂楄繛鎺ョ鐞嗐€佹嫢濉炵獥鍙c€佹祦閲忔帶鍒剁瓑鈥滄惉鈥濅簡杩囨潵锛屸€滃幓鍏剁碂绮曪紝鍙栧叾绮惧崕鈥濓紝鎵撻€犲嚭浜嗕竴涓叏鏂扮殑鍙潬浼犺緭鍗忚锛屽彲浠ヨ涓烘槸鈥?/span>鏂版椂浠g殑 TCP鈥濄€?/span>

HTTP/3灞曟湜

QUIC 鏈€鏃╂槸鐢?Google 鍙戞槑鐨勶紝琚О涓?gQUIC銆傝€屽綋鍓嶆鍦ㄧ敱 IETF 鏍囧噯鍖栫殑 QUIC 琚О涓?iQUIC銆備袱鑰呯殑宸紓闈炲父澶э紝鐢氳嚦姣斿綋骞寸殑 SPDY 涓?HTTP/2 鐨勫樊寮傝繕瑕佸ぇ銆?/span>

gQUIC 娣峰悎浜?UDP銆乀LS銆丠TTP锛屾槸涓€涓簲鐢ㄥ眰鐨勫崗璁€傝€?IETF 鍒欏 gQUIC 鍋氫簡鈥滄竻鐞嗏€濓紝鎶婂簲鐢ㄩ儴鍒嗗垎绂诲嚭鏉ワ紝褰㈡垚浜?HTTP/3锛屽師鏉ョ殑 UDP 閮ㄥ垎鈥滀笅鏀锯€濆埌浜嗕紶杈撳眰锛屾墍浠?iQUIC 鏈夋椂鍊欎篃鍙€淨UIC-transport鈥濄€?/span>

鎺ヤ笅鏉ヨ璇寸殑 QUIC 閮芥槸鎸?iQUIC锛岃璁颁綇锛屽畠涓庢棭鏈熺殑 gQUIC 涓嶅悓锛屾槸涓€涓紶杈撳眰鐨勫崗璁紝鍜?TCP 鏄钩绾х殑銆?/span>


QUIC 鐨勭壒鐐?/span>

QUIC 鍩轰簬 UDP锛岃€?UDP 鏄€滄棤杩炴帴鈥濈殑锛屾牴鏈氨涓嶉渶瑕佲€滄彙鎵嬧€濆拰鈥滄尌鎵嬧€濓紝鎵€浠ュぉ鐢熷氨瑕佹瘮 TCP 蹇€?/span>

灏卞儚 TCP 鍦?IP 鐨勫熀纭€涓婂疄鐜颁簡鍙潬浼犺緭涓€鏍凤紝QUIC 涔熷熀浜?UDP 瀹炵幇浜嗗彲闈犱紶杈擄紝淇濊瘉鏁版嵁涓€瀹氳兘澶熸姷杈剧洰鐨勫湴銆傚畠杩樺紩鍏ヤ簡绫讳技 HTTP/2 鐨勨€滄祦鈥濆拰鈥滃璺鐢ㄢ€濓紝鍗曚釜鈥滄祦鈥濇槸鏈夊簭鐨勶紝鍙兘浼氬洜涓轰涪鍖呰€岄樆濉烇紝浣嗗叾浠栤€滄祦鈥濅笉浼氬彈鍒板奖鍝嶃€?/span>

涓轰簡闃叉缃戠粶涓婄殑涓棿璁惧锛圡iddle Box锛夎瘑鍒崗璁殑缁嗚妭锛孮UIC 鍏ㄩ潰閲囩敤鍔犲瘑閫氫俊锛屽彲浠ュ緢濂藉湴鎶靛尽绐滄敼鍜屸€滃崗璁兊鍖栤€濓紙ossification锛夈€?/span>

鑰屼笖锛屽洜涓?TLS1.3 宸茬粡鍦ㄥ幓骞达紙2018锛夋寮忓彂甯冿紝鎵€浠?QUIC 灏辩洿鎺ュ簲鐢ㄤ簡 TLS1.3锛岄『渚夸篃灏辫幏寰椾簡 0-RTT銆?-RTT 杩炴帴鐨勫ソ澶勩€?/span>

浣?QUIC 骞朵笉鏄缓绔嬪湪 TLS 涔嬩笂锛岃€屾槸鍐呴儴鈥滃寘鍚€濅簡 TLS銆傚畠浣跨敤鑷繁鐨勫抚鈥滄帴绠♀€濅簡 TLS 閲岀殑鈥滆褰曗€濓紝鎻℃墜娑堟伅銆佽鎶ユ秷鎭兘涓嶄娇鐢?TLS 璁板綍锛岀洿鎺ュ皝瑁呮垚 QUIC 鐨勫抚鍙戦€侊紝鐪佹帀浜嗕竴娆″紑閿€銆?/span>


QUIC 鍐呴儴缁嗚妭

鐢变簬 QUIC 鍦ㄥ崗璁爤閲屾瘮杈冨亸搴曞眰锛屾墍浠ユ垜鍙畝鐣ヤ粙缁嶄袱涓唴閮ㄧ殑鍏抽敭鐭ヨ瘑鐐广€?/span>

QUIC 鐨勫熀鏈暟鎹紶杈撳崟浣嶆槸鍖?/span>锛坧acket锛夊拰甯?/span>锛坒rame锛夛紝涓€涓寘鐢卞涓抚缁勬垚锛屽寘闈㈠悜鐨勬槸鈥滆繛鎺モ€濓紝甯ч潰鍚戠殑鏄€滄祦鈥濄€?/span>

HTTP/3灞曟湜

QUIC 鐨勫抚閲屾湁澶氱绫诲瀷锛孭ING銆丄CK 绛夊抚鐢ㄤ簬绠$悊杩炴帴锛岃€?STREAM 甯т笓闂ㄧ敤鏉ュ疄鐜版祦銆?/span>

QUIC 閲岀殑娴佷笌 HTTP/2 鐨勬祦闈炲父鐩镐技锛屼篃鏄抚鐨勫簭鍒楋紝浣犲彲浠ュ姣旂潃鏉ョ悊瑙c€備絾 HTTP/2 閲岀殑娴侀兘鏄弻鍚戠殑锛岃€?QUIC 鍒欏垎涓哄弻鍚戞祦鍜屽崟鍚戞祦銆?/span>

HTTP/3灞曟湜

QUIC 甯ф櫘閬嶉噰鐢ㄥ彉闀跨紪鐮侊紝鏈€灏戝彧瑕?1 涓瓧鑺傦紝鏈€澶氭湁 8 涓瓧鑺傘€傛祦 ID 鐨勬渶澶у彲鐢ㄤ綅鏁版槸 62锛屾暟閲忎笂姣?HTTP/2 鐨?2^31 澶уぇ澧炲姞銆?/span>

娴?ID 杩樹繚鐣欎簡鏈€浣庝袱浣嶇敤浣滄爣蹇楋紝绗?1 浣嶆爣璁版祦鐨勫彂璧疯€咃紝0 琛ㄧず瀹㈡埛绔紝1 琛ㄧず鏈嶅姟鍣紱绗?2 浣嶆爣璁版祦鐨勬柟鍚戯紝0 琛ㄧず鍙屽悜娴侊紝1 琛ㄧず鍗曞悜娴併€?/span>

鎵€浠?QUIC 娴?ID 鐨勫鍋舵€ц川鍜?HTTP/2 鍒氬ソ鐩稿弽锛屽鎴风鐨?ID 鏄伓鏁帮紝浠?0 寮€濮嬭鏁般€?/span>


HTTP/3 鍗忚

浜嗚В浜?QUIC 涔嬪悗锛屽啀鏉ョ湅 HTTP/3 灏卞鏄撳浜嗐€?/span>

鍥犱负 QUIC 鏈韩灏卞凡缁忔敮鎸佷簡鍔犲瘑銆佹祦鍜屽璺鐢紝鎵€浠?HTTP/3 鐨勫伐浣滃噺杞讳簡寰堝锛屾妸娴佹帶鍒堕兘浜ょ粰 QUIC 鍘诲仛銆傝皟鐢ㄧ殑涓嶅啀鏄?TLS 鐨勫畨鍏ㄦ帴鍙o紝涔熶笉鏄?Socket API锛岃€屾槸涓撻棬鐨?QUIC 鍑芥暟銆備笉杩囪繖涓€淨UIC 鍑芥暟鈥濊繕娌℃湁褰㈡垚鏍囧噯锛屽繀椤昏缁戝畾鍒版煇涓€涓叿浣撶殑瀹炵幇搴撱€?/span>

HTTP/3 閲屼粛鐒朵娇鐢ㄦ祦鏉ュ彂閫佲€滆姹?- 鍝嶅簲鈥濓紝浣嗗畠鑷韩涓嶉渶瑕佸儚 HTTP/2 閭f牱鍐嶅幓瀹氫箟娴侊紝鑰屾槸鐩存帴浣跨敤 QUIC 鐨勬祦锛岀浉褰撲簬鍋氫簡涓€涓€滄蹇垫槧灏勨€濄€?/span>

HTTP/3 閲岀殑鈥滃弻鍚戞祦鈥濆彲浠ュ畬鍏ㄥ搴斿埌 HTTP/2 鐨勬祦锛岃€屸€滃崟鍚戞祦鈥濆湪 HTTP/3 閲岀敤鏉ュ疄鐜版帶鍒跺拰鎺ㄩ€侊紝杩戜技鍦板搴?HTTP/2 鐨?0 鍙锋祦銆?/span>

鐢变簬娴佺鐞嗚鈥滀笅鏀锯€濆埌浜?QUIC锛屾墍浠?HTTP/3 閲屽抚鐨勭粨鏋勪篃鍙樼畝鍗曚簡銆?/span>

甯уご鍙湁涓や釜瀛楁锛氱被鍨嬪拰闀垮害锛岃€屼笖鍚屾牱閮介噰鐢ㄥ彉闀跨紪鐮侊紝鏈€灏忓彧闇€瑕佷袱涓瓧鑺傘€?/span>

HTTP/3灞曟湜

HTTP/3 閲岀殑甯т粛鐒跺垎鎴愭暟鎹抚鍜屾帶鍒跺抚涓ょ被锛孒EADERS 甯у拰 DATA 甯т紶杈撴暟鎹紝浣嗗叾浠栦竴浜涘抚鍥犱负鍦ㄤ笅灞傜殑 QUIC 閲屾湁浜嗘浛浠o紝鎵€浠ュ湪 HTTP/3 閲屽氨閮芥秷澶变簡锛屾瘮濡?RST_STREAM銆乄INDOW_UPDATE銆丳ING 绛夈€?/span>

澶撮儴鍘嬬缉绠楁硶鍦?HTTP/3 閲屽崌绾ф垚浜嗏€?/span>QPACK鈥濓紝浣跨敤鏂瑰紡涓婁篃鍋氫簡鏀瑰彉銆傝櫧鐒朵篃鍒嗘垚闈欐€佽〃鍜屽姩鎬佽〃锛屼絾鍦ㄦ祦涓婂彂閫?HEADERS 甯ф椂涓嶈兘鏇存柊瀛楁锛屽彧鑳藉紩鐢紝绱㈠紩琛ㄧ殑鏇存柊闇€瑕佸湪涓撻棬鐨勫崟鍚戞祦涓婂彂閫佹寚浠ゆ潵绠$悊锛岃В鍐充簡 HPACK 鐨勨€滈槦澶撮樆濉炩€濋棶棰樸€?/span>

鍙﹀锛孮PACK 鐨勫瓧鍏镐篃鍋氫簡浼樺寲锛岄潤鎬佽〃鐢变箣鍓嶇殑 61 涓鍔犲埌浜?98 涓紝鑰屼笖搴忓彿浠?0 寮€濮嬶紝涔熷氨鏄鈥?authority鈥濈殑缂栧彿鏄?0銆?/span>


HTTP/3 鏈嶅姟鍙戠幇

璁蹭簡杩欎箞澶氾紝涓嶇煡閬撲綘娉ㄦ剰鍒颁簡娌℃湁锛欻TTP/3 娌℃湁鎸囧畾榛樿鐨勭鍙e彿锛屼篃灏辨槸璇翠笉涓€瀹氶潪瑕佸湪 UDP 鐨?80 鎴栬€?443 涓婃彁渚?HTTP/3 鏈嶅姟銆?/span>

閭d箞锛岃鎬庝箞鈥滃彂鐜扳€滺TTP/3 鍛紵

杩欏氨瑕佺敤鍒?HTTP/2 閲岀殑鈥滄墿灞曞抚鈥濅簡銆傛祻瑙堝櫒闇€瑕佸厛鐢?HTTP/2 鍗忚杩炴帴鏈嶅姟鍣紝鐒跺悗鏈嶅姟鍣ㄥ彲浠ュ湪鍚姩 HTTP/2 杩炴帴鍚庡彂閫佷竴涓€?/span>Alt-Svc鈥濆抚锛屽寘鍚竴涓€渉3=host:port鈥濈殑瀛楃涓诧紝鍛婅瘔娴忚鍣ㄥ湪鍙︿竴涓鐐逛笂鎻愪緵绛変环鐨?HTTP/3 鏈嶅姟銆?/span>

娴忚鍣ㄦ敹鍒扳€淎lt-Svc鈥濆抚锛屼細浣跨敤 QUIC 寮傛杩炴帴鎸囧畾鐨勭鍙o紝濡傛灉杩炴帴鎴愬姛锛屽氨浼氭柇寮€ HTTP/2 杩炴帴锛屾敼鐢ㄦ柊鐨?HTTP/3 鏀跺彂鏁版嵁銆?/span>

灏忕粨

HTTP/3 缁煎悎浜嗘垜浠箣鍓嶈鐨勬墍鏈夋妧鏈紙HTTP/1銆丼SL/TLS銆丠TTP/2锛夛紝鍖呭惈鐭ヨ瘑鐐瑰緢澶氾紝姣斿闃熷ご闃诲銆?-RTT 鎻℃墜銆佽櫄鎷熺殑鈥滄祦鈥濄€佸璺鐢紝绠楀緱涓婃槸鈥滈泦澶ф垚涔嬩綔鈥濓紝闇€瑕佸涓嬩簺鍔熷か濂藉ソ浣撲細銆?/span>

HTTP/3 鍩轰簬 QUIC 鍗忚锛屽畬鍏ㄨВ鍐充簡鈥滈槦澶撮樆濉炩€濋棶棰橈紝寮辩綉鐜涓嬬殑琛ㄧ幇浼氫紭浜?HTTP/2锛?/span>

QUIC 鏄竴涓柊鐨勪紶杈撳眰鍗忚锛屽缓绔嬪湪 UDP 涔嬩笂锛屽疄鐜颁簡鍙潬浼犺緭锛?/span>

QUIC 鍐呭惈浜?TLS1.3锛屽彧鑳藉姞瀵嗛€氫俊锛屾敮鎸?0-RTT 蹇€熷缓杩烇紱

QUIC 鐨勬祦涓?HTTP/2 鐨勬祦寰堢浉浼硷紝浣嗗垎涓哄弻鍚戞祦鍜屽崟鍚戞祦锛?/span>

HTTP/3 娌℃湁鎸囧畾榛樿绔彛鍙凤紝闇€瑕佺敤 HTTP/2 鐨勬墿灞曞抚鈥淎lt-Svc鈥濇潵鍙戠幇銆?/span>


  

-娣卞叆鍘熺悊-  

   鐭ュ叾鐒跺苟鐭ュ叾鎵€浠ョ劧    

HTTP/3灞曟湜



以上是关于HTTP/3灞曟湜的主要内容,如果未能解决你的问题,请参考以下文章

HTTP/3 原理实战

计算机网络 ---- HTTP/1.1HTTP/2HTTP/3演变过程

计算机网络 ---- HTTP/1.1HTTP/2HTTP/3演变过程

HTTP 2 还没整明白呢,HTTP 3 又来了?

HTTP/3原理与实践