comparison src/event/quic/ngx_event_quic_migration.c @ 9196:6c8595b77e66

QUIC: path aware in-flight bytes accounting. On-packet acknowledgement is made path aware, as per RFC 9000, Section 9.4: Packets sent on the old path MUST NOT contribute to congestion control or RTT estimation for the new path. To make this possible in a single congestion control context, the first packet to be sent after the new path has been validated, which includes resetting the congestion controller and RTT estimator, is now remembered in the connection. Packets sent previously, such as on the old path, are not taken into account. Note that although the packet number is saved per-connection, the added checks affect application level packets only. For non-application level packets, which are only processed prior to the handshake is complete, the remembered packet number remains set to zero.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 12 Dec 2023 20:21:12 +0400
parents ff452f283aa9
children 2ed3f57dca0a
comparison
equal deleted inserted replaced
9195:ff452f283aa9 9196:6c8595b77e66
108 ngx_quic_path_challenge_frame_t *f) 108 ngx_quic_path_challenge_frame_t *f)
109 { 109 {
110 ngx_uint_t rst; 110 ngx_uint_t rst;
111 ngx_queue_t *q; 111 ngx_queue_t *q;
112 ngx_quic_path_t *path, *prev; 112 ngx_quic_path_t *path, *prev;
113 ngx_quic_send_ctx_t *ctx;
113 ngx_quic_connection_t *qc; 114 ngx_quic_connection_t *qc;
114 115
115 qc = ngx_quic_get_connection(c); 116 qc = ngx_quic_get_connection(c);
116 117
117 /* 118 /*
172 path->mtu_unvalidated = 0; 173 path->mtu_unvalidated = 0;
173 } 174 }
174 } 175 }
175 176
176 if (rst) { 177 if (rst) {
178 /* prevent old path packets contribution to congestion control */
179
180 ctx = ngx_quic_get_send_ctx(qc, ssl_encryption_application);
181 qc->rst_pnum = ctx->pnum;
182
177 ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t)); 183 ngx_memzero(&qc->congestion, sizeof(ngx_quic_congestion_t));
178 184
179 qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size, 185 qc->congestion.window = ngx_min(10 * qc->tp.max_udp_payload_size,
180 ngx_max(2 * qc->tp.max_udp_payload_size, 186 ngx_max(2 * qc->tp.max_udp_payload_size,
181 14720)); 187 14720));