nish/net/quic-recovery
QUIC loss detection and congestion control (RFC 9002): the packets each packet number space has in flight, the round-trip estimate, loss by packet and by time threshold, the probe timeout with its backoff, NewReno or CUBIC, and a pacer. Sans-IO: it never sees a byte of a packet, only packet numbers, sizes and the caller's clock.
import {
QUIC_RECOVERY_APPLICATION,
QUIC_RECOVERY_APPLICATION_CAPACITY,
QUIC_RECOVERY_CUBIC,
QUIC_RECOVERY_DATAGRAM_SIZE,
QUIC_RECOVERY_DEFAULT,
QUIC_RECOVERY_DEFAULT_MAX_ACK_DELAY,
QUIC_RECOVERY_ECN_CAPABLE,
QUIC_RECOVERY_ECN_FAILED,
QUIC_RECOVERY_ECN_TESTING,
QUIC_RECOVERY_ECN_TESTING_PACKETS,
QUIC_RECOVERY_ECN_UNKNOWN,
QUIC_RECOVERY_ECT0,
QUIC_RECOVERY_GRANULARITY,
QUIC_RECOVERY_HANDSHAKE,
QUIC_RECOVERY_HANDSHAKE_CAPACITY,
QUIC_RECOVERY_INITIAL,
QUIC_RECOVERY_INITIAL_RTT,
QUIC_RECOVERY_INITIAL_WINDOW,
QUIC_RECOVERY_MAX_BACKOFF,
QUIC_RECOVERY_MINIMUM_WINDOW,
QUIC_RECOVERY_NEWRENO,
QUIC_RECOVERY_PACKET_THRESHOLD,
QUIC_RECOVERY_PERSISTENT_THRESHOLD,
QUIC_RECOVERY_TIMEOUT_LOSS,
QUIC_RECOVERY_TIMEOUT_NONE,
QUIC_RECOVERY_TIMEOUT_PTO,
QuicRecovery,
QuicSentPackets,
quicRecoveryCbrt,
} from "nish/net/quic-recovery";
import { QuicRecovery, QUIC_RECOVERY_TIMEOUT_PTO } from "nish/net/quic-recovery";
const recovery = new QuicRecovery();
const slot: i32 = recovery.onPacketSent(space, pn, size, now); // every ack-eliciting packet
recovery.onAck(space, frame.ackRanges, frame.ackRangeCount, delay, now);
… recovery.spaces[space].acked / .lost name the slots it settled …
if (now >= recovery.deadline(blocked)) { recovery.onTimeout(now, blocked); }
quicRecoveryCbrt
The integer cube root of x, the largest r with r³ <= x, for 0 <= x <= QUIC_RECOVERY_CUBIC_SPAN³, found by bisection over 0 .. the span: 16 steps, the same answer on every machine, no floating point.
QuicRecovery
One connection's loss recovery and congestion control, across its three packet number spaces.
QuicSentPackets
The ack-eliciting packets one space sent, in a ring of capacity slots in the order they went out: slot slot(k) is the k-th from the oldest still kept, for k below count.
What it tracks
Each space keeps its ack-eliciting packets in a fixed
ring (QuicSentPackets), in the order they were sent, so the memory is fixed
when the connection is made and nothing is allocated per packet. A packet
that elicits no acknowledgement (one that carries only ACK, PADDING or
CONNECTION_CLOSE) is not recorded: it is never in flight, and neither an RTT
sample nor a loss is ever taken from it (RFC 9002 §2, §5.1).
The caller keeps what each packet carried in its own arrays, indexed by the
slot onPacketSent answers, and reads acked and lost after each onAck
and onTimeout to learn which slots were settled. A slot named there keeps
its packet number, time and size until the next call.
Time and units
Every time and every duration is the caller's
monotonic clock in milliseconds, which is also the timer granularity
(QUIC_RECOVERY_GRANULARITY, §6.1.2), and the arithmetic is Appendix A's
and Appendix B's in integers: smoothed_rtt = (7 × smoothed_rtt + adjusted_rtt) / 8, rttvar = (3 × rttvar + |smoothed_rtt − adjusted_rtt|) / 4, each division truncating. Sizes are bytes.
The pacer's clock
Pacing is not a timer, and on a path whose round
trip is under a millisecond a pacer that counts whole milliseconds earns
nothing until the next one starts, and then waits a whole one. So a
caller with a finer clock sets micros to the same instant in
microseconds before it calls in, and the pacer, its budget and its own
smoothed RTT (pacerRtt) count microseconds; loss detection and the
probe timeout still count milliseconds, at least
QUIC_RECOVERY_GRANULARITY. A micros outside the millisecond now
names, a stale one or none, is not read: the pacer counts now × 1000
then, and paces as a millisecond clock always did.
What the server leaves out
It is written for the server side of a connection: there is no client anti-deadlock probe (§6.2.2.1), since a server never has to send to unblock its peer. A congestion window that the sender does not use is not grown (§7.8): an acknowledgement grows it only if, when it arrived, the bytes in flight were at least half the window.
Congestion control
controller picks it, once, before the first
packet: QUIC_RECOVERY_NEWRENO (Appendix B, the default) or
QUIC_RECOVERY_CUBIC (RFC 9438). Both share slow start, recovery
periods, persistent congestion's collapse to the minimum window and the
rule above for a window not in use. CUBIC keeps 0.7 of the window at a
congestion event rather than half, then grows along W(t) = W_max + C ×
(t − K)³ with C 0.4, concave up to the window it lost at and convex past
it, never below what Reno would have reached (its Reno-friendly region),
and with fast convergence. Its arithmetic is integers in bytes and
milliseconds, and K's cube root is found by bisection, so two machines
given the same events reach the same window to the byte.
ECN
ECN (§7.1, B.7; RFC 9000 §13.4.2 and its Appendix A.4). A caller that
marks its packets ECT(0) asks ecnCodepoint() what to mark with, says so
with onEctSent for every packet it marked, and hands an ACK_ECN frame's
counts to onAckEcn.
The counts are validated against the packets marked before they are used: an
ACK that newly acknowledges a marked packet without counts, a count that
falls, counts past the packets marked, or an increase in ECT(0) and ECN-CE
short of the marked packets newly acknowledged fails validation, as does
every packet of the testing period being lost, and a failed path is marked no
more (QUIC_RECOVERY_ECN_FAILED). Only the first
QUIC_RECOVERY_ECN_TESTING_PACKETS are marked until one validates.
A rise in the ECN-CE count is a congestion event, from the largest packet newly acknowledged, so it halves the window once per recovery period as a loss does. Counts that arrive with an ACK that does not raise the largest acknowledged are neither validated nor used: they may be older than those already read.
What a peer cannot do
Every input is checked: the ranges of an
acknowledgement are read only up to the count given and the array's
length, a packet acknowledged twice counts once, and
the backoff stops doubling at QUIC_RECOVERY_MAX_BACKOFF, so no duration
overflows. A peer that never acknowledges anything costs a probe each
timeout, at a rate that halves each time, until the idle timeout ends the
connection.
Written from RFC 9002 §5 to §7 and its Appendices A and B, and RFC 9438, in this
module's own structure; nothing here is ported from another
implementation. Private names carry the quicRecovery prefix
(docs/wp26-stdlib.md §3e).
Functions
quicRecoveryCbrt
The integer cube root of x, the largest r with r³ <= x, for 0 <= x <=
QUIC_RECOVERY_CUBIC_SPAN³, found by bisection over 0 .. the span: 16
steps, the same answer on every machine, no floating point.
const quicRecoveryCbrt: (x: i64) => i64
xi64requiredThe cube, 0 to 40000³.
returnsi64Its root, 0 to 40000.
Classes
QuicRecovery
One connection's loss recovery and congestion control, across its three
packet number spaces. The fields are readable: the RTT estimate
(latestRtt, smoothedRtt, rttVar, minRtt), the window
(congestionWindow, ssthresh, recoveryStart), ptoCount, and the
counts a test or a log reads (congestionEvents, persistentCongestions).
class QuicRecovery
| Member | |
|---|---|
new QuicRecovery() |
Makes the state a new connection has, as reset leaves it: every space empty, the RTT estimate and the window at their initial values. |
congestionEvents: i32 |
How many congestion events reduced the window, and how many of them were persistent congestion. |
congestionWindow: i64 |
congestion_window (B.2), in bytes. |
controller: i32 |
The congestion controller, QUIC_RECOVERY_NEWRENO or QUIC_RECOVERY_CUBIC, which the caller sets once, before the first packet; reset keeps it. |
cubicCarry: i64 |
What the window's last step toward the curve truncated: the numerator of a fraction of the window then, so steps smaller than a byte add up instead of being lost (RFC 9438's cwnd_cnt). |
cubicEpoch: i64 |
When CUBIC's congestion avoidance stage began (t = 0 of its curve), in milliseconds, or -1 outside one. |
cubicEst: i64 |
CUBIC's W_est (§4.3) in bytes: the window Reno's AIMD with β 0.7 would have reached since cubicEpoch. |
cubicEstCarry: i64 |
What cubicEst's last step truncated: the numerator of a fraction of 17 × the window then. |
cubicIdle: i64 |
When the window last stopped being used (§5.8) during a congestion avoidance stage, or -1: the curve's epoch moves on by the time it was idle, so it resumes where it stood. |
cubicK: i64 |
CUBIC's K in milliseconds: how long after cubicEpoch the curve reaches cubicMax. |
cubicMax: i64 |
CUBIC's W_max (RFC 9438 §4.2) in bytes: the window its curve plateaus at, 0 before the first congestion event. |
cubicPrior: i64 |
CUBIC's cwnd_prior (§4.6): the window just before the last reduction, in bytes. |
datagramSize: i64 |
max_datagram_size (B.1): the largest datagram the connection sends on this path, 1200 until path MTU discovery validates more. The initial and minimum windows and congestion avoidance's step are counted in it. resetPath, which the constructor runs, sets it to QUIC_RECOVERY_DATAGRAM_SIZE; a field's initializer must be a literal. |
ecnCongestionEvents: i32 |
How many congestion events a rise in the ECN-CE count caused (§7.1). |
ecnState: i32 |
ECN's state, QUIC_RECOVERY_ECN_TESTING until a marked packet's counts validate or fail. |
ecnTestLost: i32 |
How many marked packets were lost before ECN validated: once it reaches ecnTestRecorded, ECN fails (RFC 9000 A.4). |
ecnTestRecorded: i32 |
How many of the packets marked while testing ECN are recorded in a space's ring, so their loss can be seen. |
ecnTestSent: i32 |
The packets marked while testing, and of those recorded, how many and how many of them were lost. |
firstSampleTime: i64 |
When the first RTT sample was taken, or -1 before it: persistent congestion counts only packets sent since (§7.6.2). |
handshakeConfirmed: boolean |
Whether the handshake is confirmed (RFC 9001 §4.1.2), which the caller sets: the peer's max_ack_delay then bounds its ACK delays, and the Application Data space has a probe timeout. |
latestRtt: i64 |
latest_rtt (§5.1): the last sample, in milliseconds. |
maxAckDelay: i64 |
The peer's max_ack_delay in milliseconds (RFC 9000 §18.2), which the caller sets once it has read it. |
micros: i64 |
The caller's clock in microseconds, which it sets before each call when it keeps one, or -1. |
minRtt: i64 |
min_rtt (§5.2): 0 until the first sample. |
pacerBudget: i64 |
The pacer's credit in bytes (§7.7), and the time it was last topped up in microseconds, or -1. |
pacerRtt: i64 |
The smoothed RTT the pacer's rate is taken from, in microseconds: smoothedRtt on the pacer's clock. |
pacerTime: i64 |
When the pacer's credit was last topped up, in microseconds on the pacer's clock, or -1 before the first time. |
persistentCongestions: i32 |
How many of congestionEvents were persistent congestion (§7.6), which collapses the window to its minimum. |
ptoCount: i32 |
pto_count (A.3): how many probe timeouts fired since the last acknowledgement. |
recoveryStart: i64 |
congestion_recovery_start_time (B.2), or -1 outside recovery. |
rttVar: i64 |
rttvar (§5.3): kInitialRtt / 2 until the first sample. |
smoothedRtt: i64 |
smoothed_rtt (§5.3): kInitialRtt until the first sample. |
spaces: QuicSentPackets[] |
The sent-packet ring of each packet number space, indexed by QUIC_RECOVERY_INITIAL and its siblings. |
ssthresh: i64 |
ssthresh (B.2): unbounded (2^62 − 1) until the first congestion event. |
timeoutSpace: i32 |
The space the last onTimeout acted on, or -1. |
bytesInFlight(): i64 |
bytes_in_flight (B.2): every space's packets in flight. |
canSend(): boolean |
Whether the window has room for another full-sized datagram (B.4). The caller sends nothing ack-eliciting while it has not, except a probe. |
deadline(amplificationBlocked: boolean): i64 |
SetLossDetectionTimer (A.8): when onTimeout is next due — the earliest time-threshold loss, else the probe timeout — or -1 for none. With amplificationBlocked, when the server may send nothing until the client does (RFC 9000 §8.1), there is no probe timeout (§6.2.2.1). |
discardSpace(space: i32): void |
OnPacketNumberSpaceDiscarded (A.11): the space's keys are gone, so its packets leave flight uncounted, its timers stop, and the backoff resets. |
ecnCodepoint(): i32 |
The ECN codepoint to mark the next packet with (RFC 9000 A.4): ECT(0) for the first QUIC_RECOVERY_ECN_TESTING_PACKETS and, once the path is capable, for every one; 0, Not-ECT, while the testing packets wait to be validated and once validation failed. |
evictOldest(space: i32): i32 |
Gives up the oldest packet still in flight in space space, taking it out of flight without a congestion event, so that a probe can be recorded when the ring is full. The caller has already queued what the space had in flight again, which is what a probe sends. Answers the slot, or -1 when nothing is in flight there. |
fineNow(now: i64): i64 |
now on the pacer's clock: micros when it falls inside the millisecond now names, and now × 1000 otherwise. |
initialWindow(): i64 |
kInitialWindow (§7.2) for the current datagram size: min(10 × size, max(14720, 2 × size)). |
lossDelay(): i64 |
The loss delay (§6.1.2): 9/8 of the larger of the latest and the smoothed RTT, at least the granularity. |
minimumWindow(): i64 |
kMinimumWindow (§7.2) for the current datagram size: two datagrams. |
onAck(space: i32, ranges: i64[], count: i32, ackDelay: i64, now: i64): i32 |
An ACK frame for space space (A.7): ranges holds count [smallest, largest] pairs, highest first, as QuicFrame.ackRanges does, and ackDelay is the peer's ACK Delay in milliseconds. The packets newly acknowledged are listed in the space's acked, those it shows lost in lost; an RTT sample is taken when the largest acknowledged is newly acknowledged (§5.1), the window grows or shrinks (B.5, B.8), and the probe backoff resets. Answers how many packets were newly acknowledged, or -1, changing nothing, when the space does not exist or there is no range. A packet number the space never sent is the caller's to refuse (RFC 9000 §13.1): only it knows the packets that elicit no acknowledgement, which are not recorded here. |
onAckEcn(space: i32, ranges: i64[], count: i32, ackDelay: i64, now: i64, ect0: i64, ect1: i64, ce: i64): i32 |
onAck for an ACK frame that carries ECN counts, ect0, ect1 and ce as ACK_ECN gives them (RFC 9000 §19.3.2), or -1 each for one that carries none. The counts are validated (RFC 9000 §13.4.2.1) and a rise in ECN-CE is a congestion event (§7.1, B.7) before loss is detected, as A.7 orders it. |
onEctSent(space: i32, slot: i32): void |
A packet of space space went out marked ECT(0): slot is the one onPacketSent answered for it, or -1 for a packet that elicits no acknowledgement and so was not recorded. Every packet of a datagram marked counts, whatever ecnCodepoint() answers by the last of them. |
onPaced(now: i64, size: i32): void |
Charges the pacer for a datagram of size bytes sent at now. |
onPacketSent(space: i32, pn: i64, size: i32, now: i64): i32 |
Records an ack-eliciting packet (A.5): number pn of space space, size bytes on the wire, sent at now. Answers its slot, under which the caller keeps what it carried, or -1, recording nothing, for a space that does not exist, a size that is not positive, a packet number that is not above the last one recorded, or a ring that is full. |
onProbeSent(space: i32, slot: i32): void |
Marks the packet in space's slot slot, just recorded by onPacketSent, as a path MTU probe (RFC 8899): it counts in flight and its acknowledgement grows the window, but its loss is no congestion event and no part of persistent congestion (RFC 9000 §14.4). |
onTimeout(now: i64, amplificationBlocked: boolean): i32 |
OnLossDetectionTimeout (A.9), at now. When a time-threshold loss is due, the space's packets are checked again and the lost ones listed in its lost: QUIC_RECOVERY_TIMEOUT_LOSS. Otherwise, when the probe timeout is due, the backoff doubles and the caller is to send a probe in timeoutSpace: QUIC_RECOVERY_TIMEOUT_PTO. Before either is due, or when nothing is timed, QUIC_RECOVERY_TIMEOUT_NONE. |
pacerDelay(now: i64, size: i32): i64 |
How many milliseconds after now the pacer lets a datagram of size bytes go: 0 when it may go now, else its wait in microseconds rounded up to whole milliseconds, so at least 1. The rate is 5/4 of the window per pacerRtt (§7.7's N of 1.25). |
pacerQuantum(least: i32, most: i32): i32 |
The credit a paced flight waits for before it starts, in bytes: what the pacer earns in a millisecond, at least least and at most most. A pacer that earns by the microsecond would otherwise let a fast connection out a datagram at a time, one send each; one that earns slowly still lets a datagram go as soon as it has the credit for it. |
probeTimeout(): i64 |
The probe timeout's period without backoff (§6.2.1): smoothed_rtt + max(4 × rttvar, kGranularity), plus the peer's max_ack_delay once the handshake is confirmed. It is also what a key update's old keys are kept for and what the idle timeout is at least three of. |
ptoTime(): i64 |
GetPtoTimeAndSpace (A.8): when the probe timeout fires, the earliest over the spaces with an ack-eliciting packet in flight, with the backoff applied; the Application Data space counts only once the handshake is confirmed. Answers -1 with nothing in flight. |
reset(): void |
Puts everything back as a new connection has it: every space empty, the RTT estimate and the window at their initial values. A connection slot reused for another peer calls it; the rings are kept. |
setDatagramSize(size: i64): void |
Sets max_datagram_size to size bytes, as path MTU discovery validates a larger path or falls back from one (RFC 9002 §7.2). A window still at the old initial window becomes the new one, so a connection that has learnt nothing of the path yet starts from what the new size allows; a window below the new minimum is raised to it. A smaller size keeps the window as it is, and the pacer's held credit is cut to the new burst. |
space(space: i32): QuicSentPackets | null |
Space space's packets, or null for an index that names no space. |
QuicSentPackets
The ack-eliciting packets one space sent, in a ring of capacity slots
in the order they went out: slot slot(k) is the k-th from the oldest
still kept, for k below count. A packet stays in its slot after it is
acknowledged or lost until every older one is settled too, which is what
lets persistent congestion see that nothing between two lost packets was
acknowledged (§7.6.2).
class QuicSentPackets
| Member | |
|---|---|
new QuicSentPackets(capacity: i32) |
An empty ring; QuicRecovery makes one for each space. |
acked: i32[] |
The slots the last onAck acknowledged, ackedCount of them, oldest first. |
bytesInFlight: i64 |
The bytes of this space's packets in flight. |
ce: i64 |
The ECN-CE count of the last ACK_ECN frame validated in this space; a rise is a congestion event. |
count: i32 |
How many packets the ring keeps, in flight and settled; a test reads it to see what a flight recorded. |
ect0: i64 |
The ECN counts of the last ACK_ECN frame validated in this space (RFC 9000 §19.3.2). |
ect1: i64 |
The ECT(1) count of the last ACK_ECN frame validated in this space. |
ectSent: i64 |
How many of this space's packets, recorded or not, were sent marked ECT(0). |
fineSent: i64[] |
When each packet was sent on the pacer's clock, in microseconds. |
inFlight: i32 |
How many recorded packets are still in flight: neither acknowledged nor lost. |
largestAcked: i64 |
The largest packet number the peer acknowledged in this space, or -1. |
lastAckEliciting: i64 |
time_of_last_ack_eliciting_packet (A.3), or -1 before the first. |
lastPn: i64 |
The packet number of the last packet recorded, or -1: each must be larger (RFC 9000 §12.3). |
lossTime: i64 |
loss_time (A.3): when the oldest packet not yet lost by the packet threshold becomes lost by time, or -1. |
lost: i32[] |
The slots the last onAck or onTimeout declared lost, lostCount of them, oldest first. |
lostCount: i32 |
How many slots of lost the last onAck or onTimeout filled. |
state: u8[] |
Each slot's state, with QUIC_RECOVERY_MARKED set if its packet was sent marked ECT(0). |
timeSent: i64[] |
When each slot's packet was sent, the now onPacketSent was given, in milliseconds; loss detection and RTT samples read it. |
ackedSlot(k: i32): i32 |
The k-th slot the last call acknowledged, or -1. |
fineAt(s: i32): i64 |
When the packet in slot s was sent on the pacer's clock, in microseconds, or -1. |
full(): boolean |
Whether every slot is taken, so nothing more can be recorded until a packet is settled. |
inFlightAt(s: i32): boolean |
Whether slot s holds a packet still in flight. |
lostSlot(k: i32): i32 |
The k-th slot the last call declared lost, or -1. |
markedAt(s: i32): boolean |
Whether the packet in slot s was sent marked ECT(0). |
pnAt(s: i32): i64 |
The packet number in slot s, or -1. |
probeAt(s: i32): boolean |
Whether the packet in slot s was a path MTU probe (RFC 8899), whose loss says nothing of congestion. |
sizeAt(s: i32): i32 |
The size of the packet in slot s, or 0. |
stateAt(s: i32): i32 |
The state of slot s, or free for a slot outside the ring. |
timeAt(s: i32): i64 |
When the packet in slot s was sent, or -1. |
Limits
128
QUIC_RECOVERY_APPLICATION_CAPACITY: i32
How many packets the Application Data space keeps in flight: 128 full-sized datagrams is 150 KiB in flight, a 12 Mbit/s path at a 100 ms round trip, against what the record costs every connection from the start. When the ring is full the space sends nothing that would elicit an acknowledgement until one arrives, as if the congestion window were full.
16
QUIC_RECOVERY_HANDSHAKE_CAPACITY: i32
How many packets the Initial and the Handshake space each keep in flight. A server's handshake flight is a few datagrams, and the anti-amplification limit holds it to three times what the client sent until its address is validated, so 16 leaves room for several probes on top.
16
QUIC_RECOVERY_MAX_BACKOFF: i32
The most times the probe timeout doubles (§6.2.1). Sixteen doublings of
the longest probe timeout a peer can cause still fit an i64, and by then
the idle timeout has ended the connection.
Constants
2
QUIC_RECOVERY_APPLICATION: i32
The Application Data space's index.
1
QUIC_RECOVERY_CUBIC: i32
The congestion controller of RFC 9438: CUBIC, with its Reno-friendly region and fast convergence.
1,200
QUIC_RECOVERY_DATAGRAM_SIZE: i64
max_datagram_size (B.1) on a path nothing has been learnt of: the 1200
bytes every datagram is at most until path MTU discovery validates more
(QuicRecovery.datagramSize).
1
QUIC_RECOVERY_DEFAULT: i32
The controller a server runs unless it has a reason to pick: CUBIC. It
beat NewReno outside the spread across loss draws on transfers of 32 and
128 bandwidth-delay products and finished level on one
(bench/quic-goodput.ts; the figures are in docs/security/quic.md).
It holds the same value as QUIC_RECOVERY_CUBIC, written out rather than
aliased so the default reads as a choice of its own.
25
QUIC_RECOVERY_DEFAULT_MAX_ACK_DELAY: i64
The default max_ack_delay (RFC 9000 §18.2), in milliseconds, until the peer's transport parameters say otherwise.
2
QUIC_RECOVERY_ECN_CAPABLE: i32
The path is ECN-capable: a marked packet's counts validated, and every packet is marked from here on.
3
QUIC_RECOVERY_ECN_FAILED: i32
Validation failed: nothing is marked again for the connection's life, unless restartEcn tests a new path.
0
QUIC_RECOVERY_ECN_TESTING: i32
ECN's states (RFC 9000 A.4): testing, marking the first packets; unknown, those sent and none validated yet; capable; and failed, for the connection's life.
10
QUIC_RECOVERY_ECN_TESTING_PACKETS: i32
How many packets are marked while ECN is tested, before a marked one is acknowledged (RFC 9000 A.4).
1
QUIC_RECOVERY_ECN_UNKNOWN: i32
ECN is unknown: the testing packets are sent, none is validated yet, and nothing more is marked until one is.
2
QUIC_RECOVERY_ECT0: i32
The ECT(0) codepoint (RFC 3168), the only one this module asks a caller to mark with.
1
QUIC_RECOVERY_GRANULARITY: i64
kGranularity (§6.1.2), in milliseconds: the timer resolution, and the least any loss delay or variance term is.
1
QUIC_RECOVERY_HANDSHAKE: i32
The Handshake space's index.
0
QUIC_RECOVERY_INITIAL: i32
The Initial space's index, which is TLS_LEVEL_INITIAL.
333
QUIC_RECOVERY_INITIAL_RTT: i64
kInitialRtt (§6.2.2), in milliseconds: the round trip assumed before the first sample.
12,000
QUIC_RECOVERY_INITIAL_WINDOW: i64
kInitialWindow (§7.2) at 1200 bytes: min(10 × 1200, max(14720, 2 × 1200)), so 12000 bytes.
2,400
QUIC_RECOVERY_MINIMUM_WINDOW: i64
kMinimumWindow (§7.2) at 1200 bytes: two datagrams, 2400 bytes.
0
QUIC_RECOVERY_NEWRENO: i32
The congestion controller of RFC 9002 §7 and Appendix B: NewReno.
3
QUIC_RECOVERY_PACKET_THRESHOLD: i64
kPacketThreshold (§6.1.1): a packet three numbers below one acknowledged is lost.
3
QUIC_RECOVERY_PERSISTENT_THRESHOLD: i64
kPersistentCongestionThreshold (§7.6.1): lost packets spanning three probe timeouts collapse the window.
1
QUIC_RECOVERY_TIMEOUT_LOSS: i32
onTimeout declared packets lost by the time threshold; lost in timeoutSpace names them.
0
QUIC_RECOVERY_TIMEOUT_NONE: i32
onTimeout ran nothing: no timer was due.
2
QUIC_RECOVERY_TIMEOUT_PTO: i32
onTimeout was a probe timeout: the caller sends a probe in timeoutSpace (§6.2.4).

