Repository navigation
docs(quest): rank anonymous routes last and abandon the hop-0 ban #3623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e04790e
docs(quest): rank anonymous routes last and abandon the hop-0 ban
kixelated a2a61f6
docs(quest): fold the second review round on #3619 into the plans
kixelated 3e675e6
docs(quest): an mTLS name keys an entitlement, never a certificate
kixelated b6656d9
docs(quest): pin the anonymous rank key to dev and add the js/net and…
kixelated 4b7f2ec
docs(quest): the P2P questline exists only on dev, so name it instead…
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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`. | ||
|
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 | ||
|
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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.