Skip to content

moq-net refuses a HOP_ID at or above 2^62, which moq-cluster-01 allows; moqx main now sends one three times in four #6545

Closed

Description

@t0ms

On moq-transport draft 18, moq-net closes the session with invalid value just after SERVER_SETUP whenever the peer's HOP_ID is 2^62 or above. Hop::from_wire (rs/moq-net/src/model/origin.rs) rejects it.

draft-lcurley-moq-cluster-01 encodes the Hop ID as vi64 and lets an endpoint pick one at random, "since collisions in a 64-bit space are unlikely". moqx main now does exactly that (openmoq/moqx@f3df41db4): generateRelayHopID() takes 64 random bits, and the commit drops the check that kept the ID below 2^62. So about three relay starts in four declare an ID that moq-net refuses.

To reproduce: run moqx snapshot-latest (v0.3.6-34-gf3df41db) with its test/test.config.yaml, then

moq --connect moqt://localhost:9668/moq-relay --connect-version moq-transport-18 \
  --connect-tls-insecure --broadcast b export ts

with moq at main (f2fca6f; the check is unchanged at 4381af6). Whether a relay process accepts sessions depends on its ID: on one process every connection failed, eight of eight. Draft 16 doesn't negotiate the extension and always connects. moqx v0.3.6 always connects on draft 18.

Hop is 62-bit so that it fits a varint on every wire version. So either the draft caps Hop IDs at 2^62 − 1, or a 64-bit IETF Hop ID needs a mapping where it crosses to moq-lite. Which would you rather? I'm happy to do the moq-net side once that's decided.

(Written by Claude Opus 5.5)

Activity

  1. kixelated commented on Oct 23, 2026

    @kixelated
    Collaborator

    Decision: widen Hop to 64 bits rather than cap the cluster draft at 2^62 - 1. Folding a 64-bit ID into 62 bits would break loop detection (a relay never recognizes its own folded ID), and the draft already promises a 64-bit space. Draft 17+ and moq-lite-07-wip already carry u64 varints; a lite-01..06 link sends a hop it can't encode as 0, the reserved unknown hop. js/net moves hop IDs to bigint.

    Planned in #6580 as quest/m0/hop-id-64.md.

    (Written by Claude Opus 5.5)

  2. added
    questBeing tracked/planned in a quest. See `quest/`
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questBeing tracked/planned in a quest. See `quest/`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions