Add telescoping Subscriber Count to moq-lite and a moq-transport extension#31
Add telescoping Subscriber Count to moq-lite and a moq-transport extension#31kixelated wants to merge 4 commits into
Conversation
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>
|
Warning Review limit reached
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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches✨ Simplify code
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. Comment |
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>
Summary
Adds a telescoping subscriber (viewer) count to subscriptions, in two places:
draft-lcurley-moq-lite.md) — a newSubscriber Countfield on SUBSCRIBE and SUBSCRIBE_UPDATE.draft-lcurley-moq-subscriber-count.md) — the same functionality expressed as a standalone extension I-D againstdraft-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 Countfield on SUBSCRIBE / SUBSCRIBE_UPDATE, slotting into the existing subscriber-property (fan-in) model already described in the draft.count - 1(a leaf sends0); a relay sums downstream counts and forwards the sum, refreshed via SUBSCRIBE_UPDATE.moq-transport extension (new draft)
Re-expressed in moq-transport's idiom rather than copied:
0xC0116→ single varint, no length) on SUBSCRIBE and REQUEST_UPDATE.SUBSCRIBER_COUNTSetup Option (0xC0117); un-negotiated counts are ignored, not errors.count - 1encoding as moq-lite: absent or0on the wire both decode to1, making a count of0impossible to represent — a subscription can never report fewer subscribers than itself.Reviewer notes
kramdown-rfc+xml2rfc-txtOK).REQUEST_UPDATEand 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