]> git.kaiwu.me - nginx.git/commitdiff
QUIC: do not shrink congestion window after losing an MTU probe.
authorRoman Arutyunyan <arut@nginx.com>
Mon, 6 Jan 2025 12:27:03 +0000 (16:27 +0400)
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>
Tue, 15 Apr 2025 15:01:36 +0000 (19:01 +0400)
As per RFC 9000, Section 14.4:

    Loss of a QUIC packet that is carried in a PMTU probe is therefore
    not a reliable indication of congestion and SHOULD NOT trigger a
    congestion control reaction.

src/event/quic/ngx_event_quic_ack.c
src/event/quic/ngx_event_quic_migration.c
src/event/quic/ngx_event_quic_transport.h

index bc99947bd44ca7bb0190c4a73781a365598c8fa2..d16545a1d36cf637ac5a392535860d675d527a1f 100644 (file)
@@ -755,6 +755,14 @@ ngx_quic_congestion_lost(ngx_connection_t *c, ngx_quic_frame_t *f)
         goto done;
     }
 
+    if (f->ignore_loss) {
+        ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
+                       "quic congestion lost ignore t:%M win:%uz if:%uz",
+                       now, cg->window, cg->in_flight);
+
+        goto done;
+    }
+
     cg->recovery_start = now;
     cg->window /= 2;
 
index 3caae88e5219abfc9f1332923eb1dc007e9cb7ab..463eeb50335d18be18b18e563e94550177b7037e 100644 (file)
@@ -923,6 +923,7 @@ ngx_quic_send_path_mtu_probe(ngx_connection_t *c, ngx_quic_path_t *path)
 
     frame->level = ssl_encryption_application;
     frame->type = NGX_QUIC_FT_PING;
+    frame->ignore_loss = 1;
 
     qc = ngx_quic_get_connection(c);
     ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application);
index 3e320391afcee699fa012a5b7f98dabbd9b1a03c..dcd763df1ff94494a8562cfe4196e4598611f791 100644 (file)
@@ -271,6 +271,7 @@ struct ngx_quic_frame_s {
     unsigned                                    need_ack:1;
     unsigned                                    pkt_need_ack:1;
     unsigned                                    ignore_congestion:1;
+    unsigned                                    ignore_loss:1;
 
     ngx_chain_t                                *data;
     union {