xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/common/quiche_protocol_flags_list.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2022 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // NOLINT(build/header_guard)
6 // This file intentionally does not have header guards, it's intended to be
7 // included multiple times, each time with a different definition of
8 // QUICHE_PROTOCOL_FLAG.
9 
10 #if defined(QUICHE_PROTOCOL_FLAG)
11 
12 QUICHE_PROTOCOL_FLAG(
13     bool, quic_allow_chlo_buffering, true,
14     "If true, allows packets to be buffered in anticipation of a "
15     "future CHLO, and allow CHLO packets to be buffered until next "
16     "iteration of the event loop.")
17 
18 QUICHE_PROTOCOL_FLAG(bool, quic_disable_pacing_for_perf_tests, false,
19                      "If true, disable pacing in QUIC")
20 
21 // Note that single-packet CHLOs are only enforced for Google QUIC versions that
22 // do not use CRYPTO frames. This currently means only Q043 and Q046. All other
23 // versions of QUIC (both Google QUIC and IETF) allow multi-packet CHLOs
24 // regardless of the value of this flag.
25 QUICHE_PROTOCOL_FLAG(bool, quic_enforce_single_packet_chlo, true,
26                      "If true, enforce that sent QUIC CHLOs fit in one packet. "
27                      "Only applies to Q043 and Q046.")
28 
29 // Currently, this number is quite conservative.  At a hypothetical 1000 qps,
30 // this means that the longest time-wait list we should see is:
31 //   200 seconds * 1000 qps = 200000.
32 // Of course, there are usually many queries per QUIC connection, so we allow a
33 // factor of 3 leeway.
34 QUICHE_PROTOCOL_FLAG(int64_t, quic_time_wait_list_max_connections, 600000,
35                      "Maximum number of connections on the time-wait list.  "
36                      "A negative value implies no configured limit.")
37 
38 QUICHE_PROTOCOL_FLAG(
39     int64_t, quic_time_wait_list_seconds, 200,
40     "Time period for which a given connection_id should live in "
41     "the time-wait state.")
42 
43 // This number is relatively conservative. For example, there are at most 1K
44 // queued stateless resets, which consume 1K * 21B = 21KB.
45 QUICHE_PROTOCOL_FLAG(
46     uint64_t, quic_time_wait_list_max_pending_packets, 1024,
47     "Upper limit of pending packets in time wait list when writer is blocked.")
48 
49 // Stop sending a reset if the recorded number of addresses that server has
50 // recently sent stateless reset to exceeds this limit.
51 QUICHE_PROTOCOL_FLAG(uint64_t, quic_max_recent_stateless_reset_addresses, 1024,
52                      "Max number of recorded recent reset addresses.")
53 
54 // After this timeout, recent reset addresses will be cleared.
55 // FLAGS_quic_max_recent_stateless_reset_addresses * (1000ms /
56 // FLAGS_quic_recent_stateless_reset_addresses_lifetime_ms) is roughly the max
57 // reset per second. For example, 1024 * (1000ms / 1000ms) = 1K reset per
58 // second.
59 QUICHE_PROTOCOL_FLAG(
60     uint64_t, quic_recent_stateless_reset_addresses_lifetime_ms, 1000,
61     "Max time that a client address lives in recent reset addresses set.")
62 
63 QUICHE_PROTOCOL_FLAG(
64     double, quic_bbr_cwnd_gain, 2.0f,
65     "Congestion window gain for QUIC BBR during PROBE_BW phase.")
66 
67 QUICHE_PROTOCOL_FLAG(
68     int32_t, quic_buffered_data_threshold, 8 * 1024,
69     "If buffered data in QUIC stream is less than this "
70     "threshold, buffers all provided data or asks upper layer for more data")
71 
72 QUICHE_PROTOCOL_FLAG(
73     uint64_t, quic_send_buffer_max_data_slice_size, 4 * 1024,
74     "Max size of data slice in bytes for QUIC stream send buffer.")
75 
76 QUICHE_PROTOCOL_FLAG(
77     int32_t, quic_lumpy_pacing_size, 2,
78     "Number of packets that the pacing sender allows in bursts during "
79     "pacing. This flag is ignored if a flow's estimated bandwidth is "
80     "lower than 1200 kbps.")
81 
82 QUICHE_PROTOCOL_FLAG(
83     double, quic_lumpy_pacing_cwnd_fraction, 0.25f,
84     "Congestion window fraction that the pacing sender allows in bursts "
85     "during pacing.")
86 
87 QUICHE_PROTOCOL_FLAG(
88     int32_t, quic_lumpy_pacing_min_bandwidth_kbps, 1200,
89     "The minimum estimated client bandwidth below which the pacing sender will "
90     "not allow bursts.")
91 
92 QUICHE_PROTOCOL_FLAG(
93     int32_t, quic_max_pace_time_into_future_ms, 10,
94     "Max time that QUIC can pace packets into the future in ms.")
95 
96 QUICHE_PROTOCOL_FLAG(
97     double, quic_pace_time_into_future_srtt_fraction,
98     0.125f,  // One-eighth smoothed RTT
99     "Smoothed RTT fraction that a connection can pace packets into the future.")
100 
101 QUICHE_PROTOCOL_FLAG(
102     bool, quic_export_write_path_stats_at_server, false,
103     "If true, export detailed write path statistics at server.")
104 
105 QUICHE_PROTOCOL_FLAG(bool, quic_disable_version_negotiation_grease_randomness,
106                      false,
107                      "If true, use predictable version negotiation versions.")
108 
109 QUICHE_PROTOCOL_FLAG(bool, quic_enable_http3_grease_randomness, true,
110                      "If true, use random greased settings and frames.")
111 
112 QUICHE_PROTOCOL_FLAG(int64_t, quic_max_tracked_packet_count, 10000,
113                      "Maximum number of tracked packets.")
114 
115 QUICHE_PROTOCOL_FLAG(
116     bool, quic_client_convert_http_header_name_to_lowercase, true,
117     "If true, HTTP request header names sent from QuicSpdyClientBase(and "
118     "descendants) will be automatically converted to lower case.")
119 
120 QUICHE_PROTOCOL_FLAG(
121     int32_t, quic_bbr2_default_probe_bw_base_duration_ms, 2000,
122     "The default minimum duration for BBRv2-native probes, in milliseconds.")
123 
124 QUICHE_PROTOCOL_FLAG(
125     int32_t, quic_bbr2_default_probe_bw_max_rand_duration_ms, 1000,
126     "The default upper bound of the random amount of BBRv2-native "
127     "probes, in milliseconds.")
128 
129 QUICHE_PROTOCOL_FLAG(
130     double, quic_bbr2_default_probe_rtt_inflight_target_bdp_fraction, 0.5,
131     "The default fraction to adjust the target in flight BDP during "
132     "PROBE_RTT phase.")
133 
134 QUICHE_PROTOCOL_FLAG(
135     int32_t, quic_bbr2_default_probe_rtt_period_ms, 10000,
136     "The default period for entering PROBE_RTT, in milliseconds.")
137 
138 QUICHE_PROTOCOL_FLAG(
139     int32_t, quic_bbr2_default_probe_rtt_duration_ms, 200,
140     "The default time to spend in PROBE_RTT mode, in milliseconds.")
141 
142 QUICHE_PROTOCOL_FLAG(
143     double, quic_bbr2_default_loss_threshold, 0.02,
144     "The default loss threshold for QUIC BBRv2, should be a value "
145     "between 0 and 1.")
146 
147 QUICHE_PROTOCOL_FLAG(
148     int32_t, quic_bbr2_default_startup_full_loss_count, 8,
149     "The default minimum number of loss marking events to exit STARTUP.")
150 
151 QUICHE_PROTOCOL_FLAG(
152     int32_t, quic_bbr2_default_probe_bw_full_loss_count, 2,
153     "The default minimum number of loss marking events to exit PROBE_UP phase.")
154 
155 QUICHE_PROTOCOL_FLAG(
156     double, quic_bbr2_default_inflight_hi_headroom, 0.15,
157     "The default fraction of unutilized headroom to try to leave in path "
158     "upon high loss.")
159 
160 QUICHE_PROTOCOL_FLAG(
161     int32_t, quic_bbr2_default_initial_ack_height_filter_window, 10,
162     "The default initial value of the max ack height filter's window length.")
163 
164 QUICHE_PROTOCOL_FLAG(
165     double, quic_ack_aggregation_bandwidth_threshold, 1.0,
166     "If the bandwidth during ack aggregation is smaller than (estimated "
167     "bandwidth * this flag), consider the current aggregation completed "
168     "and starts a new one.")
169 
170 QUICHE_PROTOCOL_FLAG(
171     int32_t, quic_anti_amplification_factor, 3,
172     "Anti-amplification factor. Before address validation, server will "
173     "send no more than factor times bytes received.")
174 
175 QUICHE_PROTOCOL_FLAG(
176     int32_t, quic_max_buffered_crypto_bytes,
177     16 * 1024,  // 16 KB
178     "The maximum amount of CRYPTO frame data that can be buffered.")
179 
180 QUICHE_PROTOCOL_FLAG(
181     int32_t, quic_max_aggressive_retransmittable_on_wire_ping_count, 5,
182     "Maximum number of consecutive pings that can be sent with the "
183     "aggressive initial retransmittable on the wire timeout if there is "
184     "no new stream data received. After this limit, the timeout will be "
185     "doubled each ping until it exceeds the default ping timeout.")
186 
187 QUICHE_PROTOCOL_FLAG(
188     int32_t, quic_max_retransmittable_on_wire_ping_count, 1000,
189     "Maximum number of pings that can be sent with the retransmittable "
190     "on the wire timeout, over the lifetime of a connection. After this "
191     "limit, the timeout will be the default ping timeout.")
192 
193 QUICHE_PROTOCOL_FLAG(int32_t, quic_max_congestion_window, 2000,
194                      "The maximum congestion window in packets.")
195 
196 QUICHE_PROTOCOL_FLAG(
197     int32_t, quic_max_streams_window_divisor, 2,
198     "The divisor that controls how often MAX_STREAMS frame is sent.")
199 
200 QUICHE_PROTOCOL_FLAG(
201     uint64_t, quic_key_update_confidentiality_limit, 0,
202     "If non-zero and key update is allowed, the maximum number of "
203     "packets sent for each key phase before initiating a key update.")
204 
205 QUICHE_PROTOCOL_FLAG(bool, quic_disable_client_tls_zero_rtt, false,
206                      "If true, QUIC client with TLS will not try 0-RTT.")
207 
208 QUICHE_PROTOCOL_FLAG(bool, quic_disable_server_tls_resumption, false,
209                      "If true, QUIC server will disable TLS resumption by not "
210                      "issuing or processing session tickets.")
211 
212 QUICHE_PROTOCOL_FLAG(bool, quic_defer_send_in_response, true,
213                      "If true, QUIC servers will defer sending in response to "
214                      "incoming packets by default.")
215 
216 QUICHE_PROTOCOL_FLAG(
217     bool, quic_header_size_limit_includes_overhead, true,
218     "If true, QUIC QPACK decoder includes 32-bytes overheader per entry while "
219     "comparing request/response header size against its upper limit.")
220 
221 QUICHE_PROTOCOL_FLAG(
222     bool, quic_reject_retry_token_in_initial_packet, false,
223     "If true, always reject retry_token received in INITIAL packets")
224 
225 QUICHE_PROTOCOL_FLAG(bool, quic_use_lower_server_response_mtu_for_test, false,
226                      "If true, cap server response packet size at 1250.")
227 
228 QUICHE_PROTOCOL_FLAG(bool, quic_enforce_strict_amplification_factor, false,
229                      "If true, enforce strict amplification factor")
230 
231 QUICHE_PROTOCOL_FLAG(bool, quic_bounded_crypto_send_buffer, false,
232                      "If true, close the connection if a crypto send buffer "
233                      "exceeds its size limit.")
234 
235 QUICHE_PROTOCOL_FLAG(bool, quic_interval_set_enable_add_optimization, true,
236                      "If true, enable an optimization in QuicIntervalSet")
237 
238 QUICHE_PROTOCOL_FLAG(bool, quic_server_disable_qpack_dynamic_table, false,
239                      "If true, disables use of the QPACK dynamic table in "
240                      "servers, both for decoding context (requests) and for "
241                      "encoding context (responses).")
242 
243 QUICHE_PROTOCOL_FLAG(
244     bool, quic_enable_chaos_protection, true,
245     "If true, use chaos protection to randomize client initials.")
246 
247 QUICHE_PROTOCOL_FLAG(bool, quic_always_support_server_preferred_address, false,
248                      "If false, the kSPAD connection option is required to use "
249                      "QUIC server preferred address support.")
250 
251 QUICHE_PROTOCOL_FLAG(bool, quiche_oghttp2_debug_trace, false,
252                      "If true, emits trace logs for HTTP/2 events.")
253 
254 #endif
255