diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a423d73a01f..0bf08999ddc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,3 +50,10 @@ For each finding: If you encounter issues, or findings that are out of scope, create follow-up quests. Focus on the core problem, offering a potential solution only if its obvious. For non-trivial tasks, file an issue or offer to run `/plan-quests`. + +# Forks + +[moq-dev/noq](https://github.com/moq-dev/noq) publishes `moq-noq*`, the QUIC stack every published MoQ crate builds on; iroh keeps upstream noq. +Its `moq-sync` workflow merges n0-computer/noq weekly as a PR; review it like any other, and `PARENT` names the upstream commit each release includes. +A carried change lists its upstream PR, or the reason it has none, in the fork PR. +For an advisory against noq or Quinn, compare the pinned release's `PARENT` with the fixing upstream commit, then sync, release the fork, and bump the pin here. diff --git a/Cargo.lock b/Cargo.lock index d935e0963b6..ea5c3a578c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4628,6 +4628,72 @@ dependencies = [ "moq-net", ] +[[package]] +name = "moq-noq" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274035555d1c26479ff5dabdf2e6d201fc2d9d1c1357993884eb72dfdc135392" +dependencies = [ + "bytes", + "cfg_aliases", + "derive_more 2.1.1", + "moq-noq-proto", + "moq-noq-udp", + "pin-project-lite", + "rustc-hash 2.1.3", + "rustls", + "socket2 0.6.5", + "thiserror 2.0.20", + "tokio", + "tokio-stream", + "tracing", + "web-time", +] + +[[package]] +name = "moq-noq-proto" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef835fcf9b92c0f04a77c2fc060cf2a23616ee15176bf41c09847b38186fcb36" +dependencies = [ + "aes-gcm", + "aws-lc-rs", + "bytes", + "derive_more 2.1.1", + "enum-assoc", + "fastbloom", + "getrandom 0.4.3", + "identity-hash", + "lru-slab", + "n0-qlog", + "rand 0.10.2", + "rand_pcg", + "ring", + "rustc-hash 2.1.3", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "slab", + "sorted-index-buffer", + "thiserror 2.0.20", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "moq-noq-udp" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41114fce0ba95fa5caf3efd62565e71a40da4c2e15f189f482d85db2970d2de5" +dependencies = [ + "cfg_aliases", + "libc", + "socket2 0.6.5", + "tracing", + "windows-sys 0.61.2", +] + [[package]] name = "moq-nvenc" version = "0.0.5" @@ -4836,7 +4902,7 @@ dependencies = [ "url", "usage-rs", "web-transport-iroh", - "web-transport-noq", + "web-transport-moq", "web-transport-proto", "web-transport-trait", "webpki-roots", @@ -4874,11 +4940,11 @@ dependencies = [ "kio", "libc", "moq-net", + "moq-noq-proto", + "moq-noq-udp", "moq-sock", "moq-tokio", "nix", - "noq-proto", - "noq-udp", "rand 0.10.2", "rcgen", "rustc-hash 2.1.3", @@ -4891,7 +4957,7 @@ dependencies = [ "tokio", "tracing", "url", - "web-transport-noq", + "web-transport-moq", "web-transport-proto", "web-transport-trait", ] @@ -5341,18 +5407,14 @@ dependencies = [ "bytes", "derive_more 2.1.1", "enum-assoc", - "fastbloom", "getrandom 0.4.3", "identity-hash", "lru-slab", - "n0-qlog", "rand 0.10.2", "rand_pcg", - "ring", "rustc-hash 2.1.3", "rustls", "rustls-pki-types", - "rustls-platform-verifier", "slab", "sorted-index-buffer", "thiserror 2.0.20", @@ -9811,16 +9873,16 @@ dependencies = [ ] [[package]] -name = "web-transport-noq" -version = "0.3.0" +name = "web-transport-moq" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dfe08820de549204c3ab02e901c4a316616ba7daae26df4478a86f4a2d48cd" +checksum = "6cf318557d2c563036e914dc4282275e4196ea5cee22614075157f0d227dbeaf" dependencies = [ "bytes", "futures", "http", "kio", - "noq", + "moq-noq", "rustls", "rustls-native-certs", "thiserror 2.0.20", diff --git a/Cargo.toml b/Cargo.toml index f243248800c..dd187640350 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -139,6 +139,10 @@ moq-loc = { version = "0.2.8", path = "rs/moq-loc" } moq-msf = { version = "0.4.2", path = "rs/moq-msf" } moq-mux = { version = "0.9.16", path = "rs/moq-mux" } moq-net = { version = "0.2.22", path = "rs/moq-net" } +# The MoQ fork of noq (moq-dev/noq). iroh keeps upstream noq, so a build with the +# iroh feature carries both stacks. +moq-noq-proto = { version = "1.3", default-features = false } +moq-noq-udp = "1.3" # NVENC bindings, forked from ViliamVadocz/nvidia-video-codec-sdk to dlopen the # driver at runtime. Compiles on any platform (macOS included) but only actually # used by moq-video on Linux. @@ -171,8 +175,8 @@ moq-vaapi = "0.0.4" # that argument, so moq-ffi and libmoq opt NVIDIA, OpenH264, and VAAPI back in. moq-video = { version = "0.0.25", path = "rs/moq-video", default-features = false } nix = { version = "0.31.3", features = ["net", "socket", "uio"] } +# Upstream noq-proto, only for iroh's controller factory types. noq-proto = { version = "1.2", default-features = false } -noq-udp = "1.1.1" num_enum = "0.7" objc2 = "0.6.4" objc2-av-foundation = "0.3.2" @@ -215,8 +219,8 @@ web-async = { version = "0.1.5", features = ["tracing"] } web-transport-iroh = "0.7" # default-features off so the QUIC crypto provider is chosen by moq-tokio's # aws-lc-rs / ring features. -# 0.3 for the `qlog` passthrough feature moq-tokio's `qlog` forwards to. -web-transport-noq = { version = "0.3", default-features = false } +# The WebTransport adapter released with moq-noq, from the same repository. +web-transport-moq = { version = "1.3", default-features = false } web-transport-proto = "0.6" web-transport-trait = "0.4" web-transport-wasm = "0.6" diff --git a/quest/future/multipath-spike.md b/quest/future/multipath-spike.md index 44352dc97c0..f26d6804fe6 100644 --- a/quest/future/multipath-spike.md +++ b/quest/future/multipath-spike.md @@ -20,7 +20,7 @@ negotiated on any MoQ connection. The spike is small: call that setter, add a max-paths knob beside the other transport settings, and open a second path from the connect side. It rides entirely below the `web_transport_trait` line, because -`web_transport_noq::Session` derefs to `noq::Connection` and the trait requires +`web_transport_moq::Session` derefs to `noq::Connection` and the trait requires `Clone`, so the backend can hand one clone to moq-net and keep another to drive paths on. No trait change, no moq-net change, and none belongs there: a browser WebTransport backend could never implement it. @@ -59,8 +59,3 @@ different name. Target `dev`, where the crate is `moq-tokio`; the rename has not reached `main`. - -## Related - -- [Fork noq](/quest/next/quic/fork.md) - noq's multipath support is one - reason it is the parent diff --git a/quest/future/quic-buffer-pool.md b/quest/future/quic-buffer-pool.md index 37c08df8865..c454089241f 100644 --- a/quest/future/quic-buffer-pool.md +++ b/quest/future/quic-buffer-pool.md @@ -21,10 +21,6 @@ noise and the idea is closed. - `just bench BASE` on Linux: CPU per Gbps, RSS, and p99 latency. Ship only a measured win. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the seam lives there - ## Related - [#3204](/quest/next/perf/3204-moq-uring-register-tx-pool-buffers-for-zero-copy-sends.md) - diff --git a/quest/future/quic-careful-resume.md b/quest/future/quic-careful-resume.md index 5db02dde21d..56106d4e27a 100644 --- a/quest/future/quic-careful-resume.md +++ b/quest/future/quic-careful-resume.md @@ -30,10 +30,6 @@ Measure time to the encoder's target rate after a reconnect on the impaired path profile, plus loss and latency during the jump. Ship it on by default only when the jump never makes the first second worse than slow start. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the controller wrapper lives there - ## Related - [Transport upgrade](/quest/next/transport-upgrade/README.md) - one of the diff --git a/quest/future/quic-ecn.md b/quest/future/quic-ecn.md index ccdf87459e5..ed511199002 100644 --- a/quest/future/quic-ecn.md +++ b/quest/future/quic-ecn.md @@ -33,7 +33,5 @@ per path and only an ACK without counts turns it off, so both `off` and ## Required -- [Fork noq](/quest/next/quic/fork.md) - the `Ect1` option and the `off` knob - live there - [Measure ECN on the backbone](/quest/next/quic/ecn-measure.md) - the provider verdict this quest acts on diff --git a/quest/future/quic-keep-alive.md b/quest/future/quic-keep-alive.md index 95ee543ecd7..f4ebdf65303 100644 --- a/quest/future/quic-keep-alive.md +++ b/quest/future/quic-keep-alive.md @@ -32,7 +32,3 @@ vars; NAT-sensitive deployments keep it as the new maximum, documented in Tests: an idle connection survives an idle timeout with exactly one PING per period; a busy connection sends none; a lost PING is probed before the deadline; the maximum knob shortens the period. - -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the timer change lives there diff --git a/quest/future/quic-receive-ts.md b/quest/future/quic-receive-ts.md index 7e275facae7..0495dc20f20 100644 --- a/quest/future/quic-receive-ts.md +++ b/quest/future/quic-receive-ts.md @@ -26,10 +26,6 @@ written reason it does not pay. The GCC experiment requires this; a delay-based controller without per-packet arrival times is a different, weaker experiment. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the extension lives there - ## Related - [QUIC GCC](/quest/future/quic-gcc.md) - the controller that consumes it diff --git a/quest/future/quic-send-batching.md b/quest/future/quic-send-batching.md index 96bb2d525a5..5cc6957e651 100644 --- a/quest/future/quic-send-batching.md +++ b/quest/future/quic-send-batching.md @@ -22,10 +22,6 @@ together, so the question there is whether it already gets the benefit. A measured no-win abandons the tokio change; the io_uring result is recorded either way. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - `moq-noq-udp` is the fork's - ## Related - [Kernel pacing](/quest/future/quic-kernel-pacing.md) - pacing per train diff --git a/quest/next/quic/README.md b/quest/next/quic/README.md index 0ab3fe351a6..a7179b8b83e 100644 --- a/quest/next/quic/README.md +++ b/quest/next/quic/README.md @@ -15,8 +15,10 @@ in [future](/quest/future/README.md). ## Plan -Everything here assumes the single noq stack. The [fork](/quest/next/quic/fork.md) -is the first quest in the line and most others require it. +Everything here ships from moq-dev/noq, the fork MoQ publishes as `moq-noq*`. +One stack carries every change on MoQ's own QUIC paths; a build with the `iroh` +feature also compiles upstream noq, and iroh connections are outside what these +quests reach. The seven BBR correctness fixes follow the fork bootstrap. They are separate PRs, but one owner should work in the shared controller code at a time. @@ -44,9 +46,6 @@ This is a transport API change, not a MoQ wire change. ## Quests -- [Fork noq](/quest/next/quic/fork.md) - moq-dev/noq publishes `moq-noq-proto`, - `moq-noq`, and `moq-noq-udp`, tracks its parent, and the sync procedure is - written down - [Preserve QUIC packet identity in BBR](/quest/next/quic/bbr-packet-identity.md) - ACKs and losses identify the right packet across QUIC spaces - [Finish each BBR ACK sample before using it](/quest/next/quic/bbr-ack-sampling.md) - current delivery samples reach the model once with consistent metadata - [Mark application starvation before the next BBR send](/quest/next/quic/bbr-app-limited.md) - resumed bursts retain correct sample labels diff --git a/quest/next/quic/ack-hook.md b/quest/next/quic/ack-hook.md index cb8d1c6ec6c..3439763a21f 100644 --- a/quest/next/quic/ack-hook.md +++ b/quest/next/quic/ack-hook.md @@ -3,7 +3,7 @@ ## Goal A released `web-transport-trait` lets a sender await acknowledgment of a -named byte offset on a send stream, a released `web-transport-noq` implements +named byte offset on a send stream, a released `web-transport-moq` implements it, and every other backend reports that it cannot rather than returning a guess. @@ -30,7 +30,7 @@ use. A default body cannot construct a backend's own `Self::Error`, so unsupported has to live in the return type rather than the error, and a consumer must treat `None` as unknown, never as delivered. -Implement it in `web-transport-noq` over the fork's accessor. Leave +Implement it in `web-transport-moq` over the fork's accessor. Leave `web-transport-wasm` on the default; the browser's `WebTransportSendStream.getStats()` is unimplemented in shipping Chrome and its `bytesAcknowledged` is at risk in the W3C draft. qmux over a reliable transport may treat serialization as @@ -42,7 +42,7 @@ the middle of an in-flight frame, several waiters on one stream in offset order, a waiter whose offset lies beyond the final size, reset by sender, STOP_SENDING by the receiver, and session close. -Cut releases of `web-transport-trait` and `web-transport-noq`. The quest +Cut releases of `web-transport-trait` and `web-transport-moq`. The quest completes when both are on crates.io. ## Required diff --git a/quest/next/quic/ack-progress.md b/quest/next/quic/ack-progress.md index 6a1c3663e8b..f183661d3ac 100644 --- a/quest/next/quic/ack-progress.md +++ b/quest/next/quic/ack-progress.md @@ -37,10 +37,6 @@ Land it in the fork and offer it upstream once it is stable. The quest completes when a `moq-noq-proto` release carries the accessor and `Cargo.lock` here can name it. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the accessor lives there - ## Related - [poll_acked in web-transport](/quest/next/quic/ack-hook.md) - the first diff --git a/quest/next/quic/bbr-ack-sampling.md b/quest/next/quic/bbr-ack-sampling.md index 9dcf5c6f956..b2ee063912f 100644 --- a/quest/next/quic/bbr-ack-sampling.md +++ b/quest/next/quic/bbr-ack-sampling.md @@ -27,10 +27,6 @@ controller simulations and add regressions to the fork's CI. Coordinate with packet identity work if the callback contract changes; settle the API with the maintainer and update its consumers and docs in the same PR. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/bbr-app-limited.md b/quest/next/quic/bbr-app-limited.md index e66accea351..d99212da771 100644 --- a/quest/next/quic/bbr-app-limited.md +++ b/quest/next/quic/bbr-app-limited.md @@ -31,10 +31,6 @@ any controller event changes with the packet identity and ACK sampling fixes. Keep state private where possible; document any public Controller change and its consumers. No wire change is intended. Wire regressions into fork CI. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Finish each BBR ACK sample](/quest/next/quic/bbr-ack-sampling.md) - a separate ordering defect in the same callback lifecycle diff --git a/quest/next/quic/bbr-loss-undo.md b/quest/next/quic/bbr-loss-undo.md index 6c7c9acabfa..7a5e045b086 100644 --- a/quest/next/quic/bbr-loss-undo.md +++ b/quest/next/quic/bbr-loss-undo.md @@ -22,10 +22,6 @@ across ACK events. A new episode must get a new snapshot; real loss must still constrain sending. Cover ProbeRTT interaction and add regressions to the fork's CI. Keep the fix internal with no wire change. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/bbr-packet-identity.md b/quest/next/quic/bbr-packet-identity.md index 7ed4c1cadfe..e210fe87e4a 100644 --- a/quest/next/quic/bbr-packet-identity.md +++ b/quest/next/quic/bbr-packet-identity.md @@ -25,10 +25,6 @@ other controllers and custom implementations. Settle any public API change with the maintainer before implementation; document it inline. No QUIC wire change is intended. Run the regressions in the fork's CI. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/bbr-probe-feedback.md b/quest/next/quic/bbr-probe-feedback.md index 1160dfddcaa..eb004ac2cc0 100644 --- a/quest/next/quic/bbr-probe-feedback.md +++ b/quest/next/quic/bbr-probe-feedback.md @@ -21,10 +21,6 @@ short-term response applies. Include application-limited feedback and ProbeRTT entry so neither leaves stale probe classification. Land these regressions in the fork's CI without changing public APIs or the wire. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/bbr-probe-rtt.md b/quest/next/quic/bbr-probe-rtt.md index 88959feb67c..1692fa3d2d3 100644 --- a/quest/next/quic/bbr-probe-rtt.md +++ b/quest/next/quic/bbr-probe-rtt.md @@ -23,10 +23,6 @@ Do not mark the connection application-limited forever or change the ProbeRTT policy merely to mask a sampling bug. Add the regressions to the fork's CI; keep the fix internal with no wire change. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/bbr-startup-pacing.md b/quest/next/quic/bbr-startup-pacing.md index e40ab1f1942..dda3cc8eae2 100644 --- a/quest/next/quic/bbr-startup-pacing.md +++ b/quest/next/quic/bbr-startup-pacing.md @@ -25,10 +25,6 @@ handshake. Preserve subsequent bandwidth-driven Startup growth. Report any public RTT-estimator API change and document it inline; no wire change is intended. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - fixes and CI regressions land in moq-dev/noq - ## Related - [Release BBR fixes](/quest/next/quic/bbr-release.md) - deliver the corrected controller to MoQ diff --git a/quest/next/quic/deadline.md b/quest/next/quic/deadline.md index dd2f3ee8c85..ccd6fde17a4 100644 --- a/quest/next/quic/deadline.md +++ b/quest/next/quic/deadline.md @@ -43,7 +43,6 @@ raises loss or latency under any profile stays off by default. ## Required -- [Fork noq](/quest/next/quic/fork.md) - the change lives there - [Hierarchical stream scheduling](/quest/next/quic/scheduler.md) - the scheduler decides which stream's data a probe carries diff --git a/quest/next/quic/fork.md b/quest/next/quic/fork.md deleted file mode 100644 index 76edd3eebcf..00000000000 --- a/quest/next/quic/fork.md +++ /dev/null @@ -1,52 +0,0 @@ -# [S] Fork noq - -## Goal - -`moq-dev/noq` exists, tracks n0-computer/noq, and publishes `moq-noq-proto`, -`moq-noq`, and `moq-noq-udp` on crates.io under those names. `dev` depends on -the fork and `web-transport-noq` builds against it. Every fork release records -the parent commit it rebased onto, so an advisory against noq or Quinn can be -checked against a MoQ release. The sync procedure is written down in this -repository's contributing docs. - -## Plan - -Fork now; upstream opportunistically. MoQ's transport features (per-stream -ACK progress, `RESET_STREAM_AT`, hierarchical send groups, the qmux crate, -probing, per-stream deadlines, receive timestamps) ship from the fork on -MoQ's schedule. A clean, general change is offered upstream when it is ready, -and a merged one is dropped from the carried set on the next rebase. Nothing -waits on a review there. - -- Fork n0-computer/noq into moq-dev/noq. Rename the packages in their - manifests to `moq-noq-proto`, `moq-noq`, and `moq-noq-udp` so a published - crate never impersonates the parent; keep the library paths and public - types as they are so a `noq_proto::` import becomes a `moq_noq_proto::` - import and nothing else changes. -- Carry a `PARENT` file naming the upstream commit, and a CI job that - attempts the rebase onto upstream main weekly and opens a PR with the - result, so drift is visible before it is expensive. -- Publish the first release with two carried changes: the rename, and BBR3 - as the default congestion controller (MoQ's default already; offering it - upstream is [the first proposal](/quest/next/quic/upstream.md)). Switch - `web-transport-noq` in moq-dev/web-transport to it. -- Pin the fork releases in this workspace's `Cargo.toml`. `dev` may point at a - git tag between releases; `main` and every published crate pin crates.io - versions, and the [release quest](/quest/next/quic/release.md) owns that rule. -- Write the sync procedure into `CONTRIBUTING.md`: which upstream releases - the fork tracks, who rebases, how an advisory against the parent is - triaged, and the rule that a carried change lists its upstream PR or the - reason it has none. - -The initial release is the bootstrap, not the BBR correctness gate. The -[BBR fix quests](/quest/next/quic/README.md) follow it and ship through their -[own release](/quest/next/quic/bbr-release.md); no dependency runs back from -the bootstrap to fixes that require the fork. - -## Related - -- The single noq backend lets one fork carry every feature. -- [Release the stack](/quest/next/quic/release.md) - how fork releases reach - published MoQ crates -- [Multipath spike](/quest/future/multipath-spike.md) - noq's multipath support - is one reason noq was chosen as the parent diff --git a/quest/next/quic/peer-limits.md b/quest/next/quic/peer-limits.md index 191d1a5f5c4..83607a67bec 100644 --- a/quest/next/quic/peer-limits.md +++ b/quest/next/quic/peer-limits.md @@ -15,7 +15,7 @@ noq-proto already exposes runtime `Connection::set_max_concurrent_streams`, `MAX_DATA` on the next packet, and a shrink is a debt paid as the peer consumes credit. Nothing MoQ builds on top needs a fork change. -- `web-transport-noq` (and the trait, with an unsupported default for the +- `web-transport-moq` (and the trait, with an unsupported default for the browser) exposes a `set_limits(Limits)` on the session, `Limits` carrying the three values. - moq-tokio's `[quic]` section gains a `peer` sub-table with the same three diff --git a/quest/next/quic/qmux.md b/quest/next/quic/qmux.md index 0a27df0b5ed..aaaf0726d4b 100644 --- a/quest/next/quic/qmux.md +++ b/quest/next/quic/qmux.md @@ -48,7 +48,6 @@ state machine in the dependency graph, and the accessors qmux needs are ## Required -- [Fork noq](/quest/next/quic/fork.md) - the workspace the crate lives in - [Reliable stream reset](/quest/next/quic/reliable-reset.md) - qmux reuses the extension's stream state rather than implementing reset locally - [Hierarchical stream scheduling](/quest/next/quic/scheduler.md) - qmux must diff --git a/quest/next/quic/release.md b/quest/next/quic/release.md index 048c8302164..201b9807df0 100644 --- a/quest/next/quic/release.md +++ b/quest/next/quic/release.md @@ -3,15 +3,15 @@ ## Goal Immutable releases of `moq-noq-proto`, `moq-noq`, `moq-noq-udp`, -`web-transport-noq`, and the qmux crate are available to every published MoQ +`web-transport-moq`, and the qmux crate are available to every published MoQ crate. The workspace lockfile identifies exact released sources, with no root-only Cargo patch or mutable git branch, and a consumer can tell from any release which parent commit it carries. ## Plan -Release the dependency chain from the bottom up: the fork's three crates, -then `web-transport-trait` if its surface moved, then `web-transport-noq` and +Release the dependency chain from the bottom up: the fork's crates, which one +tag releases together, then `web-transport-trait` if its surface moved, then qmux. Pin each released version in this repository's workspace dependencies and regenerate `Cargo.lock`. Verify minimal, default, and all-feature builds so enabling iroh, qmux, or the uring runtime cannot unify two incompatible copies @@ -26,7 +26,6 @@ the parent applies. - [Release BBR fixes](/quest/next/quic/bbr-release.md) - preserve the corrected controller in later stack releases -- [Fork noq](/quest/next/quic/fork.md) - the packages this releases - [Reliable stream reset](/quest/next/quic/reliable-reset.md) - the WebTransport-required transport extension - [Hierarchical stream scheduling](/quest/next/quic/scheduler.md) - the new diff --git a/quest/next/quic/reliable-reset.md b/quest/next/quic/reliable-reset.md index 75e0f0f7364..701200688a7 100644 --- a/quest/next/quic/reliable-reset.md +++ b/quest/next/quic/reliable-reset.md @@ -57,11 +57,6 @@ Track the unversioned draft during implementation. The planning baseline is draft 10, with transport parameter `0x1d` and frame type `0x24`; do not freeze provisional codepoints if the document changes before release. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the frame and stream-state - implementation lives there - ## Related - [qmux on the QUIC stream state machine](/quest/next/quic/qmux.md) - consumes diff --git a/quest/next/quic/scheduler.md b/quest/next/quic/scheduler.md index 82b2d13d5fa..e395100ecc6 100644 --- a/quest/next/quic/scheduler.md +++ b/quest/next/quic/scheduler.md @@ -99,10 +99,6 @@ scheduler completion must not wait for that dependent integration. Preserve working behavior on backends not yet migrated, and remove queue code only where the new implementation makes it redundant. -## Required - -- [Fork noq](/quest/next/quic/fork.md) - the scheduler lives there - ## Closes - [#699](https://github.com/moq-dev/moq/issues/699) - close this issue when the diff --git a/quest/next/quic/upstream.md b/quest/next/quic/upstream.md index 9f2e0211f14..c48ceb4166b 100644 --- a/quest/next/quic/upstream.md +++ b/quest/next/quic/upstream.md @@ -51,7 +51,6 @@ offered and answered. - [Release BBR fixes](/quest/next/quic/bbr-release.md) - the corrected controller and its regression evidence -- [Fork noq](/quest/next/quic/fork.md) - the fork the proposals split from - [Per-stream ACK progress](/quest/next/quic/ack-progress.md) - [Reliable stream reset](/quest/next/quic/reliable-reset.md) - [Keep-alive by deadline](/quest/future/quic-keep-alive.md) diff --git a/rs/moq-tokio/Cargo.toml b/rs/moq-tokio/Cargo.toml index 1dd36912bb9..a4e750e7d9e 100644 --- a/rs/moq-tokio/Cargo.toml +++ b/rs/moq-tokio/Cargo.toml @@ -14,7 +14,7 @@ categories = ["multimedia", "network-programming", "web-programming"] [features] default = ["noq", "aws-lc-rs", "websocket", "tcp", "uds"] -noq = ["_transport", "_certs", "dep:web-transport-noq", "dep:reqwest", "watch", "dep:dns-lookup"] +noq = ["_transport", "_certs", "dep:web-transport-moq", "dep:reqwest", "watch", "dep:dns-lookup"] # Server-side certificate handling: chains loaded from disk, self-signed generation, # in-memory identities, and per-SNI selection. Not one to enable on its own, since # nothing turns it into a listener: every QUIC backend needs it for its own TLS, and @@ -28,12 +28,12 @@ _transport = [] watch = ["dep:notify"] # Capture qlog traces (`--*-quic-qlog `). Off by default so production # builds do not pull in the qlog crate and its serde_json encoder. -qlog = ["web-transport-noq?/qlog"] +qlog = ["web-transport-moq?/qlog"] # The QUIC backend pulls in its crypto provider from these features (default-features # are off on the dependency), so a backend without aws-lc-rs/ring has no initial cipher. # A provider is also all it takes to sign and serve certificates, so each turns on # `_certs` even where there is no QUIC backend to serve them for. -aws-lc-rs = ["_certs", "rustls/aws-lc-rs", "rcgen/aws_lc_rs", "web-transport-noq?/aws-lc-rs"] +aws-lc-rs = ["_certs", "rustls/aws-lc-rs", "rcgen/aws_lc_rs", "web-transport-moq?/aws-lc-rs"] iroh = ["_transport", "dep:web-transport-iroh", "dep:web-transport-proto", "dep:noq-proto"] # LAN peer discovery over mDNS (the `mdns` module). mdns = ["dep:mdns-sd", "dep:hmac", "dep:sha2", "dep:subtle"] @@ -44,7 +44,7 @@ tcp = ["_transport", "dep:qmux", "dep:dns-lookup"] # Unix-domain-socket qmux transport (`unix://`), unix-only. Adds peer-credential # inspection on accept. Pulls in `tcp` (shares qmux's stream transport). uds = ["tcp", "qmux/uds"] -ring = ["_certs", "rustls/ring", "rcgen/ring", "web-transport-noq?/ring"] +ring = ["_certs", "rustls/ring", "rcgen/ring", "web-transport-moq?/ring"] android-logcat = ["dep:tracing-android"] [dependencies] @@ -60,8 +60,9 @@ mdns-sd = { workspace = true, optional = true } moq-net = { workspace = true } moq-sock = { workspace = true } -# iroh runs on noq but re-exports only the ControllerFactory trait, not the concrete -# congestion configs. Version matched to the copy iroh pulls in. +# iroh runs on upstream noq, not the moq-noq fork, and re-exports only the +# ControllerFactory trait, not the concrete congestion configs. Version matched to +# the copy iroh pulls in. noq-proto = { workspace = true, optional = true } notify = { version = "8", optional = true } qmux = { workspace = true, features = ["wss", "tls", "tcp"], optional = true } @@ -87,7 +88,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } url = { version = "2", features = ["serde"] } usage = { workspace = true, features = ["config"] } web-transport-iroh = { workspace = true, optional = true } -web-transport-noq = { workspace = true, optional = true } +web-transport-moq = { workspace = true, optional = true } web-transport-proto = { workspace = true, optional = true } web-transport-trait = { workspace = true } x509-parser = "0.18" diff --git a/rs/moq-tokio/src/iroh.rs b/rs/moq-tokio/src/iroh.rs index 7573821674f..00fb07e18e5 100644 --- a/rs/moq-tokio/src/iroh.rs +++ b/rs/moq-tokio/src/iroh.rs @@ -9,7 +9,7 @@ use std::{net, path::PathBuf, str::FromStr, sync::Arc}; use crate::quic::CongestionControl; use url::Url; use web_transport_iroh::iroh::{self, SecretKey}; -// NOTE: web-transport-iroh should re-export proto like web-transport-noq does. +// NOTE: web-transport-iroh should re-export proto like web-transport-moq does. use web_transport_proto::{ConnectRequest, ConnectResponse}; pub use iroh::Endpoint; diff --git a/rs/moq-tokio/src/noq.rs b/rs/moq-tokio/src/noq.rs index f0f33ccae51..91b26252605 100644 --- a/rs/moq-tokio/src/noq.rs +++ b/rs/moq-tokio/src/noq.rs @@ -10,9 +10,7 @@ use crate::tls::{FingerprintVerifier, ServeCerts}; use std::net; use std::sync::Arc; use std::time::Duration; -use web_transport_noq::noq; - -pub use web_transport_noq; +use web_transport_moq::noq; /// Attach a qlog factory writing into the configured directory, if any. /// @@ -203,7 +201,7 @@ pub enum Error { message: String, /// The HTTP status the server answered the CONNECT with, when it answered with one. /// - /// Read at conversion time rather than kept as a `web-transport-noq` error, so the + /// Read at conversion time rather than kept as a `web-transport-moq` error, so the /// classification survives without that crate appearing in this crate's public API. status: Option, }, @@ -253,7 +251,7 @@ impl crate::failover::Aggregate for Error { crate::error::from_message! { noq::ConnectError => Connect, noq::ConnectionError => Connection, - web_transport_noq::ServerError => Server, + web_transport_moq::ServerError => Server, hex::FromHexError => InvalidFingerprint, } @@ -263,8 +261,8 @@ impl From for Error { } } -impl From for Error { - fn from(err: web_transport_noq::ClientError) -> Self { +impl From for Error { + fn from(err: web_transport_moq::ClientError) -> Self { Self::Client { status: client_status(&err), message: crate::error::message(err), @@ -330,7 +328,7 @@ impl NoqClient { tls: &rustls::ClientConfig, addr: crate::connect::Addr, versions: &moq_net::Versions, - ) -> Result { + ) -> Result { let mut url = addr.url().clone(); let mut config = tls.clone(); @@ -385,7 +383,7 @@ impl NoqClient { } let alpns: Vec> = match url.scheme() { - "https" => vec![web_transport_noq::ALPN.as_bytes().to_vec()], + "https" => vec![web_transport_moq::ALPN.as_bytes().to_vec()], "moqt" | "moql" => versions.alpns().iter().map(|alpn| alpn.as_bytes().to_vec()).collect(), _ => return Err(Error::InvalidScheme), }; @@ -416,15 +414,15 @@ impl NoqClient { let session = match url.scheme() { "https" => { - let mut request = web_transport_noq::proto::ConnectRequest::new(url.clone()); + let mut request = web_transport_moq::proto::ConnectRequest::new(url.clone()); for alpn in versions.alpns() { request = request.with_protocol(alpn.to_string()); } - web_transport_noq::Session::connect(connection, request) + web_transport_moq::Session::connect(connection, request) .await .map_err(map_client_error)? } - "moqt" | "moql" => web_transport_noq::Session::raw(connection), + "moqt" | "moql" => web_transport_moq::Session::raw(connection), _ => return Err(Error::UnsupportedScheme(url.scheme().to_string())), }; @@ -470,7 +468,7 @@ impl Error { } } -fn map_client_error(err: web_transport_noq::ClientError) -> Error { +fn map_client_error(err: web_transport_moq::ClientError) -> Error { match client_status(&err).and_then(crate::ConnectError::from_status_u16) { Some(rejected) => rejected.into(), None => err.into(), @@ -484,25 +482,25 @@ fn map_client_error(err: web_transport_noq::ClientError) -> Error { /// [`crate::ConnectError`], and [`Error::status`] hands it to the caller, whose backoff consults /// the status. A `404` or `405` is the server's settled answer, so retrying /// it just burns the reconnect budget on a URL that will never work. -fn client_status(err: &web_transport_noq::ClientError) -> Option { +fn client_status(err: &web_transport_moq::ClientError) -> Option { match err { - web_transport_noq::ClientError::HttpError(err) => connect_status(err), + web_transport_moq::ClientError::HttpError(err) => connect_status(err), _ => None, } } -fn connect_status(err: &web_transport_noq::ConnectError) -> Option { +fn connect_status(err: &web_transport_moq::ConnectError) -> Option { match err { - web_transport_noq::ConnectError::ErrorStatus(status) => Some(status.as_u16()), - web_transport_noq::ConnectError::ProtoError(err) => proto_status(err), + web_transport_moq::ConnectError::ErrorStatus(status) => Some(status.as_u16()), + web_transport_moq::ConnectError::ProtoError(err) => proto_status(err), _ => None, } } -fn proto_status(err: &web_transport_noq::proto::ConnectError) -> Option { +fn proto_status(err: &web_transport_moq::proto::ConnectError) -> Option { match err { - web_transport_noq::proto::ConnectError::ErrorStatus(status) - | web_transport_noq::proto::ConnectError::WrongStatus(Some(status)) => Some(status.as_u16()), + web_transport_moq::proto::ConnectError::ErrorStatus(status) + | web_transport_moq::proto::ConnectError::WrongStatus(Some(status)) => Some(status.as_u16()), _ => None, } } @@ -547,7 +545,7 @@ impl NoqServer { .iter() .map(|alpn| alpn.as_bytes().to_vec()) .collect(); - alpns.push(web_transport_noq::ALPN.as_bytes().to_vec()); + alpns.push(web_transport_moq::ALPN.as_bytes().to_vec()); tls.alpn_protocols = alpns; tls.key_log = Arc::new(rustls::KeyLogFile::new()); @@ -657,7 +655,7 @@ impl NoqServer { pub(crate) async fn accept( conn: noq::Incoming, alpns: Vec<&'static str>, -) -> Result> { +) -> Result> { let mut conn = conn.accept()?; let handshake = conn @@ -690,10 +688,10 @@ pub(crate) async fn accept( }; match alpn.as_str() { - web_transport_noq::ALPN => { + web_transport_moq::ALPN => { // Wait for the CONNECT request, then capture its URL and mTLS identity before // the response consumes it. - let request = web_transport_noq::Request::accept(conn) + let request = web_transport_moq::Request::accept(conn) .await .map_err(|err| Error::RecvRequest(crate::error::message(err)))?; let url = Some(request.url.clone()); @@ -701,7 +699,7 @@ pub(crate) async fn accept( // The authority the client put in its CONNECT URL. let authority = request.url.host_str().filter(|h| !h.is_empty()).map(str::to_owned); - let mut response = web_transport_noq::proto::ConnectResponse::OK; + let mut response = web_transport_moq::proto::ConnectResponse::OK; let mut link = link; if let Some(protocol) = request.protocols.iter().find(|p| alpns.contains(&p.as_str())) { response = response.with_protocol(protocol); @@ -728,7 +726,7 @@ pub(crate) async fn accept( // Raw QUIC carries no request URL; the path rides the SETUP. The TLS SNI is the // only authority the client can offer here, and it is optional. let authority = (!host.is_empty()).then_some(host); - let session = web_transport_noq::Session::raw(conn); + let session = web_transport_moq::Session::raw(conn); Ok(crate::server::Accepted { session, url: None, @@ -909,7 +907,7 @@ mod tests { .await .expect("connect failed"); - // web_transport_noq::Session derefs to the noq connection. + // web_transport_moq::Session derefs to the noq connection. assert!(is_bbr3(&session), "client connection is not running BBRv3"); assert!( accepted.await.expect("server task panicked"), diff --git a/rs/moq-tokio/src/server.rs b/rs/moq-tokio/src/server.rs index 5ecf28e39dc..59c9577f00e 100644 --- a/rs/moq-tokio/src/server.rs +++ b/rs/moq-tokio/src/server.rs @@ -237,7 +237,7 @@ pub struct Server { #[cfg(feature = "noq")] pub(crate) struct SocketRetainer { #[cfg(feature = "noq")] - noq: Option, + noq: Option, } impl Server { @@ -1049,7 +1049,7 @@ type PendingRequest = moq_net::server::Handshake; pub(crate) enum RequestKind { #[cfg(feature = "noq")] - Noq(Box>>), + Noq(Box>>), #[cfg(feature = "iroh")] Iroh(Box>>), #[cfg(any(feature = "tcp", all(feature = "uds", unix), feature = "websocket"))] diff --git a/rs/moq-uring/Cargo.toml b/rs/moq-uring/Cargo.toml index 4836961fb80..62811518ddf 100644 --- a/rs/moq-uring/Cargo.toml +++ b/rs/moq-uring/Cargo.toml @@ -14,12 +14,12 @@ categories = ["asynchronous", "network-programming", "os::linux-apis"] [features] default = ["noq"] -# noq-proto, with TLS through rustls. -noq = ["dep:noq-proto", "dep:rustls", "dep:rustls-platform-verifier"] +# moq-noq-proto, with TLS through rustls. +noq = ["dep:moq-noq-proto", "dep:rustls", "dep:rustls-platform-verifier"] # Capture qlog traces (`quic::Transport::qlog`). Off by default: it compiles the # qlog crate and its serde_json encoder into noq, which a production build has # no use for. -qlog = ["noq-proto?/qlog"] +qlog = ["moq-noq-proto?/qlog"] [target.'cfg(target_os = "linux")'.dependencies] bytes = "1" @@ -28,9 +28,9 @@ io-uring = { workspace = true } kio = { workspace = true } libc = { workspace = true } moq-net = { workspace = true } -moq-sock = { workspace = true } # default-features off so the crypto provider is ours to pick. -noq-proto = { workspace = true, features = ["bloom", "tracing-log", "rustls-aws-lc-rs"], optional = true } +moq-noq-proto = { workspace = true, features = ["bloom", "tracing-log", "rustls-aws-lc-rs"], optional = true } +moq-sock = { workspace = true } rand = "0.10" rustc-hash = { workspace = true } rustls = { version = "0.23", optional = true } @@ -52,9 +52,9 @@ tokio = { workspace = true, features = ["macros", "net", "rt", "sync", "time"] } [target.'cfg(target_os = "linux")'.dev-dependencies] io-uring = { workspace = true } libc = { workspace = true } +moq-noq-udp = { workspace = true } moq-tokio = { workspace = true, features = ["noq", "aws-lc-rs"] } nix = { workspace = true } -noq-udp = { workspace = true } rcgen = { version = "0.14", default-features = false, features = ["pem", "aws_lc_rs"] } rustls = "0.23" # The qlog test parses every record of a trace, which is what catches a @@ -62,7 +62,7 @@ rustls = "0.23" serde_json = { workspace = true } tempfile = { workspace = true } tracing = "0.1" -web-transport-noq = { workspace = true } +web-transport-moq = { workspace = true } [[bench]] name = "udp_tokio" diff --git a/rs/moq-uring/README.md b/rs/moq-uring/README.md index fe6737f7db5..540b64cb364 100644 --- a/rs/moq-uring/README.md +++ b/rs/moq-uring/README.md @@ -64,13 +64,13 @@ the tokio stack. ## Backends -The `quic` module uses the sans-IO [noq-proto](https://github.com/kixelated/noq) +The `quic` module uses the sans-IO [moq-noq-proto](https://github.com/moq-dev/noq) stack with rustls. The `noq` feature is enabled by default and remains optional so the worker, timers, and UDP socket can be built without QUIC. | Feature | Stack | TLS | |---|---|---| -| `noq` (default) | [noq-proto](https://github.com/kixelated/noq) | rustls | +| `noq` (default) | [moq-noq-proto](https://github.com/moq-dev/noq) | rustls | Building without default features leaves the `quic` module out entirely. @@ -92,7 +92,7 @@ handshake, half a megabyte each way, and timers driven by noq's timeout. `tests/endpoint.rs` covers the endpoint mechanics (dial+accept on one socket, version negotiation, the dial-only refusal), `tests/workers.rs` runs a steered two-worker reuseport group serving one port across threads, and -`tests/web.rs` is WebTransport interop against `web-transport-noq`: stream and +`tests/web.rs` is WebTransport interop against `web-transport-moq`: stream and datagram echo through the H3 framing, close codes through the capsule, and a full moq-lite session over WebTransport. All of them skip (loudly) below the kernel floor, which diff --git a/rs/moq-uring/benches/echo_noq.rs b/rs/moq-uring/benches/echo_noq.rs index ed124886c95..d93b738cd08 100644 --- a/rs/moq-uring/benches/echo_noq.rs +++ b/rs/moq-uring/benches/echo_noq.rs @@ -48,7 +48,7 @@ mod linux { let handle = worker.handle(); let certs = support::certs().expect("certificates"); let mut server = quic::server::Config::new(quic::Identity::open(&certs.cert, &certs.key).expect("identity")); - server.alpn = vec![web_transport_noq::ALPN.to_string()]; + server.alpn = vec![web_transport_moq::ALPN.to_string()]; let socket = handle .udp(UdpSocket::bind("127.0.0.1:0").expect("bind"), udp_config) .expect("socket"); @@ -65,11 +65,11 @@ mod linux { .build() .expect("runtime"); runtime.block_on(async move { - let client = web_transport_noq::ClientBuilder::new() + let client = web_transport_moq::ClientBuilder::new() .dangerous() .with_no_certificate_verification() .expect("client"); - let request = web_transport_noq::proto::ConnectRequest::new( + let request = web_transport_moq::proto::ConnectRequest::new( url::Url::parse(&format!("https://{addr}/echo")).expect("url"), ); let session = client.connect(request).await.expect("connect"); diff --git a/rs/moq-uring/benches/udp_tokio.rs b/rs/moq-uring/benches/udp_tokio.rs index 8a19fe05ef9..a8177291cce 100644 --- a/rs/moq-uring/benches/udp_tokio.rs +++ b/rs/moq-uring/benches/udp_tokio.rs @@ -13,11 +13,11 @@ mod linux { use std::time::{Duration, Instant}; use criterion::{BenchmarkId, Criterion, Throughput}; + use moq_noq_udp::{RecvMeta, Transmit, UdpSocketState}; use nix::sys::socket::{ ControlMessageOwned, MsgFlags, getsockopt, recvmsg, setsockopt, sockopt::{RcvBuf, UdpGroSegment}, }; - use noq_udp::{RecvMeta, Transmit, UdpSocketState}; use tokio::io::Interest; use tokio::net::UdpSocket; @@ -70,8 +70,8 @@ mod linux { send_messages: Box<[libc::mmsghdr; BURST_SEGMENTS]>, _send_iovecs: Box<[libc::iovec; BURST_SEGMENTS]>, single_buffer: Vec, - batch_buffers: Box<[Vec; noq_udp::BATCH_SIZE]>, - batch_meta: [RecvMeta; noq_udp::BATCH_SIZE], + batch_buffers: Box<[Vec; moq_noq_udp::BATCH_SIZE]>, + batch_meta: [RecvMeta; moq_noq_udp::BATCH_SIZE], } #[derive(Default)] @@ -114,7 +114,7 @@ mod linux { ); } - let batch_buffers = (0..noq_udp::BATCH_SIZE) + let batch_buffers = (0..moq_noq_udp::BATCH_SIZE) .map(|_| vec![0; MAX_RECV_SIZE]) .collect::>() .into_boxed_slice() @@ -144,7 +144,7 @@ mod linux { _send_iovecs: send_iovecs, single_buffer: vec![0; MAX_RECV_SIZE], batch_buffers, - batch_meta: [RecvMeta::default(); noq_udp::BATCH_SIZE], + batch_meta: [RecvMeta::default(); moq_noq_udp::BATCH_SIZE], }) } diff --git a/rs/moq-uring/src/quic/noq/connection.rs b/rs/moq-uring/src/quic/noq/connection.rs index 123a3daa10b..ebb77208803 100644 --- a/rs/moq-uring/src/quic/noq/connection.rs +++ b/rs/moq-uring/src/quic/noq/connection.rs @@ -6,7 +6,7 @@ use std::task::{Context, Poll}; use std::time::Instant; use bytes::Bytes; -use noq_proto::{ConnectionHandle, Dir, StreamId, VarInt}; +use moq_noq_proto::{ConnectionHandle, Dir, StreamId, VarInt}; use rustc_hash::FxHashMap; use super::super::{Error, SEGMENT}; @@ -27,7 +27,7 @@ const TRAIN_SEGMENTS: usize = 63; /// operation can mutate the connection, drop that borrow, and then register a /// waiter without ever holding both. pub(crate) struct Inner { - pub(crate) conn: RefCell, + pub(crate) conn: RefCell, pub(crate) state: RefCell, /// The worker driving this connection, which anything layered on it /// (the WebTransport handshake, say) runs on too. @@ -333,7 +333,7 @@ pub(crate) fn launch( socket: Rc, endpoint: Weak, key: ConnectionHandle, - conn: noq_proto::Connection, + conn: moq_noq_proto::Connection, ) -> (Shared, impl Future + use<>) { let shared = Rc::new(Inner { conn: RefCell::new(conn), @@ -373,7 +373,7 @@ pub(crate) async fn establish(shared: Shared) -> Result { let conn = shared.conn.borrow(); conn.crypto_session() .handshake_data() - .and_then(|data| data.downcast::().ok()) + .and_then(|data| data.downcast::().ok()) .and_then(|data| data.protocol) .map(|proto| String::from_utf8_lossy(&proto).into_owned()) }; @@ -477,7 +477,7 @@ impl web_transport_trait::poll::Session for Connection { Poll::Ready(Ok(())) } // The send queue is full; a flush frees space. - Err(noq_proto::SendDatagramError::Blocked(_)) => { + Err(moq_noq_proto::SendDatagramError::Blocked(_)) => { let mut state = self.shared.state.borrow_mut(); waiter.register(&mut state.datagram_send_waiters); Poll::Pending @@ -525,7 +525,7 @@ impl web_transport_trait::poll::Session for Connection { let (stats, path) = { let mut conn = self.shared.conn.borrow_mut(); let stats = conn.stats(); - let path = conn.path_stats(noq_proto::PathId::ZERO).unwrap_or_default(); + let path = conn.path_stats(moq_noq_proto::PathId::ZERO).unwrap_or_default(); (stats, path) }; Stats { @@ -699,18 +699,18 @@ impl Driver { let mut state = self.shared.state.borrow_mut(); match event { - noq_proto::Event::Connected => { + moq_noq_proto::Event::Connected => { state.established = true; state.establish_waiters.wake(); } - noq_proto::Event::ConnectionLost { reason } => state.fail(reason.into()), - noq_proto::Event::DatagramReceived => state.datagram_recv_waiters.wake(), - noq_proto::Event::DatagramsUnblocked => state.datagram_send_waiters.wake(), - noq_proto::Event::HandshakeDataReady => {} - noq_proto::Event::Stream(event) => sweep_stream(&mut state, event), - noq_proto::Event::HandshakeConfirmed - | noq_proto::Event::Path(_) - | noq_proto::Event::NatTraversal(_) => {} + moq_noq_proto::Event::ConnectionLost { reason } => state.fail(reason.into()), + moq_noq_proto::Event::DatagramReceived => state.datagram_recv_waiters.wake(), + moq_noq_proto::Event::DatagramsUnblocked => state.datagram_send_waiters.wake(), + moq_noq_proto::Event::HandshakeDataReady => {} + moq_noq_proto::Event::Stream(event) => sweep_stream(&mut state, event), + moq_noq_proto::Event::HandshakeConfirmed + | moq_noq_proto::Event::Path(_) + | moq_noq_proto::Event::NatTraversal(_) => {} } } } @@ -825,25 +825,25 @@ fn end(state: &mut State, id: StreamId, end: End) { } /// Apply one stream event to the parking tables. -fn sweep_stream(state: &mut State, event: noq_proto::StreamEvent) { +fn sweep_stream(state: &mut State, event: moq_noq_proto::StreamEvent) { // Waking removes the entry: a still-interested poller re-registers on its // next poll, so the maps only hold streams somebody is parked on. match event { - noq_proto::StreamEvent::Opened { dir: Dir::Bi } => state.accept_bi_waiters.wake(), - noq_proto::StreamEvent::Opened { dir: Dir::Uni } => state.accept_uni_waiters.wake(), - noq_proto::StreamEvent::Available { .. } => state.open_waiters.wake(), - noq_proto::StreamEvent::Readable { id } => { + moq_noq_proto::StreamEvent::Opened { dir: Dir::Bi } => state.accept_bi_waiters.wake(), + moq_noq_proto::StreamEvent::Opened { dir: Dir::Uni } => state.accept_uni_waiters.wake(), + moq_noq_proto::StreamEvent::Available { .. } => state.open_waiters.wake(), + moq_noq_proto::StreamEvent::Readable { id } => { if let Some(mut waiters) = state.readable.remove(&id) { waiters.wake(); } } - noq_proto::StreamEvent::Writable { id } => { + moq_noq_proto::StreamEvent::Writable { id } => { if let Some(mut waiters) = state.writable.remove(&id) { waiters.wake(); } } - noq_proto::StreamEvent::Finished { id } => end(state, id, End::Delivered), - noq_proto::StreamEvent::Stopped { id, error_code } => { + moq_noq_proto::StreamEvent::Finished { id } => end(state, id, End::Delivered), + moq_noq_proto::StreamEvent::Stopped { id, error_code } => { end(state, id, End::Stopped(error_code.into_inner())); // A writer blocked on capacity has to learn it will never come. if let Some(mut waiters) = state.writable.remove(&id) { @@ -855,7 +855,7 @@ fn sweep_stream(state: &mut State, event: noq_proto::StreamEvent) { #[cfg(test)] mod tests { - use noq_proto::Side; + use moq_noq_proto::Side; use super::*; diff --git a/rs/moq-uring/src/quic/noq/endpoint.rs b/rs/moq-uring/src/quic/noq/endpoint.rs index 936e4019932..9d2edf818bc 100644 --- a/rs/moq-uring/src/quic/noq/endpoint.rs +++ b/rs/moq-uring/src/quic/noq/endpoint.rs @@ -1,6 +1,6 @@ //! The noq endpoint: one socket, many noq-proto connections. //! -//! noq-proto's own [`noq_proto::Endpoint`] is the routing table: it parses +//! noq-proto's own [`moq_noq_proto::Endpoint`] is the routing table: it parses //! each datagram, hands it to the connection its destination id names, mints //! and retires ids as peers consume them, and answers an unsupported version //! itself. What is left for us is the socket, the accept backlog, and a driver @@ -17,7 +17,7 @@ use std::task::Poll; use std::time::Instant; use bytes::BytesMut; -use noq_proto::{ConnectionHandle, DatagramEvent, Incoming, Transmit}; +use moq_noq_proto::{ConnectionHandle, DatagramEvent, Incoming, Transmit}; use rustc_hash::FxHashMap; use super::super::{Error, endpoint::Config}; @@ -41,7 +41,7 @@ pub(crate) struct Inner { socket: Rc, local: SocketAddr, /// The routing table, and the server configuration it accepts with. - endpoint: RefCell, + endpoint: RefCell, accepting: RefCell>, /// Every live connection, looked up per received datagram. /// @@ -99,7 +99,7 @@ impl Endpoint { let accepting = server.is_some().then(|| Accepting { queue: VecDeque::new() }); // MTU discovery is off (the GSO pool sends fixed SEGMENT datagrams), // so the endpoint has no reason to allow it either. - let endpoint = noq_proto::Endpoint::new(super::endpoint_config(socket.shard())?, server, false); + let endpoint = moq_noq_proto::Endpoint::new(super::endpoint_config(socket.shard())?, server, false); let inner = Rc::new(Inner { owner, @@ -395,7 +395,7 @@ impl Inner { } /// Register `conn`, spawn its driver, and arrange its teardown. - fn launch(self: &Rc, key: ConnectionHandle, conn: noq_proto::Connection) -> connection::Shared { + fn launch(self: &Rc, key: ConnectionHandle, conn: moq_noq_proto::Connection) -> connection::Shared { let (shared, driver) = connection::launch(&self.owner, self.socket.clone(), Rc::downgrade(self), key, conn); self.conns.borrow_mut().insert(key, shared.clone()); @@ -412,8 +412,8 @@ impl Inner { pub(crate) fn on_connection_event( &self, key: ConnectionHandle, - event: noq_proto::EndpointEvent, - ) -> Option { + event: moq_noq_proto::EndpointEvent, + ) -> Option { self.endpoint.borrow_mut().handle_event(key, event) } diff --git a/rs/moq-uring/src/quic/noq/mod.rs b/rs/moq-uring/src/quic/noq/mod.rs index 70cfcefe6d5..d950f4bcbb1 100644 --- a/rs/moq-uring/src/quic/noq/mod.rs +++ b/rs/moq-uring/src/quic/noq/mod.rs @@ -3,7 +3,7 @@ //! TLS goes through rustls, which is what the rest of this workspace speaks, //! so a build selecting this backend links one TLS stack instead of two. //! -//! [`noq_proto::Endpoint`] holds +//! [`moq_noq_proto::Endpoint`] holds //! the connection-id routing table, mints and retires ids, answers unsupported //! versions, and buffers half-open handshakes. So [`Endpoint`] here is mostly //! the socket plumbing around it, and the parts that are ours (the accept @@ -21,7 +21,7 @@ pub(crate) use connection::{End, Shared}; use std::sync::Arc; -use noq_proto::crypto::rustls::{QuicClientConfig, QuicServerConfig}; +use moq_noq_proto::crypto::rustls::{QuicClientConfig, QuicServerConfig}; use rustls::pki_types::pem::PemObject; use rustls::pki_types::{CertificateDer, PrivateKeyDer}; @@ -37,25 +37,25 @@ const CONNECTION_WINDOW: u32 = 16 * 1024 * 1024; /// How many datagrams to buffer in each direction. const DATAGRAM_WINDOW: usize = 64 * SEGMENT; -fn ecn_to_noq(ecn: udp::Ecn) -> noq_proto::EcnCodepoint { +fn ecn_to_noq(ecn: udp::Ecn) -> moq_noq_proto::EcnCodepoint { match ecn { - udp::Ecn::Ect0 => noq_proto::EcnCodepoint::Ect0, - udp::Ecn::Ect1 => noq_proto::EcnCodepoint::Ect1, - udp::Ecn::Ce => noq_proto::EcnCodepoint::Ce, + udp::Ecn::Ect0 => moq_noq_proto::EcnCodepoint::Ect0, + udp::Ecn::Ect1 => moq_noq_proto::EcnCodepoint::Ect1, + udp::Ecn::Ce => moq_noq_proto::EcnCodepoint::Ce, } } -fn ecn_from_noq(ecn: noq_proto::EcnCodepoint) -> udp::Ecn { +fn ecn_from_noq(ecn: moq_noq_proto::EcnCodepoint) -> udp::Ecn { match ecn { - noq_proto::EcnCodepoint::Ect0 => udp::Ecn::Ect0, - noq_proto::EcnCodepoint::Ect1 => udp::Ecn::Ect1, - noq_proto::EcnCodepoint::Ce => udp::Ecn::Ce, + moq_noq_proto::EcnCodepoint::Ect0 => udp::Ecn::Ect0, + moq_noq_proto::EcnCodepoint::Ect1 => udp::Ecn::Ect1, + moq_noq_proto::EcnCodepoint::Ce => udp::Ecn::Ce, } } -impl From for Error { - fn from(err: noq_proto::ConnectionError) -> Self { - use noq_proto::ConnectionError; +impl From for Error { + fn from(err: moq_noq_proto::ConnectionError) -> Self { + use moq_noq_proto::ConnectionError; match err { ConnectionError::ApplicationClosed(close) => Self::App { code: close.error_code.into_inner(), @@ -91,8 +91,10 @@ fn provider() -> Arc { /// The endpoint-wide configuration: how connection ids are minted, and the /// largest datagram we tell peers we can receive. -pub(crate) fn endpoint_config(shard: Option) -> Result, Error> { - let mut config = noq_proto::EndpointConfig::default(); +pub(crate) fn endpoint_config( + shard: Option, +) -> Result, Error> { + let mut config = moq_noq_proto::EndpointConfig::default(); config.cid_generator(Arc::new(move || Box::new(Cids { shard }))); config .max_udp_payload_size(SEGMENT as u16) @@ -110,9 +112,9 @@ struct Cids { shard: Option, } -impl noq_proto::ConnectionIdGenerator for Cids { - fn generate_cid(&mut self) -> noq_proto::ConnectionId { - noq_proto::ConnectionId::new(&super::endpoint::cid(self.shard)) +impl moq_noq_proto::ConnectionIdGenerator for Cids { + fn generate_cid(&mut self) -> moq_noq_proto::ConnectionId { + moq_noq_proto::ConnectionId::new(&super::endpoint::cid(self.shard)) } fn cid_len(&self) -> usize { @@ -125,7 +127,7 @@ impl noq_proto::ConnectionIdGenerator for Cids { } /// Dial as `config` says. -pub(crate) fn client_config(config: &client::Config) -> Result { +pub(crate) fn client_config(config: &client::Config) -> Result { let provider = provider(); let builder = rustls::ClientConfig::builder_with_provider(provider.clone()) .with_protocol_versions(&[&rustls::version::TLS13]) @@ -168,7 +170,7 @@ pub(crate) fn client_config(config: &client::Config) -> Result Result Result { +pub(crate) fn server_config(config: &server::Config) -> Result { config.check()?; let provider = provider(); let builder = rustls::ServerConfig::builder_with_provider(provider.clone()) @@ -207,7 +209,7 @@ pub(crate) fn server_config(config: &server::Config) -> Result Result noq_proto::TransportConfig { +fn with_qlog(mut transport: moq_noq_proto::TransportConfig, config: &Transport) -> moq_noq_proto::TransportConfig { let Some(sink) = config.qlog.clone() else { return transport; }; @@ -238,32 +240,32 @@ struct Traces { } #[cfg(feature = "qlog")] -impl noq_proto::QlogFactory for Traces { +impl moq_noq_proto::QlogFactory for Traces { fn for_connection( &self, - side: noq_proto::Side, + side: moq_noq_proto::Side, _remote: std::net::SocketAddr, - initial_dst_cid: noq_proto::ConnectionId, + initial_dst_cid: moq_noq_proto::ConnectionId, _now: std::time::Instant, - ) -> Option { + ) -> Option { let side = match side { - noq_proto::Side::Client => qlog::Side::Client, - noq_proto::Side::Server => qlog::Side::Server, + moq_noq_proto::Side::Client => qlog::Side::Client, + moq_noq_proto::Side::Server => qlog::Side::Server, }; - Some(noq_proto::QlogConfig::new(self.sink.trace(&initial_dst_cid, side))) + Some(moq_noq_proto::QlogConfig::new(self.sink.trace(&initial_dst_cid, side))) } } /// The per-connection knobs both roles share. -fn transport_config(config: &Transport) -> Result { - use noq_proto::VarInt; +fn transport_config(config: &Transport) -> Result { + use moq_noq_proto::VarInt; - let idle = noq_proto::IdleTimeout::try_from(config.idle_timeout) + let idle = moq_noq_proto::IdleTimeout::try_from(config.idle_timeout) .map_err(|_| Error::Quic(format!("idle timeout out of range: {:?}", config.idle_timeout)))?; let streams = VarInt::from_u64(config.max_streams) .map_err(|_| Error::Quic(format!("stream limit out of range: {}", config.max_streams)))?; - let mut transport = noq_proto::TransportConfig::default(); + let mut transport = moq_noq_proto::TransportConfig::default(); transport.max_idle_timeout(Some(idle)); transport.keep_alive_interval(config.keep_alive); transport.max_concurrent_bidi_streams(streams); @@ -279,9 +281,9 @@ fn transport_config(config: &Transport) -> Result Arc::new(noq_proto::congestion::CubicConfig::default()) - as Arc, - Congestion::Delay => Arc::new(noq_proto::congestion::Bbr3Config::default()), + Congestion::Loss => Arc::new(moq_noq_proto::congestion::CubicConfig::default()) + as Arc, + Congestion::Delay => Arc::new(moq_noq_proto::congestion::Bbr3Config::default()), }); Ok(transport) } diff --git a/rs/moq-uring/src/quic/noq/stream.rs b/rs/moq-uring/src/quic/noq/stream.rs index cf662d079b9..0c6802fa2c7 100644 --- a/rs/moq-uring/src/quic/noq/stream.rs +++ b/rs/moq-uring/src/quic/noq/stream.rs @@ -8,7 +8,7 @@ use std::task::{Context, Poll}; use bytes::{Buf, Bytes, BytesMut}; -use noq_proto::{StreamId, VarInt}; +use moq_noq_proto::{StreamId, VarInt}; use super::super::Error; use super::{End, Shared}; @@ -107,12 +107,12 @@ impl web_transport_trait::poll::SendStream for SendStream { } // No capacity right now; the driver wakes us when noq reports // the stream writable. - Err(noq_proto::WriteError::Blocked) => { + Err(moq_noq_proto::WriteError::Blocked) => { self.shared.park_writable(self.id, waiter); Poll::Pending } - Err(noq_proto::WriteError::Stopped(code)) => Poll::Ready(Err(Error::Stop(code.into_inner()))), - Err(noq_proto::WriteError::ClosedStream) => { + Err(moq_noq_proto::WriteError::Stopped(code)) => Poll::Ready(Err(Error::Stop(code.into_inner()))), + Err(moq_noq_proto::WriteError::ClosedStream) => { Poll::Ready(Err(Error::Quic("stream already finished".to_string()))) } } @@ -138,12 +138,12 @@ impl web_transport_trait::poll::SendStream for SendStream { // A STOP_SENDING beat us here. Carry the code like `poll_write` // does, or `moq_net::Error::from_transport` cannot decode a // routine cancellation. - Err(noq_proto::FinishError::Stopped(code)) => { + Err(moq_noq_proto::FinishError::Stopped(code)) => { self.reset = true; return Err(Error::Stop(code.into_inner())); } // Already finished or reset, so the FIN it wanted is out. - Err(noq_proto::FinishError::ClosedStream) => {} + Err(moq_noq_proto::FinishError::ClosedStream) => {} } self.fin = true; self.shared.kick(); @@ -284,8 +284,8 @@ impl RecvStream { let read = match chunks.next(max) { Ok(Some(chunk)) => Read::Chunk(chunk.bytes), Ok(None) => Read::Finished, - Err(noq_proto::ReadError::Blocked) => Read::Blocked, - Err(noq_proto::ReadError::Reset(code)) => Read::Reset(code.into_inner()), + Err(moq_noq_proto::ReadError::Blocked) => Read::Blocked, + Err(moq_noq_proto::ReadError::Reset(code)) => Read::Reset(code.into_inner()), }; let transmit = chunks.finalize().should_transmit(); drop(conn); diff --git a/rs/moq-uring/tests/echo.rs b/rs/moq-uring/tests/echo.rs index 3f2197fdad0..c580adb0418 100644 --- a/rs/moq-uring/tests/echo.rs +++ b/rs/moq-uring/tests/echo.rs @@ -54,7 +54,7 @@ fn echo_noq_peer() { let certs = support::certs().expect("certificates"); let mut server = quic::server::Config::new(quic::Identity::open(&certs.cert, &certs.key).expect("identity")); - server.alpn = vec![web_transport_noq::ALPN.to_string()]; + server.alpn = vec![web_transport_moq::ALPN.to_string()]; let socket = handle .udp(UdpSocket::bind("127.0.0.1:0").expect("bind"), udp::Config::default()) .expect("socket"); @@ -71,11 +71,11 @@ fn echo_noq_peer() { .build() .expect("runtime"); runtime.block_on(async move { - let client = web_transport_noq::ClientBuilder::new() + let client = web_transport_moq::ClientBuilder::new() .dangerous() .with_no_certificate_verification() .expect("client"); - let request = web_transport_noq::proto::ConnectRequest::new( + let request = web_transport_moq::proto::ConnectRequest::new( url::Url::parse(&format!("https://{addr}/echo")).expect("url"), ); let session = client.connect(request).await.expect("connect"); diff --git a/rs/moq-uring/tests/endpoint.rs b/rs/moq-uring/tests/endpoint.rs index 155f268c863..a1bdb1fb49f 100644 --- a/rs/moq-uring/tests/endpoint.rs +++ b/rs/moq-uring/tests/endpoint.rs @@ -240,7 +240,7 @@ fn unsupported_version_is_negotiated_only_by_servers() { assert!( versions .iter() - .any(|version| noq_proto::DEFAULT_SUPPORTED_VERSIONS.contains(version)), + .any(|version| moq_noq_proto::DEFAULT_SUPPORTED_VERSIONS.contains(version)), "the supported version is offered: {versions:?}" ); drop((endpoint, dial_only)); diff --git a/rs/moq-uring/tests/web.rs b/rs/moq-uring/tests/web.rs index 6b9e357ae1c..d74b6d04d63 100644 --- a/rs/moq-uring/tests/web.rs +++ b/rs/moq-uring/tests/web.rs @@ -1,4 +1,4 @@ -//! WebTransport interop: the reference tokio stack (`web-transport-noq`, +//! WebTransport interop: the reference tokio stack (`web-transport-moq`, //! what browsers interop with) dials the uring server. One test hand-drives //! streams and datagrams through the H3 framing; the other runs a whole //! moq-lite session over it, which is exactly the browser-to-relay path. @@ -47,7 +47,7 @@ fn h3_endpoint(handle: &moq_uring::Handle, certs: &support::Certs) -> quic::Endp /// The tokio-side client, in its own runtime on its own thread. fn noq_client( url: String, - body: impl FnOnce(web_transport_noq::Session) -> ClientFuture + Send + 'static, + body: impl FnOnce(web_transport_moq::Session) -> ClientFuture + Send + 'static, ) -> std::thread::JoinHandle<()> { std::thread::spawn(move || { // May already be installed by a sibling test; either way one exists. @@ -57,12 +57,12 @@ fn noq_client( .build() .expect("tokio runtime"); rt.block_on(async move { - let client = web_transport_noq::ClientBuilder::new() + let client = web_transport_moq::ClientBuilder::new() .dangerous() .with_no_certificate_verification() .expect("client"); let request = - web_transport_noq::proto::ConnectRequest::new(url::Url::parse(&url).expect("url")).with_protocol(PROTO); + web_transport_moq::proto::ConnectRequest::new(url::Url::parse(&url).expect("url")).with_protocol(PROTO); let session = client.connect(request).await.expect("connect"); body(session).await; }); @@ -72,7 +72,7 @@ fn noq_client( type ClientFuture = std::pin::Pin + Send>>; /// Read a noq-side stream to its end. -async fn read_all(recv: &mut web_transport_noq::RecvStream) -> Vec { +async fn read_all(recv: &mut web_transport_moq::RecvStream) -> Vec { let mut out = Vec::new(); let mut buf = [0u8; 4096]; while let Some(n) = recv.read(&mut buf).await.expect("read") { @@ -322,7 +322,7 @@ async fn within(handle: &moq_uring::Handle, what: &str, future: impl Future std::thread::JoinHandle { +fn noq_client_err(url: String) -> std::thread::JoinHandle { std::thread::spawn(move || { let _ = rustls::crypto::aws_lc_rs::default_provider().install_default(); let rt = tokio::runtime::Builder::new_current_thread() @@ -330,12 +330,12 @@ fn noq_client_err(url: String) -> std::thread::JoinHandle break err, } }; - assert!(matches!(err, web_transport_noq::WriteError::Stopped(0)), "got {err:?}"); + assert!(matches!(err, web_transport_moq::WriteError::Stopped(0)), "got {err:?}"); session.close(CLOSE_CODE, CLOSE_REASON.as_bytes()); session.closed().await;