Skip to content

Add telescoping Subscriber Count to moq-lite and a moq-transport extension#31

Open
kixelated wants to merge 4 commits into
mainfrom
claude/serene-golick-e3445c
Open

Add telescoping Subscriber Count to moq-lite and a moq-transport extension#31
kixelated wants to merge 4 commits into
mainfrom
claude/serene-golick-e3445c

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

Adds a telescoping subscriber (viewer) count to subscriptions, in two places:

  1. moq-lite (draft-lcurley-moq-lite.md) — a new Subscriber Count field on SUBSCRIBE and SUBSCRIBE_UPDATE.
  2. A new moq-transport extension (draft-lcurley-moq-subscriber-count.md) — the same functionality expressed as a standalone extension I-D against draft-ietf-moq-transport.

The count lets a publisher learn its total downstream audience across any number of relay hops. It is a subscriber property that fans in at relays: a relay sums the counts of the downstream subscriptions it aggregates into one upstream subscription, so the value telescopes up the fan-out tree for free. This is a spec adaptation of moq-dev/moq#1672.

moq-lite change

  • Subscriber Count field on SUBSCRIBE / SUBSCRIBE_UPDATE, slotting into the existing subscriber-property (fan-in) model already described in the draft.
  • Encoded as count - 1 (a leaf sends 0); a relay sums downstream counts and forwards the sum, refreshed via SUBSCRIBE_UPDATE.
  • Relays SHOULD rate-limit count-only updates to absorb subscriber churn.
  • Changelog entry under moq-lite-05.

moq-transport extension (new draft)

Re-expressed in moq-transport's idiom rather than copied:

  • Carried as an optional Key-Value-Pair parameter (even Type 0xC0116 → single varint, no length) on SUBSCRIBE and REQUEST_UPDATE.
  • Negotiated per hop via a SUBSCRIBER_COUNT Setup Option (0xC0117); un-negotiated counts are ignored, not errors.
  • Same count - 1 encoding as moq-lite: absent or 0 on the wire both decode to 1, making a count of 0 impossible to represent — a subscription can never report fewer subscribers than itself.
  • Real Security/Privacy Considerations: per-hop opt-out for sensitive audience sizes; the value is subscriber-supplied and untrusted (MUST NOT drive billing/admission/rate-limiting without verification); churn amplification bounded by the rate-limit.
  • IANA registrations for the Setup Option and Message Parameter, following the codepoint conventions used by the existing moq-probe / moq-largest-group drafts.

Reviewer notes

  • Both drafts build clean (kramdown-rfc + xml2rfc-txt OK).
  • The extension targets draft-18, where the update message is REQUEST_UPDATE and the registry is "Message Parameters" (§15.7). Section references were pulled from the draft text and are worth eyeballing against a local copy before submission, since they renumber between revisions.

🤖 Generated with Claude Code

kixelated and others added 2 commits June 9, 2026 15:11
Add a Subscriber Count field to SUBSCRIBE and SUBSCRIBE_UPDATE: a
fan-in subscriber property encoding the number of downstream
subscribers a subscription represents. Encoded as count-minus-one
(a leaf sends 0); a relay sums the counts of the downstream
subscriptions it merges, so the value telescopes up the fan-out tree
and a publisher reads its total audience from its single upstream
subscription. Relays SHOULD rate-limit count-only updates to absorb
subscriber churn.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Define a Subscriber Count parameter for moq-transport: an optional,
even-typed Key-Value-Pair on SUBSCRIBE and REQUEST_UPDATE carrying the
number of subscribers a subscription represents, encoded as count - 1
(a leaf, and an absent parameter, decode to 1). The count - 1 encoding
makes a count of 0 impossible to represent: a subscription can never
report fewer subscribers than itself. A relay sums the counts of the
downstream subscriptions it aggregates and forwards the sum upstream,
so the value telescopes up the fan-out tree and the origin learns its
total audience across any number of hops. Negotiated per hop via a
SUBSCRIBER_COUNT Setup Option; rate-limited and treated as untrusted
advisory telemetry.

This is the moq-transport-extension counterpart to the Subscriber
Count field added to moq-lite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kixelated, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 51 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cec6525d-b8bf-4c9b-a5a0-95c56ed5419d

📥 Commits

Reviewing files that changed from the base of the PR and between 80308a3 and b40032c.

📒 Files selected for processing (2)
  • draft-lcurley-moq-lite.md
  • draft-lcurley-moq-subscribe-stats.md
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/serene-golick-e3445c

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

kixelated and others added 2 commits June 9, 2026 20:19
Restructure the moq-transport extension from a Message Parameter on
SUBSCRIBE/REQUEST_UPDATE to a dedicated SUBSCRIBER_COUNT control
message on the subscription's request stream.

In moq-transport a REQUEST_UPDATE consumes a Request ID (Section 10.1)
and obliges the receiver to answer with REQUEST_OK/REQUEST_ERROR
(Section 10.9). Refreshing a once-per-second telemetry value through
it would be a request/response transaction whose stated purpose is to
modify the subscription -- a poor fit. The dedicated message rides the
existing request stream, consumes no Request ID, and elicits no
response. (Request ID exhaustion is not the concern: MAX_REQUEST_ID /
REQUESTS_BLOCKED were removed in -18.)

The asymmetry with moq-lite is deliberate: moq-lite's SUBSCRIBE_UPDATE
is already fire-and-forget (no response, no ID), so the field-based
design there is fine and is unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the telescoping subscriber count out of the subscription's update
path into a dedicated SUBSCRIBE_STATS telemetry message, named
generically so further cheaply-aggregatable stats can be added later.

moq-lite: SUBSCRIBE_UPDATE re-echoes all five subscription parameters
on every send, so bumping a counter through it is wasteful. Carry the
count in a separate SUBSCRIBE_STATS message instead. This introduces a
Type tag on the subscriber's post-SUBSCRIBE messages (0x0
SUBSCRIBE_UPDATE, 0x1 SUBSCRIBE_STATS) to distinguish them, mirroring
the publisher's already-typed responses; the count field is removed
from SUBSCRIBE and SUBSCRIBE_UPDATE.

moq-transport: rename the SUBSCRIBER_COUNT message to SUBSCRIBE_STATS
and make its body a list of stats encoded as Message Parameters, so
new stats are added without a new message type or a wire break.
Subscriber Count becomes one such parameter (even type, count - 1).
Draft renamed to draft-lcurley-moq-subscribe-stats.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant