Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions quest/m1/3060-moq-net-ban-hop-id-0-from-hop-chains.md

This file was deleted.

2 changes: 1 addition & 1 deletion quest/m1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ with the current dev tree before starting.
- [#3208](/quest/m1/3208-make-2-5-ms-opus-frame-durations-work-across-bindings.md) - Make 2.5 ms Opus frame durations work across bindings
- [#2152](/quest/m1/2152-libmoq-c-abi-catch-up-with-the-moq-ffi-surface.md) - libmoq: C ABI catch-up with the moq-ffi surface
- [Route cold cost](/quest/m1/route-cold-cost.md) - MoqRoute carries warm and cold, so an observed route re-announces intact
- [#3060](/quest/m1/3060-moq-net-ban-hop-id-0-from-hop-chains.md) - moq-net: ban Hop ID 0 from hop chains
- [Anonymous rank](/quest/m1/anonymous-route-rank.md) - moq-net: a route through an anonymous hop ranks below every identified route at any cost, and hop 0 travels the chain to say so
- [#2248](/quest/m1/2248-moq-mux-rebase-fmp4-export-timestamps-for-late-subscribers.md) - moq-mux: rebase fMP4 export timestamps for late subscribers
- [Merge dev](/quest/m1/merge-dev.md) - dev lands on main with a closing keyword for every issue it fixed
71 changes: 71 additions & 0 deletions quest/m1/anonymous-route-rank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# [M] moq-net: an anonymous route never outranks an identified one

## Goal

A route that passes through an anonymous hop, at any depth, ranks below every
route whose hops are all identified, whatever the costs say. If Cloudflare's
relay announces broadcast A without an identity at cost 1 and a cost-5 route
through identified relays reaches the real publisher, the cost-5 route wins,
on this relay and on every relay downstream of it. Among anonymous routes,
cost keeps ordering as it does today. On dev, where the route model lives.

## Plan

Today `route_order` in `rs/moq-net/src/model/origin.rs` ranks on
`(Cost, len, hash, id)` and nothing about identity enters it. An anonymous
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
peer's announce is stamped as a one-hop route charged the link cost
(`session_route` in `rs/moq-net/src/ietf/subscriber.rs`, default 1), so it
beats any identified route costing more, and the `cold` half of
`Cost::UNKNOWN` never fires because cold only breaks a warm tie. The doc
comment on `session_route` already names the hazard and points at
`Client::with_cost` as the workaround.

Hop 0 in a chain is the mark, and it travels:

- A relay bridging an anonymous upstream writes 0 for that hop on the wire,
in lite-06 HOP_PATH and the cluster extension alike, and forwards a
received 0 unchanged. Its minted per-session id stays local: `RouteEntry`
gains `via: Hop`, the announcing session's declared or assigned id, and the
split-horizon filter in `best_route` and the advertise path matches `via`
as well as the chain, so #3042's echo fix (a route is never advertised back
to the session it came from) holds without the id ever leaving the relay.
This reverses the direction of #3060, whose quest is deleted with this one:
an assigned identity is private selection state and forwarding it published
a name for a peer that declined to give one.
- `route_order` becomes `(anonymous, Cost, len, hash, Reverse(id))`, where
`anonymous` is whether the chain holds a 0 anywhere; the rest of the key is
dev's as it stands. Main's leading `!announce` term and its `attach_source`
takeover gate do not exist on dev: every route in the table is announced,
routes for one prefix coexist, and `best_route` is the whole decision, so
arrival order cannot let an anonymous route replace an identified one.
Lite-03 hop-count placeholders are 0 entries and count as anonymous, which
is what they are. `Route` exposes `is_anonymous()` for the bindings and the
announcement stream.
- `js/net` keeps accepting 0 inside a received chain and exposes `anonymous`
on the announcement it yields; it ranks nothing today, and the browser hop
of the P2P questline, which lives on dev, forwards 0 like a relay when it
lands.
`doc/concept/transport.md` states the selection rule beside route cost.
- Loop detection is unchanged: a 0 entry matches nothing, and a relay's own
id still appears in the chain wherever it forwarded the route.
- Drafts: `drafts/draft-lcurley-moq-cluster.md` "Assigned Identities" says
the assigned id is local selection state that MUST NOT be forwarded, and
"Bridging" writes 0 for an upstream that sent no HOP_PATH; the selection
rule prefers a HOP_PATH with no 0 entry before comparing ROUTE_COST.
`drafts/draft-lcurley-moq-lite.md` mirrors both for lite-06. Validate with
`just drafts check`.
Comment thread
kixelated marked this conversation as resolved.
Resolved
- Tests: an anonymous cost-1 route loses to an identified cost-5 route; two
anonymous routes order by cost; a chain `[0, R1]` received from identified
peer R1 loses to `[P, R2]` at a higher cost; a relay forwards `[0, R1]` with
Comment thread
kixelated marked this conversation as resolved.
Resolved
the 0 intact and never advertises the route back to the session it came
from; `anonymous_routes_never_resume` and the #3042 filter tests keep
passing. Run `just test smoke-full`, since the interop relays are anonymous.

## Related

- [Rank](/quest/m2/pop-skipping/rank.md) - warm-copy adoption, which also
refuses to treat two anonymous relays as one
- [Route cold cost](/quest/m1/route-cold-cost.md) - the cost pair the bindings
carry, which `is_anonymous()` joins
- [#3060](https://github.com/moq-dev/moq/issues/3060) - the ban on hop 0 in
chains this quest decides against
3 changes: 3 additions & 0 deletions quest/m2/auth-api/mtls-identity.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ scope, because the root is the path the client dialed.
grows `name()` beside `expiry()` and `fingerprint()`, parsed with the
`x509-parser` it already uses. The docs say the identity is a value the
endpoint matches, never proof by itself; the CA that signed the chain is.
Several CA-valid certificates may carry one name, by renewal or by design,
so the name keys an entitlement, never a certificate, and a deployment that
needs one grant per certificate enforces name uniqueness at its CA.
This replaces the documented `mtls=true`, and an endpoint that compares
the literal breaks for every mTLS peer, cluster peers included, until it
accepts any non-empty value. The auth API section of `doc/bin/relay/auth.md`
Expand Down
4 changes: 3 additions & 1 deletion quest/m2/auth-api/revalidation-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ and meters, so rebuilding a local handle would retag nothing.
`no-store`, or a value the relay cannot parse) is the endpoint opting out,
and stays so. The relay says it once: the first such reply from an endpoint
logs at WARN that sessions admitted under it are never re-checked and end
only at their credential's `exp`. One line per relay, never per session.
only when their credential expires, `exp` for a JWT and `notAfter` for a
certificate, or never for an anonymous session, and the line says which.
One line per relay, never per session.
- Docs: the revalidation section of `doc/bin/relay/auth.md` gains a per-field
table: tier updates in place, alias closes, and scope narrowing closes today
(`covered_by` failing maps to `Recheck::Revoked`) and resizes once
Expand Down
7 changes: 5 additions & 2 deletions quest/m2/qos/stats/encoder-feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ prefix. Keyframe requests stay out.
prefix, keeps one `moq_stats::Consumer<hang::Stats>` per `.stats` broadcast
requesting `<own path>/subscriber.json`, and folds the reports into one
signal, the share of viewers stalled over the last interval and their late
frame rate, weighted equally per viewer. Viewers that stop reporting age out
on the stats interval.
frame rate, weighted equally per viewer. The counters are cumulative, so
the handle keeps the previous snapshot per viewer and diffs it; a counter
that goes backwards is a restarted viewer and resets that baseline. Viewers
that stop reporting age out on the stats interval, so one stall long ago
never lowers the target forever.
- `rate.rs` takes that signal beside the bandwidth estimate: a stalled share
above a threshold steps the target down like a bandwidth drop, recovery
follows the existing attack curve, and the estimate stays the ceiling.
Expand Down
5 changes: 4 additions & 1 deletion quest/m2/qos/stats/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ what a subscriber received and played, per audio and video. The relay is
public with the `Copy` bound dropped; `Traffic` and `Presence` implement it
as they do today. A frame is `BTreeMap<String, Stats<E>>`, where `Stats<E>`
is `Traffic` with `E` flattened beside it; `TrafficFrame` becomes that
alias for `()`.
alias for `()`. `sessions.json` stays a core track outside the extension:
`[<tier>/]sessions.json[.z]`, a `BTreeMap<String, Presence>` keyed by auth
root, read through `Consumer::sessions` whatever `E` is; a client publishes
it only when it holds sessions worth counting.
- An exact-path mode. `ProducerConfig` treats its path as a prefix and
advertises `<prefix>/node[/<node>]`, so a client asking for
`room/alice.stats` would publish `room/alice.stats/node`, which no longer
Expand Down
Loading