rwebtransport 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +666 -666
- package/Cargo.toml +31 -31
- package/LICENSE +202 -202
- package/NOTICE +41 -41
- package/README.md +550 -550
- package/crates/echo-server/Cargo.toml +20 -20
- package/crates/echo-server/src/main.rs +666 -666
- package/crates/native/Cargo.toml +23 -23
- package/crates/native/src/config.rs +129 -129
- package/crates/native/src/driver.rs +463 -463
- package/crates/native/src/lib.rs +821 -821
- package/crates/native/src/server.rs +718 -718
- package/crates/native/src/session.rs +1191 -1191
- package/crates/native/src/tls.rs +96 -96
- package/crates/wtcore/Cargo.toml +15 -15
- package/crates/wtcore/src/h3.rs +226 -226
- package/crates/wtcore/src/lib.rs +9 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +80 -79
- package/prebuilds/darwin-arm64/rwebtransport.node +0 -0
- package/prebuilds/linux-arm64/rwebtransport.node +0 -0
- package/prebuilds/linux-x64/rwebtransport.node +0 -0
- package/prebuilds/win32-x64/rwebtransport.node +0 -0
- package/scripts/bench.mjs +180 -180
- package/scripts/build.js +67 -67
- package/scripts/postinstall.js +67 -67
- package/scripts/setup-unix.sh +129 -129
- package/scripts/setup-windows.ps1 +229 -229
- package/vendor/quiche/AGENTS.md +75 -75
- package/vendor/quiche/COPYING +23 -23
- package/vendor/quiche/Cargo.lock +1212 -1212
- package/vendor/quiche/Cargo.toml +215 -215
- package/vendor/quiche/README.md +466 -466
- package/vendor/quiche/examples/Makefile +46 -46
- package/vendor/quiche/examples/README.md +20 -20
- package/vendor/quiche/examples/cert-big.crt +90 -90
- package/vendor/quiche/examples/cert.crt +18 -18
- package/vendor/quiche/examples/cert.key +28 -28
- package/vendor/quiche/examples/client.c +343 -343
- package/vendor/quiche/examples/client.rs +281 -281
- package/vendor/quiche/examples/gen-certs.sh +15 -15
- package/vendor/quiche/examples/http3-client.c +473 -473
- package/vendor/quiche/examples/http3-client.rs +349 -349
- package/vendor/quiche/examples/http3-server.c +614 -614
- package/vendor/quiche/examples/http3-server.rs +680 -680
- package/vendor/quiche/examples/qpack-decode.rs +87 -87
- package/vendor/quiche/examples/qpack-encode.rs +88 -88
- package/vendor/quiche/examples/rootca.crt +21 -21
- package/vendor/quiche/examples/server.c +529 -529
- package/vendor/quiche/examples/server.rs +529 -529
- package/vendor/quiche/include/quiche.h +1282 -1282
- package/vendor/quiche/src/buffers.rs +105 -105
- package/vendor/quiche/src/build.rs +66 -66
- package/vendor/quiche/src/cid.rs +1079 -1079
- package/vendor/quiche/src/crypto/boringssl.rs +373 -373
- package/vendor/quiche/src/crypto/mod.rs +671 -671
- package/vendor/quiche/src/dgram.rs +118 -118
- package/vendor/quiche/src/error.rs +263 -263
- package/vendor/quiche/src/ffi.rs +2290 -2290
- package/vendor/quiche/src/flowcontrol.rs +246 -246
- package/vendor/quiche/src/frame.rs +2172 -2172
- package/vendor/quiche/src/h3/AGENTS.md +54 -54
- package/vendor/quiche/src/h3/ffi.rs +442 -442
- package/vendor/quiche/src/h3/frame.rs +1404 -1404
- package/vendor/quiche/src/h3/mod.rs +8223 -8223
- package/vendor/quiche/src/h3/qpack/decoder.rs +288 -288
- package/vendor/quiche/src/h3/qpack/encoder.rs +235 -235
- package/vendor/quiche/src/h3/qpack/mod.rs +202 -202
- package/vendor/quiche/src/h3/qpack/static_table.rs +323 -323
- package/vendor/quiche/src/h3/stream.rs +1595 -1595
- package/vendor/quiche/src/lib.rs +9556 -9556
- package/vendor/quiche/src/minmax.rs +446 -446
- package/vendor/quiche/src/packet.rs +2334 -2334
- package/vendor/quiche/src/path.rs +1374 -1374
- package/vendor/quiche/src/pmtud.rs +652 -652
- package/vendor/quiche/src/rand.rs +64 -64
- package/vendor/quiche/src/range_buf.rs +186 -186
- package/vendor/quiche/src/ranges.rs +755 -755
- package/vendor/quiche/src/recovery/AGENTS.md +80 -80
- package/vendor/quiche/src/recovery/bandwidth.rs +565 -565
- package/vendor/quiche/src/recovery/bytes_in_flight.rs +179 -179
- package/vendor/quiche/src/recovery/congestion/cubic.rs +1038 -1038
- package/vendor/quiche/src/recovery/congestion/delivery_rate.rs +514 -514
- package/vendor/quiche/src/recovery/congestion/hystart.rs +241 -241
- package/vendor/quiche/src/recovery/congestion/mod.rs +361 -361
- package/vendor/quiche/src/recovery/congestion/prr.rs +238 -238
- package/vendor/quiche/src/recovery/congestion/recovery.rs +1170 -1170
- package/vendor/quiche/src/recovery/congestion/reno.rs +291 -291
- package/vendor/quiche/src/recovery/congestion/test_sender.rs +201 -201
- package/vendor/quiche/src/recovery/gcongestion/bbr/bandwidth_sampler.rs +1947 -1947
- package/vendor/quiche/src/recovery/gcongestion/bbr/windowed_filter.rs +158 -158
- package/vendor/quiche/src/recovery/gcongestion/bbr.rs +37 -37
- package/vendor/quiche/src/recovery/gcongestion/bbr2/drain.rs +120 -120
- package/vendor/quiche/src/recovery/gcongestion/bbr2/mode.rs +318 -318
- package/vendor/quiche/src/recovery/gcongestion/bbr2/network_model.rs +784 -784
- package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_bw.rs +729 -729
- package/vendor/quiche/src/recovery/gcongestion/bbr2/probe_rtt.rs +175 -175
- package/vendor/quiche/src/recovery/gcongestion/bbr2/startup.rs +190 -190
- package/vendor/quiche/src/recovery/gcongestion/bbr2.rs +855 -855
- package/vendor/quiche/src/recovery/gcongestion/mod.rs +275 -275
- package/vendor/quiche/src/recovery/gcongestion/pacer.rs +294 -294
- package/vendor/quiche/src/recovery/gcongestion/recovery.rs +1384 -1384
- package/vendor/quiche/src/recovery/mod.rs +3086 -3086
- package/vendor/quiche/src/recovery/rtt.rs +152 -152
- package/vendor/quiche/src/stream/mod.rs +2210 -2210
- package/vendor/quiche/src/stream/recv_buf.rs +1236 -1236
- package/vendor/quiche/src/stream/send_buf.rs +849 -849
- package/vendor/quiche/src/test_utils.rs +681 -681
- package/vendor/quiche/src/tests.rs +12922 -12922
- package/vendor/quiche/src/tls/boringssl.rs +375 -375
- package/vendor/quiche/src/tls/mod.rs +1245 -1245
- package/vendor/quiche/src/transport_params.rs +628 -628
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
# recovery/ -- Loss Detection & Congestion Control
|
|
2
|
-
|
|
3
|
-
## OVERVIEW
|
|
4
|
-
|
|
5
|
-
QUIC loss detection and congestion control per RFC 9002. Two parallel CC
|
|
6
|
-
implementations coexist: `congestion/` (legacy Reno/CUBIC) and `gcongestion/`
|
|
7
|
-
(next-gen BBR2 ported from google/quiche). `Recovery` enum dispatches between
|
|
8
|
-
`LegacyRecovery` and `GRecovery` via `enum_dispatch` over the `RecoveryOps`
|
|
9
|
-
trait (40+ methods).
|
|
10
|
-
|
|
11
|
-
## STRUCTURE
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
mod.rs Recovery enum, RecoveryOps trait, CongestionControlAlgorithm,
|
|
15
|
-
Sent, ReleaseTime/ReleaseDecision, RecoveryConfig, constants
|
|
16
|
-
bandwidth.rs Bandwidth newtype
|
|
17
|
-
bytes_in_flight.rs Bytes-in-flight tracking
|
|
18
|
-
rtt.rs RTT estimation
|
|
19
|
-
|
|
20
|
-
congestion/ Legacy CC (Reno, CUBIC)
|
|
21
|
-
mod.rs CongestionControlOps vtable struct, Congestion state
|
|
22
|
-
recovery.rs LegacyRecovery impl of RecoveryOps, Acked struct
|
|
23
|
-
reno.rs Static RENO: CongestionControlOps
|
|
24
|
-
cubic.rs Static CUBIC: CongestionControlOps
|
|
25
|
-
delivery_rate.rs Delivery rate sampling
|
|
26
|
-
hystart.rs HyStart slow-start exit
|
|
27
|
-
prr.rs Proportional Rate Reduction
|
|
28
|
-
test_sender.rs Test-only CC sender
|
|
29
|
-
|
|
30
|
-
gcongestion/ Next-gen CC (BBR2)
|
|
31
|
-
mod.rs CongestionControl trait, Acked struct, BbrParams (#[doc(hidden)])
|
|
32
|
-
recovery.rs GRecovery impl of RecoveryOps
|
|
33
|
-
pacer.rs Token-bucket pacer
|
|
34
|
-
bbr2.rs BBR2 top-level + Bbr2CongestionControl
|
|
35
|
-
bbr2/ BBR2 state machine substates
|
|
36
|
-
mode.rs Mode enum (Startup, Drain, ProbeBw, ProbeRtt)
|
|
37
|
-
startup.rs Startup mode
|
|
38
|
-
drain.rs Drain mode
|
|
39
|
-
probe_bw.rs ProbeBW mode (bandwidth probing cycles)
|
|
40
|
-
probe_rtt.rs ProbeRTT mode (min RTT measurement)
|
|
41
|
-
network_model.rs Bandwidth/RTT model, BbrParams application
|
|
42
|
-
bbr.rs BBR (v1, not actively used)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## WHERE TO LOOK
|
|
46
|
-
|
|
47
|
-
| Task | File | Notes |
|
|
48
|
-
|------|------|-------|
|
|
49
|
-
| Add/change CC algorithm | `congestion/mod.rs` or `gcongestion/mod.rs` | Different dispatch patterns |
|
|
50
|
-
| Modify loss detection | `congestion/recovery.rs` or `gcongestion/recovery.rs` | Parallel impls |
|
|
51
|
-
| Shared trait surface | `mod.rs:183-320` | `RecoveryOps` -- both impls must satisfy |
|
|
52
|
-
| Algorithm selection | `mod.rs:365` | `CongestionControlAlgorithm` enum, `#[repr(C)]` for FFI |
|
|
53
|
-
| BBR2 tuning | `gcongestion/bbr2/network_model.rs` | `BbrParams` applied here |
|
|
54
|
-
| Pacing | `gcongestion/pacer.rs`, `mod.rs:691` | `ReleaseTime`, `ReleaseDecision` |
|
|
55
|
-
| Per-packet metadata | `mod.rs:394` | `Sent` struct |
|
|
56
|
-
| qlog integration | grep `#[cfg(feature = "qlog")]` | Gated throughout both impls |
|
|
57
|
-
|
|
58
|
-
## ANTI-PATTERNS
|
|
59
|
-
|
|
60
|
-
- **Two `Acked` structs** at `congestion/recovery.rs:1079` and `gcongestion/mod.rs:49`.
|
|
61
|
-
NOT unified. Do NOT create a third.
|
|
62
|
-
- **FIXME stubs**: Some `RecoveryOps` methods only apply to one impl. Both sides
|
|
63
|
-
have `// FIXME only used by {congestion,gcongestion}` stubs that return
|
|
64
|
-
defaults. Do not proliferate; prefer narrowing the shared trait.
|
|
65
|
-
- **`congestion/` uses C-like vtable** (`CongestionControlOps` with static fn
|
|
66
|
-
pointers: `RENO`, `CUBIC`). `gcongestion/` uses trait objects
|
|
67
|
-
(`CongestionControl` trait). Do not mix dispatch styles.
|
|
68
|
-
- **`BbrParams` is `#[doc(hidden)]`** and experimental. Do not stabilize or
|
|
69
|
-
expose without explicit intent.
|
|
70
|
-
- **Many `#[cfg(test)]` accessors** on `RecoveryOps` (lines 200-297). Test-only;
|
|
71
|
-
do not call from production code.
|
|
72
|
-
|
|
73
|
-
## NOTES
|
|
74
|
-
|
|
75
|
-
- Constants cite RFC 9002: `INITIAL_TIME_THRESHOLD = 9.0/8.0`, `GRANULARITY = 1ms`.
|
|
76
|
-
- `CongestionControlAlgorithm` values: Reno=0, CUBIC=1, Bbr2Gcongestion=4. Gap is intentional (removed variants).
|
|
77
|
-
- `Recovery::new_with_config` tries `GRecovery::new` first; falls back to `LegacyRecovery` if algo is Reno/CUBIC.
|
|
78
|
-
- `bbr2/` is a deeply nested state machine -- changes require understanding all six substates.
|
|
79
|
-
- `enable_relaxed_loss_threshold` experiment adjusts time thresholds dynamically on spurious loss.
|
|
80
|
-
- `gcongestion/bbr.rs` is BBRv1 -- mostly vestigial alongside BBR2.
|
|
1
|
+
# recovery/ -- Loss Detection & Congestion Control
|
|
2
|
+
|
|
3
|
+
## OVERVIEW
|
|
4
|
+
|
|
5
|
+
QUIC loss detection and congestion control per RFC 9002. Two parallel CC
|
|
6
|
+
implementations coexist: `congestion/` (legacy Reno/CUBIC) and `gcongestion/`
|
|
7
|
+
(next-gen BBR2 ported from google/quiche). `Recovery` enum dispatches between
|
|
8
|
+
`LegacyRecovery` and `GRecovery` via `enum_dispatch` over the `RecoveryOps`
|
|
9
|
+
trait (40+ methods).
|
|
10
|
+
|
|
11
|
+
## STRUCTURE
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
mod.rs Recovery enum, RecoveryOps trait, CongestionControlAlgorithm,
|
|
15
|
+
Sent, ReleaseTime/ReleaseDecision, RecoveryConfig, constants
|
|
16
|
+
bandwidth.rs Bandwidth newtype
|
|
17
|
+
bytes_in_flight.rs Bytes-in-flight tracking
|
|
18
|
+
rtt.rs RTT estimation
|
|
19
|
+
|
|
20
|
+
congestion/ Legacy CC (Reno, CUBIC)
|
|
21
|
+
mod.rs CongestionControlOps vtable struct, Congestion state
|
|
22
|
+
recovery.rs LegacyRecovery impl of RecoveryOps, Acked struct
|
|
23
|
+
reno.rs Static RENO: CongestionControlOps
|
|
24
|
+
cubic.rs Static CUBIC: CongestionControlOps
|
|
25
|
+
delivery_rate.rs Delivery rate sampling
|
|
26
|
+
hystart.rs HyStart slow-start exit
|
|
27
|
+
prr.rs Proportional Rate Reduction
|
|
28
|
+
test_sender.rs Test-only CC sender
|
|
29
|
+
|
|
30
|
+
gcongestion/ Next-gen CC (BBR2)
|
|
31
|
+
mod.rs CongestionControl trait, Acked struct, BbrParams (#[doc(hidden)])
|
|
32
|
+
recovery.rs GRecovery impl of RecoveryOps
|
|
33
|
+
pacer.rs Token-bucket pacer
|
|
34
|
+
bbr2.rs BBR2 top-level + Bbr2CongestionControl
|
|
35
|
+
bbr2/ BBR2 state machine substates
|
|
36
|
+
mode.rs Mode enum (Startup, Drain, ProbeBw, ProbeRtt)
|
|
37
|
+
startup.rs Startup mode
|
|
38
|
+
drain.rs Drain mode
|
|
39
|
+
probe_bw.rs ProbeBW mode (bandwidth probing cycles)
|
|
40
|
+
probe_rtt.rs ProbeRTT mode (min RTT measurement)
|
|
41
|
+
network_model.rs Bandwidth/RTT model, BbrParams application
|
|
42
|
+
bbr.rs BBR (v1, not actively used)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## WHERE TO LOOK
|
|
46
|
+
|
|
47
|
+
| Task | File | Notes |
|
|
48
|
+
|------|------|-------|
|
|
49
|
+
| Add/change CC algorithm | `congestion/mod.rs` or `gcongestion/mod.rs` | Different dispatch patterns |
|
|
50
|
+
| Modify loss detection | `congestion/recovery.rs` or `gcongestion/recovery.rs` | Parallel impls |
|
|
51
|
+
| Shared trait surface | `mod.rs:183-320` | `RecoveryOps` -- both impls must satisfy |
|
|
52
|
+
| Algorithm selection | `mod.rs:365` | `CongestionControlAlgorithm` enum, `#[repr(C)]` for FFI |
|
|
53
|
+
| BBR2 tuning | `gcongestion/bbr2/network_model.rs` | `BbrParams` applied here |
|
|
54
|
+
| Pacing | `gcongestion/pacer.rs`, `mod.rs:691` | `ReleaseTime`, `ReleaseDecision` |
|
|
55
|
+
| Per-packet metadata | `mod.rs:394` | `Sent` struct |
|
|
56
|
+
| qlog integration | grep `#[cfg(feature = "qlog")]` | Gated throughout both impls |
|
|
57
|
+
|
|
58
|
+
## ANTI-PATTERNS
|
|
59
|
+
|
|
60
|
+
- **Two `Acked` structs** at `congestion/recovery.rs:1079` and `gcongestion/mod.rs:49`.
|
|
61
|
+
NOT unified. Do NOT create a third.
|
|
62
|
+
- **FIXME stubs**: Some `RecoveryOps` methods only apply to one impl. Both sides
|
|
63
|
+
have `// FIXME only used by {congestion,gcongestion}` stubs that return
|
|
64
|
+
defaults. Do not proliferate; prefer narrowing the shared trait.
|
|
65
|
+
- **`congestion/` uses C-like vtable** (`CongestionControlOps` with static fn
|
|
66
|
+
pointers: `RENO`, `CUBIC`). `gcongestion/` uses trait objects
|
|
67
|
+
(`CongestionControl` trait). Do not mix dispatch styles.
|
|
68
|
+
- **`BbrParams` is `#[doc(hidden)]`** and experimental. Do not stabilize or
|
|
69
|
+
expose without explicit intent.
|
|
70
|
+
- **Many `#[cfg(test)]` accessors** on `RecoveryOps` (lines 200-297). Test-only;
|
|
71
|
+
do not call from production code.
|
|
72
|
+
|
|
73
|
+
## NOTES
|
|
74
|
+
|
|
75
|
+
- Constants cite RFC 9002: `INITIAL_TIME_THRESHOLD = 9.0/8.0`, `GRANULARITY = 1ms`.
|
|
76
|
+
- `CongestionControlAlgorithm` values: Reno=0, CUBIC=1, Bbr2Gcongestion=4. Gap is intentional (removed variants).
|
|
77
|
+
- `Recovery::new_with_config` tries `GRecovery::new` first; falls back to `LegacyRecovery` if algo is Reno/CUBIC.
|
|
78
|
+
- `bbr2/` is a deeply nested state machine -- changes require understanding all six substates.
|
|
79
|
+
- `enable_relaxed_loss_threshold` experiment adjusts time thresholds dynamically on spurious loss.
|
|
80
|
+
- `gcongestion/bbr.rs` is BBRv1 -- mostly vestigial alongside BBR2.
|