{"id":1904,"date":"2023-03-12T13:46:08","date_gmt":"2023-03-12T05:46:08","guid":{"rendered":"https:\/\/blog.cauchyschwarz.com\/?p=1904"},"modified":"2023-03-12T13:48:34","modified_gmt":"2023-03-12T05:48:34","slug":"1904","status":"publish","type":"post","link":"https:\/\/blog.cauchyschwarz.com\/?p=1904","title":{"rendered":"RFC 9002 &#8211; QUIC Loss Detection and Congestion Control"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002\">RFC 9002 &#8211; QUIC Loss Detection and Congestion Control<\/a><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e0ad999c5c7\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e0ad999c5c7\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#1Introduction\" >1.Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#3Design_of_the_QUIC_Transmission_Machinery\" >3.Design of the QUIC Transmission Machinery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#4QUIC%E4%B8%8ETCP%E7%9A%84%E4%B8%8D%E5%90%8C%E4%B9%8B%E5%A4%84\" >4.QUIC\u4e0eTCP\u7684\u4e0d\u540c\u4e4b\u5904<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#1%E4%B8%8D%E5%90%8C%E7%9A%84packet_number_spaces\" >1.\u4e0d\u540c\u7684packet number spaces<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#2%E5%8D%95%E8%B0%83%E9%80%92%E5%A2%9E%E7%9A%84packet_numbers\" >2.\u5355\u8c03\u9012\u589e\u7684packet numbers<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#3Clearer_Loss_Epoch\" >3.Clearer Loss Epoch<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#4No_Reneging\" >4.No Reneging<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#5More_ACK_Ranges\" >5.More ACK Ranges<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#6Explicit_Correction_for_Delayed_Acknowledgements\" >6.Explicit Correction for Delayed Acknowledgements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#7Probe_Timeout_Replaces_RTO_and_TLP\" >7.Probe Timeout Replaces RTO and TLP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#8The_Minimum_Congestion_Window_Is_Two_Packets\" >8.The Minimum Congestion Window Is Two Packets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#9Handshake_Packets_Are_Not_Special\" >9.Handshake Packets Are Not Special<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#5Estimating_the_Round-Trip_Time\" >5.Estimating the Round-Trip Time<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#51Generating_RTT_Samples\" >5.1Generating RTT Samples<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#52Estimating_min_rtt\" >5.2Estimating min_rtt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#53Estimating_smoothed_rtt_and_rttvar\" >5.3Estimating smoothed_rtt and rttvar<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#6Loss_Detection\" >6.Loss Detection<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#61_Acknowledgement-Based_Detection\" >6.1 Acknowledgement-Based Detection<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#611_Packet_Threshold\" >6.1.1 Packet Threshold<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#612_Time_Threshold\" >6.1.2 Time Threshold<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#62_Probe_Timeout\" >6.2 Probe Timeout<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#621_Computing_PTO\" >6.2.1 Computing PTO<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#622_Handshakes_and_New_Paths\" >6.2.2 Handshakes and New Paths<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#6221_Before_Address_Validation\" >6.2.2.1 Before Address Validation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#623_Speeding_up_Handshake_Completion\" >6.2.3 Speeding up Handshake Completion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#624_Sending_Probe_Packets\" >6.2.4 Sending Probe Packets<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#63_Handling_Retry_Packets\" >6.3 Handling Retry Packets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#64_Discarding_Keys_and_Packet_State\" >6.4 Discarding Keys and Packet State<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#7Congestion_Control\" >7.Congestion Control<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#71_Explicit_Congestion_Notification\" >7.1 Explicit Congestion Notification<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#72_Initial_and_Minimum_Congestion_Window\" >7.2 Initial and Minimum Congestion Window<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#73_Congestion_Control_States\" >7.3 Congestion Control States<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#731_Slow_Start\" >7.3.1 Slow Start<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#732_Recovery\" >7.3.2 Recovery<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#733_Congestion_Avoidance\" >7.3.3 Congestion Avoidance<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-36\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#74_Ignoring_Loss_of_Undecryptable_Packets\" >7.4 Ignoring Loss of Undecryptable Packets<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-37\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#75_Probe_Timeout\" >7.5 Probe Timeout<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-38\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#76_Persistent_Congestion\" >7.6 Persistent Congestion<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-39\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#761_Duration\" >7.6.1 Duration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-40\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#762_Establishing_Persistent_Congestion\" >7.6.2 Establishing Persistent Congestion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-41\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#763_Example\" >7.6.3 Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-42\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#77_Pacing\" >7.7 Pacing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-43\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#78_Underutilizing_the_Congestion_Window\" >7.8 Underutilizing the Congestion Window<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-44\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#8Security_Considerations\" >8.Security Considerations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-45\" href=\"https:\/\/blog.cauchyschwarz.com\/?p=1904\/#%E6%9C%AF%E8%AF%AD\" >\u672f\u8bed<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1Introduction\"><\/span>1.Introduction<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3Design_of_the_QUIC_Transmission_Machinery\"><\/span>3.Design of the QUIC Transmission Machinery<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>QUIC packet\u4e2d\u7684\u5e27\u7c7b\u578b\u5f71\u54cd\u7740QUIC\u7684\u4e22\u5305\u6062\u590d\u548c\u62e5\u585e\u63a7\u5236\u903b\u8f91\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>All packets are acknowledged, though packets that contain no ack-eliciting frames are only acknowledged along with ack-eliciting packets.<\/li>\n<\/ul>\n\n\n\n<p>\u6240\u6709\u7684\u5305\u90fd\u9700\u8981ack\uff0c\u9664\u4e86\u90a3\u79cd\u53ea\u5305\u542bno ack-eliciting frames\u7684\u5305\u662f\u7531\u5176\u4ed6ack-eliciting packets\u89e6\u53d1ack\u7684\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Long header packets that contain CRYPTO frames are critical to the performance of the QUIC handshake and use shorter timers for acknowledgment.<\/li>\n<\/ul>\n\n\n\n<p>\u5e26\u6709\u957f\u5305\u5934\u3001\u5e26\u6709CRYPTO frames\u7684\u5305\u5bf9QUIC\u7684\u63e1\u624b\u6027\u80fd\u81f3\u5173\u91cd\u8981\uff0c\u56e0\u6b64\u5bf9\u8fd9\u4e9b\u5305\u4f7f\u7528\u65f6\u95f4\u66f4\u77ed\u7684ack timer\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Packets containing frames besides ACK or CONNECTION_CLOSE frames count toward congestion control limits and are considered to be in flight.<\/li>\n<\/ul>\n\n\n\n<p>\u5305\u542b\u4e86\u9664ACK\/CONNECTION_CLOSE frames\u4e4b\u5916\u7684frame\u7684\u5305\uff0c\u8981\u53d7\u62e5\u585e\u7b97\u6cd5\u7684\u63a7\u5236\uff0c\u5e76\u4e14\u7b97\u5230inflight\u91cc\u53bb\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Packets containing frames besides ACK or CONNECTION_CLOSE frames count toward congestion control limits and are considered to be in flight.<\/li>\n<\/ul>\n\n\n\n<p>PADDING frames\u8981\u7b97\u5230inflight\u91cc\uff0c\u4f46\u662f\u4e0d\u51fa\u89e6\u53d1ack\u7684\u53d1\u9001\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4QUIC%E4%B8%8ETCP%E7%9A%84%E4%B8%8D%E5%90%8C%E4%B9%8B%E5%A4%84\"><\/span>4.QUIC\u4e0eTCP\u7684\u4e0d\u540c\u4e4b\u5904<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1%E4%B8%8D%E5%90%8C%E7%9A%84packet_number_spaces\"><\/span>1.\u4e0d\u540c\u7684packet number spaces<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC uses separate packet number spaces for each encryption level, except 0-RTT and all generations of 1-RTT keys use the same packet number space.<\/p>\n\n\n\n<p>\u4e0d\u540c\u52a0\u5bc6\u7ea7\u522b\u7684\u5305\u7684packet number\u6240\u5904\u7684packet number space\u4e0d\u4e00\u6837\uff0c\u4fdd\u8bc1\u4e86\u4e0d\u540c\u52a0\u5bc6\u7ea7\u522b\u7684\u5305\u4e0d\u4f1a\u88ab\u6df7\u6dc6\u5bfc\u81f4\u4f2a\u91cd\u4f20\u3002\u4e0d\u8fc7RTT\u7684\u6d4b\u91cf\u662f\u4e0d\u533a\u5206packet number space\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2%E5%8D%95%E8%B0%83%E9%80%92%E5%A2%9E%E7%9A%84packet_numbers\"><\/span>2.\u5355\u8c03\u9012\u589e\u7684packet numbers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u5c06delivery order\u548ctransmission order\u533a\u5206\u5f00\u6765\uff0c\u907f\u514d\u4e86TCP\u4e0d\u80fd\u533a\u5206\u539f\u59cb\u5305\u548c\u91cd\u4f20\u5305\u7684\u95ee\u9898\u3002transmission order\u901a\u8fc7packet number\u786e\u5b9a\uff0cdelivery order\u901a\u8fc7STREAM frames\u4e2d\u7684stream offset\u786e\u5b9a\u3002\u8fd9\u79cd\u8bbe\u8ba1\u907f\u514d\u4e86\u4f2a\u91cd\u4f20\u95ee\u9898\u7684\u53d1\u751f\uff0c\u540c\u65f6\u53ef\u4ee5\u83b7\u5f97\u4e00\u4e2a\u66f4\u52a0\u7cbe\u786e\u7684RTT\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3Clearer_Loss_Epoch\"><\/span>3.Clearer Loss Epoch<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u7684loss epoch\u8ba1\u7b97\u65b9\u5f0f\uff1a\u4e22\u5305\u65f6\u89e6\u53d1\u5e76\u6807\u8bb0loss epoch\u5f00\u59cb\uff0c\u6536\u5230loss epoch\u5f00\u59cb\u4e4b\u540e\u53d1\u51fa\u53bb\u7684\u5305\u7684ack\u65f6\u6807\u8bb0\u8fd9\u4e2aloss epoch\u7ed3\u675f\u3002<\/p>\n\n\n\n<p>TCP\u7684loss epoch\u8ba1\u7b97\u65b9\u5f0f\uff1a\u8981\u7b49\u4e22\u7684\u5305\u6210\u529f\u91cd\u4f20(\u6536\u5230ack)\u624d\u7b97\u7ed3\u675f\u3002<\/p>\n\n\n\n<p>QUIC\u7684\u4e00\u4e2aLoss Epoch\u6301\u7eed\u5927\u7ea6\u4e00\u4e2around\uff0c\u800cTCP\u7684Loss epoch\u53ef\u80fd\u6301\u7eed\u591a\u4e2around\uff0c\u56e0\u4e3a\u4e00\u4e2a\u5305\u53ef\u80fd\u9700\u8981\u91cd\u4f20\u591a\u6b21\u624d\u80fd\u88ab\u6210\u529f\u53d1\u5230\u5bf9\u7aef\u3002<\/p>\n\n\n\n<p>TCP\u548cQUIC\u90fd\u9700\u8981\u5728\u9047\u5230Loss Epoch\u65f6\u51cf\u5c11\u62e5\u585e\u7a97\u53e3\uff0c\u7531\u4e8eLoss Epoch\u7684\u673a\u5236\u4e0d\u540c\uff0cQUIC\u5927\u7ea6\u5728\u4e22\u5305\u7684\u6bcf\u4e2around\u8fdb\u884c\u4e00\u6b21\u51cf\u5c11\u62e5\u585e\u7a97\u53e3\u7684\u64cd\u4f5c\uff0c\u800cTCP\u5219\u53ef\u80fd\u662f\u591a\u4e2around\u624d\u6267\u884c\u4e00\u6b21\u51cf\u5c11\u62e5\u585e\u7a97\u53e3\u7684\u64cd\u4f5c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4No_Reneging\"><\/span>4.No Reneging<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u652f\u6301\u7c7b\u4f3cSACK\u7684\u673a\u5236\uff0c\u4f46\u662f\u4e0d\u652f\u6301reneging\uff0c\u8fd9\u6837\u53ef\u4ee5\u7b80\u5316\u53cc\u7aef\u7684\u5b9e\u73b0\u548c\u51cf\u5c0f\u53d1\u9001\u7aef\u7684\u5185\u5b58\u538b\u529b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5More_ACK_Ranges\"><\/span>5.More ACK Ranges<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>TCP SACK\u7531\u4e8eTCP\u9009\u9879\u957f\u5ea6\u7684\u9650\u5236\u53ea\u80fd\u5305\u542b\u6700\u591a3\u4e2arange\uff0c\u800cQUIC\u7684ack\u5305\u4e0d\u53d7\u6b64\u9650\u5236\uff0c\u56e0\u6b64\u53ef\u4ee5\u5305\u542b\u66f4\u591arange\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6Explicit_Correction_for_Delayed_Acknowledgements\"><\/span>6.Explicit Correction for Delayed Acknowledgements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u63a5\u6536\u7aef\u4f1a\u8ba1\u7b97ack delay\u65f6\u95f4\uff0c\u53d1\u9001\u7aef\u53ef\u4ee5\u901a\u8fc7\u51cf\u53bb\u8fd9\u4e2aack delay\u65f6\u95f4\u7b97\u51fa\u4e00\u4e2a\u66f4\u51c6\u786e\u7684RTT\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7Probe_Timeout_Replaces_RTO_and_TLP\"><\/span>7.Probe Timeout Replaces RTO and TLP<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u7528PTO\u66ff\u4ee3\u4e86RTO\u548cTLP\u3002\u76f8\u8f83\u4e8eRTO\uff0cQUIC\u7684\u4f18\u52bf\u5728\u4e8e\u5c06\u5bf9\u7aef\u53ef\u80fd\u51fa\u73b0\u7684\u6700\u5927ack delay\u8003\u8651\u4e86\u8fdb\u6765\uff0c\u800c\u4e0d\u662f\u4f7f\u7528\u4e00\u4e2a\u56fa\u5b9a\u7684timeout\u503c\u3002<\/p>\n\n\n\n<p>\u76f8\u8f83\u4e8eTLP\uff0cQUIC\u5728\u89e6\u53d1PTO\u65f6\uff0c\u4e0d\u4f1acollapse congestion window\uff0c\u907f\u514d\u4e86\u975e\u5fc5\u987b\u7684congestion window reduction\uff0c\u5f53\u7136\u548cTCP\u76f8\u6bd4\u662f\u66f4\u6fc0\u8fdb\u4e86\u3002<\/p>\n\n\n\n<p>\u5728PTO timer\u89e6\u53d1\u65f6\uff0cQUIC\u662f\u53ef\u4ee5\u4e34\u65f6\u5141\u8bb8probe packets\u8d85\u51facongestion window\u9650\u5236\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8The_Minimum_Congestion_Window_Is_Two_Packets\"><\/span>8.The Minimum Congestion Window Is Two Packets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>TCP\u8bbe\u7f6e\u62e5\u585e\u7a97\u53e3\u6700\u5c0f\u4e3a1\u4e2a\u5305\u3002\u5982\u679c\u8fd9\u4e2a\u5305\u4e22\u5931\u4e86\uff0c\u90a3\u4e48\u53d1\u7aef\u9700\u8981\u7b49\u5f851\u4e2aPTO(Probe Timeout)\u7684\u65f6\u95f4\u53bb\u89e6\u53d1\u91cd\u4f20\u3002\u62e5\u585e\u7a97\u53e3\u4e3a1\u4e2a\u5305\u4e5f\u66f4\u5bb9\u6613\u89e6\u53d1\u63a5\u6536\u7aefdelay ack\u7684\u903b\u8f91\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5QUIC\u5c06\u8fd9\u4e2a\u4e0b\u9650\u6539\u4e3a\u4e862\u4e2a\u5305\u3002\u867d\u7136\u8fd9\u53ef\u80fd\u589e\u52a0\u7f51\u7edc\u8d1f\u8f7d\uff0c\u4f46\u662f\u5728persistent congestion\u573a\u666f\u4e0b\uff0cQUIC\u4f1a\u6307\u6570\u964d\u4f4e\u5176\u53d1\u9001\u901f\u7387\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"9Handshake_Packets_Are_Not_Special\"><\/span>9.Handshake Packets Are Not Special<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>TCP\u4e2d\uff0cSYN\u548cSYN-ACK\u5305\u662f\u88ab\u7279\u6b8a\u5bf9\u5f85\u7684\uff0c<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc5681\">RFC5681<\/a>\uff1a<\/p>\n\n\n\n<p>SYN\u548cSYN-ACK\u5305\u7684ack\u662f\u7981\u6b62\u89e6\u53d1\u62e5\u585e\u7a97\u53e3\u7684\u589e\u52a0\u7684\uff0c\u540c\u65f6\u5982\u679cSYN\u6216\u8005SYN-ACK\u5305\u4e22\u4e86\uff0c\u90a3\u4e48\u521d\u59cb\u53d1\u9001\u7a97\u53e3\u5fc5\u987b\u88ab\u8bbe\u7f6e\u4e3a1\u4e2a\u5305(1 SMSS)\u3002<\/p>\n\n\n\n<p>QUIC\u4e2d\uff0cSYN\u3001SYN-ACK\u5305\u88ab\u5f53\u4f5c\u666e\u901a\u7684\u5e26\u6709\u63e1\u624b\u6570\u636e\u7684\u5305\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5Estimating_the_Round-Trip_Time\"><\/span>5.Estimating the Round-Trip Time<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u5bf9\u6bcf\u4e00\u6761path\uff0cQUIC\u901a\u8fc7\u63a5\u6536\u65f6\u95f4\u51cf\u53bb\u53d1\u9001\u65f6\u95f4\u548c\u5bf9\u7aef\u4e0a\u62a5\u7684ack delay\u5f97\u5230RTT\u91c7\u6837\u503c\uff0c\u5e76\u7ef4\u62a43\u4e2a\u5173\u4e8ertt\u7684\u503c\uff1amin_rtt(minimum value over a period of time)\uff0csmoothed_rtt(exponentially weighted moving average)\uff0crttvar(the mean deviation)\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"51Generating_RTT_Samples\"><\/span>5.1Generating RTT Samples<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>An endpoint generates an RTT sample on receiving an ACK frame that meets the following two conditions:<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#section-5.1-1\">\u00b6<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the largest acknowledged packet number is newly acknowledged, and<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#section-5.1-2.1\">\u00b6<\/a><\/li>\n\n\n\n<li>at least one of the newly acknowledged packets was ack-eliciting.<\/li>\n<\/ul>\n\n\n\n<p>\u80fd\u751f\u6210RTT\u91c7\u6837\u7684ACK frame\u5fc5\u987b\u6ee1\u8db3\u4e24\u4e2a\u6761\u4ef6\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8be5ACK frame\u66f4\u65b0\u4e86largest acked packet number\uff1b<\/li>\n\n\n\n<li>\u8be5ACK frame\u81f3\u5c11ack\u4e86\u4e00\u4e2aack-eliciting \u5305\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8ba1\u7b97\u516c\u5f0f\uff1alarget_rtt = ack_time &#8211; sent_time_of_largest_acked<\/p>\n\n\n\n<p>\u8fd9\u91cc\u7684largest_rtt\u610f\u601d\u662f\u4f7f\u7528\u8be5ACK frame\u66f4\u65b0\u540e\u7684largest acked packet number\u8fd9\u4e2a\u5305\u7684\u53d1\u9001\u3001ack\u65f6\u95f4\u6765\u8ba1\u7b97rtt\uff0c\u800c\u4e0d\u662f\u8bf4\u8fd9\u6837\u7b97\u51fa\u6765\u7684rtt\u6709\u201d\u6700\u5927\u201d\u7684\u610f\u5473\u3002\u56e0\u4e3a\u5bf9\u7aef\u4e0a\u62a5\u7684ack delay\u503c\u662f\u57fa\u4e8e\u8fd9\u4e2alargest acked packet number\u5bf9\u5e94\u7684\u5305\u8ba1\u7b97\u7684\uff0c\u6240\u4ee5\u8ba1\u7b97RTT\u91c7\u6837\u503c\u662f\u9700\u8981\u7528\u8fd9\u4e2a\u5305\u6765\u8ba1\u7b97\u3002<\/p>\n\n\n\n<p>\u4ece\u516c\u5f0f\u6765\u770b\uff0cack delay\u6ca1\u6709\u76f4\u63a5\u53c2\u4e0eRTT\u91c7\u6837\u503c\u7684\u8ba1\u7b97\uff0c\u4e5f\u6ca1\u6709\u7528\u5728min_rtt\u7684\u8ba1\u7b97\u4e2d\uff0c\u800c\u662f\u7528\u5728\u4e86smoothed_rtt\u548crttvar\u7684\u8ba1\u7b97\u4e2d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"52Estimating_min_rtt\"><\/span>5.2Estimating min_rtt<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>min_rtt\u8ba1\u7b97\u662f\u4e0d\u8003\u8651ack delay\u7684\u5f71\u54cd\u7684\uff0cmin_rtt\u63d0\u4f9b\u4e86\u4e00\u4e2asmoothed_rtt\u7684\u8ba1\u7b97\u7ed3\u679c\u7684\u4e0b\u9650\u3002<\/p>\n\n\n\n<p>\u5728\u9047\u5230persistent congestion\u65f6\uff0cmin_rtt\u9700\u8981\u66f4\u65b0\u4e3a\u6700\u65b0RTT\u91c7\u6837\u503c\uff0c\u5e76\u4e14smoothed_rtt\u4e5f\u8981\u91cd\u65b0\u4f30\u7b97\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"53Estimating_smoothed_rtt_and_rttvar\"><\/span>5.3Estimating smoothed_rtt and rttvar<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8ba1\u7b97smoothed_rtt\u65f6\uff0cRTT\u91c7\u6837\u503c\u662f\u8981\u6263\u9664ack delay\u7684\u3002<\/p>\n\n\n\n<p>\u5728\u63e1\u624b\u5b8c\u6210\u524d\uff0c\u5bf9\u7aef\u4e0a\u62a5\u7684ack delay\u53ef\u80fd\u8d85\u51fa\u5bf9\u7aef\u7684max_ack_delay\u8fd9\u4e2a\u503c\uff0c\u56e0\u6b64\u5728\u63e1\u624b\u5b8c\u6210\u524d\u53ef\u4ee5\u5ffd\u7565max_ack_delay\u8fd9\u4e2a\u503c(\u56e0\u4e3a\u63e1\u624b\u9636\u6bb5\u53ef\u80fd\u8ba1\u7b97\u91cf\u5927\u5bfc\u81f4\u5bf9\u7aef\u7684ack delay\u5927\uff0c\u4f46\u662f\u63e1\u624b\u5b8c\u6210\u540e\u8fd9\u79cd\u95ee\u9898\u5c31\u5e94\u8be5\u4e0d\u5b58\u5728\u4e86)\u3002<\/p>\n\n\n\n<p>\u603b\u4e4b\u63e1\u624b\u5b8c\u6210\u524d\uff0cack delay\u7684\u503c\u662f\u9700\u8981\u7279\u6b8a\u5904\u7406\u7684\uff0c\u5982\u679c\u63e1\u624b\u5b8c\u6210\u524d\u5bf9\u7aef\u4e0a\u62a5\u7684ack delay\u5bfc\u81f4\u7b97\u51fa\u6765\u7684RTT\u6bd4min_rtt\u8fd8\u5c0f\uff0c\u662f\u53ef\u4ee5\u5ffd\u7565\u6389\u8fd9\u79cdRTT\u91c7\u6837\u503c\u7684\u3002<\/p>\n\n\n\n<p>\u63e1\u624b\u5b8c\u6210\u540e\uff0cack delay\u5e94\u8be5\u53d6min(ack_delay\uff0cmax_ack_delay)\uff0c\u5982\u679c\u6263\u6389min(ack_delay, max_ack_delay)\u540e\uff0cRTT\u7684\u503c\u6bd4min_rtt\u8fd8\u5c0f\u4e86\uff0c\u90a3\u4e48\u8fd9\u4e2aRTT\u91c7\u6837\u503c\u5c31\u4e0d\u5e94\u8be5\u6263\u9664ack delay\uff0c\u800c\u662f\u76f4\u63a5\u53c2\u4e0esmoothed_rtt\u7684\u8ba1\u7b97\u3002<\/p>\n\n\n\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u53d1\u9001\u7aef\u6536\u5230ack\u540e\u4e5f\u4e0d\u662f\u7acb\u5373\u5904\u7406\u8fd9\u4e2aack\u7684\uff0c\u6bd4\u5982\u6587\u6863\u4e2d\u8bb2\u76840-RTT\u60c5\u51b5\uff0c\u53d1\u9001\u7aef\u4e0d\u80fd\u7acb\u5373\u89e3\u5bc6\u6536\u5230\u7684ack\uff0c\u8fd9\u4e2a\u65f6\u5019\u8ba1\u7b97smoothed_rtt\u8981\u628a\u8fd9\u4e2a\u4e0d\u80fd\u89e3\u5bc6\u5bfc\u81f4\u7684\u5ef6\u8fdf\u4e5f\u7ed9\u6263\u9664\u6389\u3002<\/p>\n\n\n\n<p>smoothed_rtt\u548crttvar\u7684\u66f4\u65b0\u8fc7\u7a0b<\/p>\n\n\n\n<p>1.\u8fde\u63a5\u5f00\u59cb\u6216\u8fde\u63a5\u8fc1\u79fb\u540e\uff1a<\/p>\n\n\n\n<p>smoothed_rtt = kInitialRtt<\/p>\n\n\n\n<p>rttvar = kInitialRtt \/ 2<\/p>\n\n\n\n<p>2.\u5f97\u5230\u7b2c\u4e00\u4e2aRTT sample\u540e\uff1a<\/p>\n\n\n\n<p>smoothed_rtt = latest_rtt<\/p>\n\n\n\n<p>rttvar = latest_rtt \/ 2<\/p>\n\n\n\n<p>3.\u63a5\u4e0b\u6765smoothed_rtt\u548crttvar\u7684\u6f14\u5316\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<p>ack_delay = decoded acknowledgment delay from ACK frame<\/p>\n\n\n\n<p>if (handshake confirmed):<\/p>\n\n\n\n<p>&nbsp;&nbsp;ack_delay = min(ack_delay, max_ack_delay)<\/p>\n\n\n\n<p>adjusted_rtt = latest_rtt<\/p>\n\n\n\n<p>if (latest_rtt &gt;= min_rtt + ack_delay):<\/p>\n\n\n\n<p>&nbsp;&nbsp;adjusted_rtt = latest_rtt &#8211; ack_delay<\/p>\n\n\n\n<p>smoothed_rtt = 7\/8 * smoothed_rtt + 1\/8 * adjusted_rtt<\/p>\n\n\n\n<p>rttvar_sample = abs(smoothed_rtt &#8211; adjusted_rtt)<\/p>\n\n\n\n<p>rttvar = 3\/4 * rttvar + 1\/4 * rttvar_sample<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6Loss_Detection\"><\/span>6.Loss Detection<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>QUIC\u901a\u8fc7ack\u6765\u68c0\u6d4b\u4e22\u5305\uff0c\u901a\u8fc7PTO\u6765\u786e\u4fddack\u88ab\u6536\u5230\u3002\u9047\u5230\u4e22\u5305\u65f6\uff0cQUIC\u53ef\u4ee5\u9009\u62e9\u91cd\u4f20\u3001sending an updated frame\uff0cor discarding the frame 3\u79cd\u5e94\u5bf9\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u4e22\u5305\u68c0\u6d4b\/PTO\u662f\u5728\u6bcf\u4e2apacket number space\u91cc\u5206\u522b\u8fdb\u884c\u7684\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"61_Acknowledgement-Based_Detection\"><\/span>6.1 Acknowledgement-Based Detection<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>QUIC\u7684acknowledged-based detection\u5b9e\u73b0\u4e86TCP\u4e2d\u76845\u79cd\u7b97\u6cd5\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Fast Retransmit<\/li>\n\n\n\n<li>Early Retransmit<\/li>\n\n\n\n<li>Forward Acknowledgement<\/li>\n\n\n\n<li>SACK loss recovery<\/li>\n\n\n\n<li>RACK-TLP<\/li>\n<\/ol>\n\n\n\n<p>\u5224\u65ad\u4e00\u4e2a\u5305\u4e22\u5931\u7684\u6761\u4ef6(\u5fc5\u987b\u540c\u65f6\u6ee1\u8db3)\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The packet is unacknowledged, in flight, and was sent prior to an acknowledged packet.<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#section-6.1-3.1\">\u00b6<\/a><\/li>\n\n\n\n<li>The packet was sent kPacketThreshold packets before an acknowledged packet (<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#packet-threshold\">Section 6.1.1<\/a>), or it was sent long enough in the past (<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#time-threshold\">Section 6.1.2<\/a>).<\/li>\n<\/ul>\n\n\n\n<p>\u7b2c\u4e8c\u70b9\u4e2d\u7684time threshold\u548cpacket threshold\u662f\u4e3a\u4e86\u5bb9\u5fcd\u4e00\u5b9a\u7a0b\u5ea6\u7684\u4e71\u5e8f\u3002\u5177\u4f53\u7684QUIC\u5b9e\u73b0\u53ef\u4ee5\u8bbe\u8ba1\u81ea\u9002\u5e94\u8c03\u6574\u7684time threshold\u548cpacket threshold\u6765\u51cf\u5c11\u4e22\u5305\u8bef\u5224\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"611_Packet_Threshold\"><\/span>6.1.1 Packet Threshold<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u63a8\u8350\u7684\u4e71\u5e8f\u9608\u503ckPacketThreshold\u662f3\uff0c\u5177\u4f53\u7684QUIC\u5b9e\u73b0\u4e0d\u5e94\u8be5\u5c06\u8fd9\u4e2a\u9608\u503c\u8bbe\u7f6e\u4e3a\u6bd43\u66f4\u5c0f\u7684\u503c\u3002\u56e0\u4e3aQUIC\u7684\u5305\u662f\u52a0\u5bc6\u7684\uff0c\u4e2d\u95f4\u8bbe\u5907\u4e0d\u80fd\u6839\u636eQUIC\u8fde\u63a5\u7684packet number\u53bb\u8c03\u6574QUIC\u5305\u7684\u987a\u5e8f\uff0c\u6240\u4ee5\u7f51\u7edc\u4e2dQUIC\u7684\u4e71\u5e8f\u6982\u7387\u53ef\u80fd\u6bd4TCP\u5927\u3002RACK\u7b97\u6cd5\u88ab\u7528\u5728TCP\u4e2d\u51cf\u5c11\u4e71\u5e8f\u5bfc\u81f4\u7684\u4e22\u5305\u8bef\u5224\uff0c\u5e76\u4e14\u9884\u8ba1\u5728QUIC\u4e2d\u4e5f\u53ef\u4ee5\u53d1\u6325\u76f8\u540c\u4f5c\u7528\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"612_Time_Threshold\"><\/span>6.1.2 Time Threshold<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u6536\u5230\u4e00\u4e2a\u5305\u7684ack\u540e\uff0c\u4ece\u6536\u5230ack\u8fd9\u4e2a\u65f6\u523b\u7b97\u8d77\uff0cTime Threshold\u4e4b\u524d\u53d1\u9001\u7684\u5305\u5e94\u8be5\u6807\u8bb0\u4e3a\u4e22\u5305\uff0cTime Threshold\u7684\u8ba1\u7b97\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<p>max(kTimeThreshold * max(smoothed_rtt, latest_rtt), kGranularity)<\/p>\n\n\n\n<p>\u5982\u679c\u6709\u6bd4largest_ack_number\u66f4\u65e9\u7684\u5305\u6ca1\u6709\u88ab\u6807\u8bb0\u4e3a\u4e22\u5931\uff0c\u90a3\u4e48\u5e94\u8be5\u8bbe\u7f6e\u4e00\u4e2a\u65f6\u9650\u4e3a\u5269\u4f59\u65f6\u95f4(Time Threshold\u51cf\u53bb\u8fd9\u4e2a\u5305\u5df2\u7ecf\u53d1\u51fa\u53bb\u7684\u65f6\u95f4)\u7684timer\u6765\u68c0\u6d4b\u4e22\u5305\u3002\u6ce8\u610f\u8fd9\u91cc\u8bf4\u7684\u662f\u5728largest_ack_number\u4e4b\u524d\u53d1\u51fa\u53bb\u7684\u5305\u624d\u53ef\u4ee5\u7528\u8fd9\u4e2atime threshold\u6765\u68c0\u6d4b\u4e22\u5305\u3002\u5bf9\u4e8elarget_ack_number\u4e4b\u540e\u7684\u5305\u8fd9\u4e2atime threshold\u4e0d\u9002\u7528\uff0c\u800c\u662f\u5e94\u8be5\u7528PTO\u53bb\u89e6\u53d1\u5bf9\u7aef\u56de\u65b0\u7684ack\uff0c\u7136\u540e\u57fa\u4e8e\u65b0\u7684ack\u518d\u7528packet threshold\u548ctime threshold\u673a\u5236\u6765\u68c0\u6d4b\u4e22\u5305\u3002<\/p>\n\n\n\n<p>kTimeThreshold\u7684\u63a8\u8350\u503c\u4e3a9\/8\uff0ckGranularity\u7684\u63a8\u8350\u503c\u4e3a1ms\u3002<\/p>\n\n\n\n<p>\u5c0f\u7684TimeThreshold\u4f1a\u5bfc\u81f4\u66f4\u591a\u4e22\u5305\u8bef\u5224\uff0c\u800c\u5927\u7684TimeThreshold\u5219\u589e\u52a0\u4e86\u4e22\u5305\u68c0\u6d4b\u7684\u5ef6\u65f6\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"62_Probe_Timeout\"><\/span>6.2 Probe Timeout<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53ack-eliciting packets\u6ca1\u6709\u5728\u671f\u671b\u65f6\u95f4\u5185\u8fd4\u56deack\u6216\u8005server\u6ca1\u6709validate\u5bf9\u7aef\u5730\u5740\u65f6\uff0cProbe Timeout(PTO)\u4f1a\u89e6\u53d1\u53d1\u9001\u4e00\u4e2a\u6216\u4e24\u4e2aprobe datagram\u7ed9\u5bf9\u7aef\u3002<\/p>\n\n\n\n<p>PTO\u4e0d\u662f\u7528\u6765\u68c0\u6d4b\u4e22\u5305\u7684\uff0c\u800c\u4e14\u4e5f\u7981\u6b62\u56e0\u4e3aPTO\u7684\u89e6\u53d1\u5c06\u672a\u88aback\u7684\u5305\u6807\u8bb0\u4e3a\u4e22\u5305\u3002PTO\u7684\u4f5c\u7528\u662f\u89e3\u51b3\u5c3e\u4e22\u5305\u95ee\u9898\uff1a<\/p>\n\n\n\n<p>A PTO enables a connection to recover from loss of tail packets or acknowledgments.<\/p>\n\n\n\n<p>Probe Timeout\u662f\u5728\u6bcf\u4e2apacket number space\u91cc\u5355\u72ec\u7b97\uff0c\u4f46\u662f\u53ea\u6709\u4e00\u4e2aProbe Timeout\u7684\u5b9a\u65f6\u5668\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"621_Computing_PTO\"><\/span>6.2.1 Computing PTO<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5f53\u4e00\u4e2aack-eliciting packet\u53d1\u51fa\u53bb\u540e\uff0c\u53d1\u7aef\u4e3a\u5176\u8bbe\u7f6e\u4e00\u4e2aPTO timer\uff1a<\/p>\n\n\n\n<p>PTO = smoothed_rtt + max(4*rttvar, kGranularity) + max_ack_delay<\/p>\n\n\n\n<p>\u5bf9\u4e8eInitial or Handshake packet number spaces\uff0cma_ack_delay\u7684\u53d6\u503c\u8bbe\u7f6e\u4e3a0\uff0c\u56e0\u4e3a\u5bf9\u7aef\u4e0d\u5e94\u8be5delay\u8fd9\u79cd\u5305\u7684ack\u7684\u53d1\u9001\u3002<\/p>\n\n\n\n<p>When ack-eliciting packets in multiple packet number spaces are in flight, the timer <strong>MUST<\/strong> be set to the earlier value of the Initial and Handshake packet number spaces.<\/p>\n\n\n\n<p>\u5982\u679c\u6709\u591a\u4e2apacket number space\u7684\u5305\u5904\u4e8einflight\u72b6\u6001\uff0cPTO\u5b9a\u65f6\u5668\u5fc5\u987b\u8bbe\u7f6e\u4e3aInitial and Handshake packet number spaces\u4e4b\u4e2d\u7684\u8f83\u5c0f\u503c\u3002<\/p>\n\n\n\n<p>\u5728\u63e1\u624b\u5b8c\u6210\u524d\uff0c\u7981\u6b62\u4e3aApplication Data packet number space\u7684\u5305\u8bbe\u7f6ePTO timer\uff0c\u56e0\u4e3a\u63e1\u624b\u90fd\u672a\u5b8c\u6210\uff0c\u53d1\u7aef\u548c\u6536\u7aef\u90fd\u4e0d\u4e00\u5b9a\u80fd\u591f\u6b63\u5e38\u89e3\u5bc6\u6536\u5230\u7684\u5305\uff0c\u6b64\u65f6\u9700\u8981\u907f\u514d\u91cd\u4f20\u8fd9\u4e9b\u53ef\u80fd\u4e0d\u80fd\u89e3\u5bc6\u7684\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u9047\u5230\u4ee5\u4e0b\u60c5\u51b5\uff0c\u9700\u8981\u91cd\u542fPTO timer\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u53d1\u51faack-eliciting\u5305\u6216\u8005\u6536\u5230ack-eliciting\u5305\u7684ack<\/li>\n\n\n\n<li>Initial or Handshake keys are discarded<\/li>\n<\/ul>\n\n\n\n<p>PTO timer\u89e6\u53d1\u65f6\u9700\u8981\u5e94\u7528\u4e00\u4e2a\u6307\u6570\u9000\u907f\u7b97\u6cd5\uff0c\u6bcf\u6b21PTO timer\u89e6\u53d1\u65f6\uff0cPTO timer\u7684\u503c\u9700\u8981\u52a0\u500d\uff0c\u800c\u5f53\u6536\u5230ack\u65f6\uff0c\u8fd9\u4e2a\u6307\u6570\u9000\u907f\u7684\u7cfb\u6570\u91cd\u7f6e\u4e3a1\u3002\u4f46\u662f\u5bf9\u4e8eInitial packets\uff0c\u6536\u5230\u7684ack\u662f\u4e0d\u91cd\u7f6ebackoff factor\u7684\u3002<\/p>\n\n\n\n<p>PTO\u8fde\u7eed\u89e6\u53d1\u65f6\uff0c\u5176\u603b\u65f6\u95f4\u53d7\u9650\u4e8e\u8fde\u63a5\u7684idle timeout(\u56e0\u4e3a\u76f4\u63a5\u5224\u65ad\u4e3a\u65ad\u8fde\u63a5\u4e86)\u3002<\/p>\n\n\n\n<p>\u5b58\u5728time threshold\u7684timer\u65f6\u7981\u6b62\u8bbe\u7f6ePTO timer\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"622_Handshakes_and_New_Paths\"><\/span>6.2.2 Handshakes and New Paths<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u65ad\u8fde\u6062\u590d\u7684\u8fde\u63a5\u53ef\u4ee5\u4f7f\u7528\u4e4b\u524d\u7684smoothed_rtt\u4f5c\u4e3ainitial RTT\u3002\u5982\u679c\u4e4b\u524d\u6ca1\u6709RTT\u91c7\u6837\uff0cinitial RTT\u5e94\u8be5\u88ab\u8bbe\u7f6e\u4e3a333ms\uff0c\u8fd9\u4f7f\u5f97\u63e1\u624b\u9636\u6bb5\u7684PTO\u4ece1s\u5f00\u59cb\uff0c\u4e0eTCP\u7684initial RTO\u4e00\u81f4\u3002<\/p>\n\n\n\n<p>\u8fde\u63a5\u4e5f\u53ef\u4ee5\u7528\u53d1\u9001PATH_CHALLENGE\u548c\u6536\u5230PATH_RESPONSE\u4e4b\u95f4\u7684\u5ef6\u8fdf\u4f5c\u4e3anew path\u7684initial RTT\uff0c\u4f46\u662f\u8fd9\u4e2a\u5ef6\u8fdf\u4e0d\u5e94\u8be5\u4f5c\u4e3aRTT\u91c7\u6837\u3002<\/p>\n\n\n\n<p>\u5f53Initial keys\u548cHandshake keys\u88ab\u4e22\u5f03\u65f6\uff0cInitial packets\u548cHandshake packets\u90fd\u4e0d\u518d\u80fd\u88aback\uff0c\u8fd9\u4e9b\u5305\u90fd\u9700\u8981\u4eceInflight\u4e2d\u79fb\u9664\uff0c\u5e76\u4e14\u8fd8\u9700\u8981\u91cd\u7f6ePTO timer\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6221_Before_Address_Validation\"><\/span>6.2.2.1 Before Address Validation<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u5728server\u7aefvalidate\u5ba2\u6237\u7aef\u7684\u5730\u5740\u4e4b\u524d\uff0cPTO timer\u4e0d\u80fd\u8fdd\u53cdthe amount of data it can send is limited to three times the amount of data received\u8fd9\u4e2a\u539f\u5219\u3002<\/p>\n\n\n\n<p>\u800c\u5ba2\u6237\u7aef\u5219\u9700\u8981\u5728\u63e1\u624b\u5b8c\u6210\u524d\u4e3a\u5176\u63e1\u624b\u5305\u8bbe\u7f6ePTO timer\u5e76\u5728\u89e6\u53d1\u65f6\u53d1\u9001\u63e1\u624b\u5305(\u6709Handshake keys\u7684\u60c5\u51b5\u4e0b)\u6216\u8005\u53d1\u9001Initial packet(\u6ca1\u6709Handshake keys)\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"623_Speeding_up_Handshake_Completion\"><\/span>6.2.3 Speeding up Handshake Completion<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>When a server receives an Initial packet containing duplicate CRYPTO data, it can assume the client did not receive all of the server&#8217;s CRYPTO data sent in Initial packets, or the client&#8217;s estimated RTT is too small. When a client receives Handshake or 1-RTT packets prior to obtaining Handshake keys, it may assume some or all of the server&#8217;s Initial packets were lost.<\/p>\n\n\n\n<p>\u5728\u63e1\u624b\u5b8c\u6210\u4e4b\u524d\uff0c\u9047\u5230\u4e0a\u9762\u8fd9\u4e24\u79cd\u60c5\u51b5\uff0cendpoint\u53ef\u4ee5\u5728PTO\u89e6\u53d1\u4e4b\u524d\u8fdb\u884c\u91cd\u4f20\u3002<\/p>\n\n\n\n<p>To speed up handshake completion under these conditions, an endpoint <strong>MAY<\/strong>, for a limited number of times per connection, send a packet containing unacknowledged CRYPTO data earlier than the PTO expiry, subject to the address validation limits in <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9000#section-8.1\">Section 8.1<\/a> of [<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9000\">QUIC-TRANSPORT<\/a>]. Doing so at most once for each connection is adequate to quickly recover from a single packet loss. An endpoint that always retransmits packets in response to receiving packets that it cannot process risks creating an infinite exchange of packets.<\/p>\n\n\n\n<p>Endpoints can also use coalesced packets (see <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9000#section-12.2\">Section 12.2<\/a> of [<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9000\">QUIC-TRANSPORT<\/a>]) to ensure that each datagram elicits at least one acknowledgment. For example, a client can coalesce an Initial packet containing PING and PADDING frames with a 0-RTT data packet, and a server can coalesce an Initial packet containing a PING frame with one or more packets in its first flight.<\/p>\n\n\n\n<p>coalesced packets\uff0c\u5373\u628a\u51e0\u4e2a\u5305\u5408\u5e76\u5230\u4e00\u4e2a\u5305\u4e2d\u8fdb\u884c\u53d1\u9001\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u786e\u4fdd\u5bf9\u7aef\u81f3\u5c11\u4e3a\u8fd9\u4e2a\u5408\u5e76\u7684\u5305\u53d1\u9001\u81f3\u5c11\u4e00\u4e2aack\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"624_Sending_Probe_Packets\"><\/span>6.2.4 Sending Probe Packets<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>PTO timer\u89e6\u53d1\u65f6\uff0c\u53d1\u7aef\u9700\u8981\u53d1\u90011\u81f32\u4e2aack-eliciting\u5305\u3002\u9664\u4e86\u53d1\u9001\u89e6\u53d1PTO timer\u7684packet number space\u91cc\u7684\u5305\uff0c\u8fd8\u5e94\u5c3d\u53ef\u80fd\u53d1\u9001\u5176\u4ed6packet number space\u91cc\u7684\u5305\u4f5c\u4e3aprobe packets\u3002\u4f46\u662f\u53d1\u9001\u7684\u603b\u91cf\u4ecd\u7136\u5fc5\u987b\u4fdd\u6301\u57281\u81f32\u4e2aack-eliciting\u5305\u8fd9\u4e2a\u8303\u56f4\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u53d1\u7aef\u60f3\u8ba9\u6536\u7aef\u5c3d\u5feb\u56deack\uff0c\u53d1\u7aef\u53ef\u4ee5\u8ba9\u8df3\u8fc7\u4e00\u4e2apacket number\u6765\u6d88\u9664\u6536\u7aef\u7684ack delay\u3002<\/p>\n\n\n\n<p>QUIC\u5b9e\u73b0\u5e94\u8be5\u5728probe packet\u91cc\u643a\u5e26\u65b0\u7684\u6570\u636e\u800c\u4e0d\u662f\u91cd\u4f20\u7684\u6570\u636e\uff0c\u9664\u975e\u6ca1\u6709\u65b0\u7684\u6570\u636e\u53ef\u4ee5\u53d1\u4e86\u3002\u5b9e\u9645\u7684\u5177\u4f53\u5b9e\u73b0\u4e5f\u53ef\u4ee5\u91c7\u7528\u5176\u4ed6\u7684\u7b56\u7565\u51b3\u5b9aprobe packet\u91cc\u643a\u5e26\u4ec0\u4e48\u6570\u636e\u3002<\/p>\n\n\n\n<p>\u6ca1\u6709\u6570\u636e\u53ef\u53d1\u65f6(\u65b0\u6570\u636e\u548c\u91cd\u4f20\u90fd\u6ca1\u6709)\uff0c\u53d1\u7aef\u5e94\u8be5\u53d1\u4e00\u4e2a\u5305\u542bPING\u6216\u8005\u5176\u4ed6ack-eliciting frame\u7684\u5305\uff0c\u91cd\u7f6ePTO timer\u3002<\/p>\n\n\n\n<p>Alternatively, instead of sending an ack-eliciting packet, the sender <strong>MAY<\/strong> mark any packets still in flight as lost. Doing so avoids sending an additional packet but increases the risk that loss is declared too aggressively, resulting in an unnecessary rate reduction by the congestion controller.<\/p>\n\n\n\n<p>\u8fd9\u6bb5\u8bdd\u4e0e\u524d\u9762\u8bf4\u7684\u7981\u6b62\u56e0\u4e3aPTO timer\u7684\u89e6\u53d1\u6807\u8bb0\u4e22\u5305\u77db\u76fe\u4e86\uff0c\u4e0d\u80fd\u7406\u89e3\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"63_Handling_Retry_Packets\"><\/span>6.3 Handling Retry Packets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6536\u5230retry packet\u7684client\u4f1a\u91cd\u65b0\u5f00\u59cb\u5efa\u8fde\u8fc7\u7a0b\u5e76\u91cd\u7f6e\u62e5\u585e\u63a7\u5236\u548c\u4e22\u5305\u6062\u590d\u7684\u72b6\u6001\u3001\u91cd\u7f6e\u6240\u6709\u7684\u5b9a\u65f6\u5668\uff0c\u4f46\u662f\u4f1a\u4fdd\u7559\u52a0\u5bc6\u76f8\u5173\u7684\u63e1\u624b\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u901a\u8fc7retry packet\u8ba1\u7b97\u51faRTT\u4f5c\u4e3a\u91cd\u65b0\u5efa\u8fde\u8fc7\u7a0b\u4e2d\u7684\u521d\u59cbRTT\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"64_Discarding_Keys_and_Packet_State\"><\/span>6.4 Discarding Keys and Packet State<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>When Initial and Handshake packet protection keys are discarded (see <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9001#section-4.9\">Section 4.9<\/a> of [<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9001\">QUIC-TLS<\/a>]), all packets that were sent with those keys can no longer be acknowledged because their acknowledgments cannot be processed. The sender <strong>MUST<\/strong> discard all recovery state associated with those packets and <strong>MUST<\/strong> remove them from the count of bytes in flight.<\/p>\n\n\n\n<p>Endpoints stop sending and receiving Initial packets once they start exchanging Handshake packets; see <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9000#section-17.2.2.1\">Section 17.2.2.1<\/a> of [<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9000\">QUIC-TRANSPORT<\/a>]. At this point, recovery state for all in-flight Initial packets is discarded.<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#section-6.4-2\">\u00b6<\/a><\/p>\n\n\n\n<p>When 0-RTT is rejected, recovery state for all in-flight 0-RTT packets is discarded.<\/p>\n\n\n\n<p>If a server accepts 0-RTT, but does not buffer 0-RTT packets that arrive before Initial packets, early 0-RTT packets will be declared lost, but that is expected to be infrequent.<\/p>\n\n\n\n<p>It is expected that keys are discarded at some time after the packets encrypted with them are either acknowledged or declared lost. However, Initial and Handshake secrets are discarded as soon as Handshake and 1-RTT keys are proven to be available to both client and server; see <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9001#section-4.9.1\">Section 4.9.1<\/a> of [<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9001\">QUIC-TLS<\/a>].<\/p>\n\n\n\n<p>\u7b80\u8a00\u4e4b\uff0cQUIC\u4f7f\u7528\u7684\u662f\u524d\u5411\u52a0\u5bc6\uff0c\u5f53\u8fdb\u5165\u4e0b\u4e00\u52a0\u5bc6\u9636\u6bb5\u65f6\uff0c\u4e0a\u4e00\u52a0\u5bc6\u9636\u6bb5\u7684\u6570\u636e\u5df2\u7ecf\u65e0\u7528\uff0c\u4e0d\u9700\u8981\u91cd\u4f20\uff0c\u5e76\u4e14\u9700\u8981\u4eceinflight\u4e2d\u6263\u9664\u6389\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7Congestion_Control\"><\/span>7.Congestion Control<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p>\u8fd9\u7bc7\u89c4\u8303\u63cf\u8ff0\u7684\u662f\u4e00\u4e2aNewReno\u7b97\u6cd5\u7684\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p>\u548cTCP\u4e00\u6837\uff0c\u53ea\u5305\u542bACK frames\u7684\u5305\u4e0d\u7b97\u5728inflight\u91cc\uff0c\u5e76\u4e14\u4e0d\u53d7\u62e5\u585e\u63a7\u5236\u3002\u4f46\u662fQUIC\u5b9e\u73b0\u53ef\u4ee5\u53bb\u68c0\u6d4b\u8fd9\u4e9b\u53ea\u5305\u542bACK frames\u7684\u5305\u662f\u5426\u4e22\u5931\uff0c\u5e76\u4e14\u5229\u7528\u8fd9\u4e2a\u4fe1\u606f\u53bb\u8c03\u6574ack-only\u7684\u5305\u7684\u53d1\u9001\u901f\u7387\uff0c\u4f46\u662f\u8fd9\u7bc7\u89c4\u8303\u5e76\u6ca1\u6709\u63cf\u8ff0\u4e00\u4e2a\u8fd9\u6837\u7684\u673a\u5236\u3002<\/p>\n\n\n\n<p>QUIC\u7684cwnd\u4ee5bytes\u4e3a\u5355\u4f4d\u3002<\/p>\n\n\n\n<p>QUIC\u7684congestion control\u662f\u6bcf\u4e2apath\u5355\u72ec\u8fd0\u884c\u4e00\u4e2a\u62e5\u585e\u63a7\u5236\u903b\u8f91\u5b9e\u4f8b\uff0c\u5404\u4e2apath\u4e4b\u95f4\u7684\u62e5\u585e\u63a7\u5236\u4e92\u4e0d\u5f71\u54cd\u3002<\/p>\n\n\n\n<p>\u9664\u975ePTO timer\u89e6\u53d1\u6216\u8005\u8fdb\u5165recovery\u8fd9\u4e24\u4e2a\u7279\u6b8a\u72b6\u6001\uff0c\u7981\u6b62bytes_in_flight\u8d85\u51facwnd\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"71_Explicit_Congestion_Notification\"><\/span>7.1 Explicit Congestion Notification<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5982\u679c\u4f20\u8f93\u8def\u5f84\u652f\u6301ECN\uff0c\u90a3\u4e48QUIC\u5c06\u628aIP\u5934\u4e2d\u7684Congestion Experienced(CE) codepoint\u89c6\u4f5c\u62e5\u585e\u7684\u4fe1\u53f7\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"72_Initial_and_Minimum_Congestion_Window\"><\/span>7.2 Initial and Minimum Congestion Window<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u521d\u59cb\u62e5\u585e\u7a97\u53e3\u5e94\u8be5\u8bbe\u7f6e\u4e3a10MSS\uff0c\u5373max(14720, 2MSS)\u3002<\/p>\n\n\n\n<p>\u6700\u5c0f\u62e5\u585e\u7a97\u53e3\u8bbe\u7f6e\u4e3a2MSS\uff0c\u5e76\u4e14\u5728\u4ee5\u4e0b\u60c5\u51b5\u9700\u8981\u5c06\u62e5\u585e\u7a97\u53e3\u8bbe\u7f6e\u4e3a\u6700\u5c0f\u62e5\u585e\u7a97\u53e3\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u9047\u5230\u4e22\u5305\uff1b<\/li>\n\n\n\n<li>an increase in the peer-reported ECN-CE count<\/li>\n\n\n\n<li>persistent congestion<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"73_Congestion_Control_States\"><\/span>7.3 Congestion Control States<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>NewReno\u7684\u62e5\u585e\u63a7\u5236\u72b6\u6001\u8f6c\u6362\u56fe\uff1a<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/cqmAQHZ5DhJEkDA9qnaxVT5KujVoGGR0h5qeMVhBQV5f_kuoZZz7T88_HWVmk84wrygwfiBhdKn56tuh77FlNW1z0gEjhMJYSMDQQRXR3ZMJ-j08GfW3hoZ89dzTNWBIqayGjHp4_7S8bf1-lQIpUys\" width=\"539\" height=\"387\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"731_Slow_Start\"><\/span>7.3.1 Slow Start<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A NewReno sender is in slow start any time the congestion window is below the slow start threshold. A sender begins in slow start because the slow start threshold is initialized to an infinite value.<\/p>\n\n\n\n<p>While a sender is in slow start, the congestion window increases by the number of bytes acknowledged when each acknowledgment is processed. This results in exponential growth of the congestion window.<\/p>\n\n\n\n<p>The sender <strong>MUST<\/strong> exit slow start and enter a recovery period when a packet is lost or when the ECN-CE count reported by its peer increases.<a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9002#section-7.3.1-3\">\u00b6<\/a><\/p>\n\n\n\n<p>A sender reenters slow start any time the congestion window is less than the slow start threshold, which only occurs after persistent congestion is declared.<\/p>\n\n\n\n<p>cwnd\u4f4e\u4e8eslow start threshold\u65f6\uff0c\u8fde\u63a5\u5c31\u5904\u4e8eSlow Start\u72b6\u6001\u3002<\/p>\n\n\n\n<p>\u8fde\u63a5\u521d\u59cb\u65f6\uff0cslow start threshold\u88ab\u8bbe\u7f6e\u4e3a\u65e0\u7a77\u5927\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"732_Recovery\"><\/span>7.3.2 Recovery<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5df2\u7ecf\u8fdb\u5165recovery\u72b6\u6001\u65f6\u9047\u5230\u4e22\u5305\u6216ECN-CE count\u589e\u52a0\u4e0d\u4f1a\u5bfc\u81f4\u518d\u6b21\u8fdb\u5165recovery\u72b6\u6001\u3002<\/p>\n\n\n\n<p>\u5f53\u56e0\u4e22\u5305\u548cECN-CE count\u589e\u52a0\u8fdb\u5165recovery\u72b6\u6001\u65f6\uff0cslow start thershold\u66f4\u65b0\u4e3a\u5f53\u524dcwnd\u7684\u4e00\u534a\uff0c\u5e76\u4e14\u5728\u9000\u51fa\u5f53\u524drecovery\u72b6\u6001\u4e4b\u524d\uff0ccwnd\u4e5f\u9700\u8981\u8bbe\u7f6e\u4e3a\u5f53\u524dcwnd\u7684\u4e00\u534a\u3002\u5728cwnd\u51cf\u534a\u4e4b\u524d\u53ef\u4ee5\u53d1\u9001\u4e00\u4e2a\u5305\uff0c\u52a0\u901f\u4e22\u5305\u6062\u590d\u7684\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"733_Congestion_Avoidance\"><\/span>7.3.3 Congestion Avoidance<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5f53cwnd\u5927\u4e8e\u7b49\u4e8eslow start threshold\u5e76\u4e14\u4e0d\u662f\u5904\u4e8erecovery\u72b6\u6001\u65f6\uff0c\u53d1\u7aef\u5c31\u5904\u4e8econgestion avoidance\u72b6\u6001\u3002congestion avoidance\u72b6\u6001\u4e0b\u4f7f\u7528AIMD\u7684\u62e5\u585e\u63a7\u5236\u7b97\u6cd5\u9700\u8981\u9650\u5236cwnd\u7684\u589e\u957f\u901f\u7387\u4e3a\u6bcfack cwnd\u5927\u5c0f\u7684\u5305\uff0ccwnd\u81f3\u591a\u52a0\u4e00\u4e2amss\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"74_Ignoring_Loss_of_Undecryptable_Packets\"><\/span>7.4 Ignoring Loss of Undecryptable Packets<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4e0d\u80fd\u89e3\u5bc6\u7684\u5305\u7684\u4e22\u5305\u53ef\u4ee5\u5ffd\u7565\u6389\u3002\u4f46\u662f\uff1a<\/p>\n\n\n\n<p>Endpoints <strong>MUST NOT<\/strong> ignore the loss of packets that were sent after the earliest acknowledged packet in a given packet number space.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"75_Probe_Timeout\"><\/span>7.5 Probe Timeout<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>PTO timer\u89e6\u53d1\u540e\u53d1\u9001\u7684Probe Packets\u4e0d\u53d7cwnd\u9650\u5236\uff0c\u4f46\u662f\u8981\u7b97\u5230inflight\u91cc\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"76_Persistent_Congestion\"><\/span>7.6 Persistent Congestion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u53d1\u7aef\u53d1\u73b0\u6240\u6709\u7684\u5305\u90fd\u4e22\u4e86\uff0c\u5e76\u4e14\u662f\u4e00\u6bb5\u65f6\u95f4\u5185\u53d1\u51fa\u53bb\u7684\u5305\u90fd\u4e22\u6389\u4e86\uff0c\u90a3\u4e48\u5c31\u8ba4\u4e3a\u7f51\u7edc\u8fdb\u5165persistent congestion\u72b6\u6001\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"761_Duration\"><\/span>7.6.1 Duration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5224\u65ad\u8fdb\u5165persistent congestion\u7684Duration\u9608\u503c\uff1a<\/p>\n\n\n\n<p>(smoothed_rtt + max(4*rttvar, kGranularity) + max_ack_delay) *<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;kPersistentCongestionThreshold<\/p>\n\n\n\n<p>kPersistentCongestionThreshold\u7684\u5efa\u8bae\u53d6\u503c\u4e3a3\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"762_Establishing_Persistent_Congestion\"><\/span>7.6.2 Establishing Persistent Congestion<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u68c0\u6d4b\u51fapersistent congestion\u540e\uff0c\u53d1\u7aef\u7684cwnd\u9700\u8981\u8bbe\u7f6e\u4e3akMinimumWindow(2MSS)\uff0c\u5c31\u5982TCP \u89e6\u53d1RTO\u4e00\u6837\u3002<\/p>\n\n\n\n<p>\u68c0\u6d4b\u51fapersistent congestion\u7684\u6761\u4ef6(\u5168\u90fd\u8981\u6ee1\u8db3)\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>2\u4e2aack-eliciting\u5305\u90fd\u88ab\u68c0\u6d4b\u51fa\u4e22\u6389\u4e86\uff1b<\/li>\n\n\n\n<li>2\u4e2a\u5305\u4e4b\u95f4\u7684\u5305\u4e5f\u90fd\u4e22\u6389\u4e86\uff1b<\/li>\n\n\n\n<li>\u8fd9\u4e24\u4e2a\u5305\u7684\u53d1\u9001\u65f6\u95f4\u5dee\u8d85\u8fc7\u4e86persistent congestion duration\uff1b<\/li>\n\n\n\n<li>\u7b2c\u4e00\u4e2a\u5305\u53d1\u9001\u4e4b\u524d\u5fc5\u987b\u5df2\u7ecf\u6709RTT\u91c7\u6837\uff1b<\/li>\n<\/ul>\n\n\n\n<p>\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u5982\u679c\u4e00\u5927\u6bb5\u8fde\u7eed\u7684\u5305\u90fd\u4e22\u6389\u4e86\uff0c\u5e76\u4e14\u8fd9\u4e9b\u5305\u7684\u53d1\u9001\u65f6\u95f4\u8de8\u5ea6\u8fbe\u5230\u4e86persistent congestion duration\uff0c\u5c31\u4efb\u52a1\u662f\u8fdb\u5165\u4e86persistent congestion\u72b6\u6001\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"763_Example\"><\/span>7.6.3 Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"77_Pacing\"><\/span>7.7 Pacing<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>pacing\u7684\u901f\u7387\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n<p>rate = N * congestion_window \/ smoothed_rtt<\/p>\n\n\n\n<p>\u6216\u8005\u7528inter-packet interval\u6765\u8868\u8fbe\uff1a<\/p>\n\n\n\n<p>interval = ( smoothed_rtt * packet_size \/ congestion_window ) \/ N<\/p>\n\n\n\n<p>N\u81f3\u5c11\u53d61\uff0c\u53d6\u4e00\u4e2a\u5927\u4e8e1(\u59821.25)\u7684\u503c\u53ef\u4ee5\u907f\u514d\u62e5\u585e\u7a97\u53e3\u7684underutilization\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"78_Underutilizing_the_Congestion_Window\"><\/span>7.8 Underutilizing the Congestion Window<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4e0d\u662f\u5f88\u61c2\u3002\u3002\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8Security_Considerations\"><\/span>8.Security Considerations<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9C%AF%E8%AF%AD\"><\/span>\u672f\u8bed<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p><strong>Ack-eliciting packet:<\/strong><\/p>\n\n\n\n<p>A QUIC packet that contains frames other than ACK, PADDING, and CONNECTION_CLOSE. These cause a recipient to send an acknowledgment; see <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc9000#sending-acknowledgments\">Section 13.2.1<\/a>.<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u5982\u679c\u4e00\u4e2apacket\u5305\u542b\u4e86\u9664ACK\/PADDING\/CONNECTION_CLOSE\u4e4b\u5916\u7684\u5e27\uff0c\u63a5\u6536\u7aef\u9700\u8981 \u56deack\uff0c\u53d1\u9001\u7aef\u9700\u8981\u68c0\u6d4b\u8fd9\u4e2a\u5305\u662f\u5426\u4e22\u4e86\u5e76\u5728\u9002\u5f53\u7684\u65f6\u5019\u91cd\u4f20\u4e22\u6389\u7684\u5e27\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RFC 9002 &#8211; QUIC Loss Detection and Congestion Control 1.Introduction 3.Design of the QUIC Tran&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[45],"class_list":["post-1904","post","type-post","status-publish","format-standard","hentry","category-10","tag-quic"],"_links":{"self":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/1904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1904"}],"version-history":[{"count":4,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/1904\/revisions"}],"predecessor-version":[{"id":1908,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=\/wp\/v2\/posts\/1904\/revisions\/1908"}],"wp:attachment":[{"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cauchyschwarz.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}