Skip to content

Commit 2751bb0

Browse files
Add the ANNOUNCE_INIT message. (#10)
* Add the ANNOUNCE_INIT message. * Fix typos and improve ANNOUNCE_INIT specification - Fix grammar errors: ''recieved'' → ''received'', improve sentence clarity - Clarify ''toggle status'' as ''alternate between status values'' - Add guidance to prevent duplicate suffixes in ANNOUNCE_INIT - Add implementation guidance for resource limits Co-authored-by: kixelated <kixelated@users.noreply.github.com> * Strengthen ANNOUNCE_INIT duplicate suffix requirement and simplify status alternation sentence - Change ''SHOULD NOT'' to ''MUST NOT'' for duplicate suffixes in ANNOUNCE_INIT - Remove design justification from status alternation requirement for clarity Co-authored-by: kixelated <kixelated@users.noreply.github.com> --------- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent e422d66 commit 2751bb0

1 file changed

Lines changed: 51 additions & 10 deletions

File tree

draft-lcurley-moq-lite.md

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ informative:
2323

2424
--- abstract
2525

26-
Moq-Lite is designed to fanout live content from publishers to any number of subscribers across the internet.
26+
moq-lite is designed to fanout live content from publishers to any number of subscribers across the internet.
2727
Liveliness is achieved by using QUIC to prioritize the most important content, potentially starving or dropping other content, to avoid head-of-line blocking while respecting encoding dependencies.
2828
While designed for media, it is an agnostic transport, allowing relays and CDNs to forward content without knowledge of codecs, containers, or encryption keys.
2929

@@ -193,26 +193,31 @@ Otherwise, the server replies with a SESSION_SERVER message to complete the hand
193193
Afterwards, both endpoints SHOULD send SESSION_UPDATE messages, such as after a significant change in the session bitrate.
194194

195195
This draft's version is combined with the constant `0xff0dad00`.
196-
For example, moq-lite-draft-03 is identified as `0xff0dad03`.
196+
For example, moq-lite-draft-04 is identified as `0xff0dad04`.
197197

198198

199199
### Announce
200200
A subscriber can open a Announce Stream to discover broadcasts matching a prefix.
201201
This is OPTIONAL and the application can determine track paths out-of-band.
202202

203203
The subscriber creates the stream with a ANNOUNCE_PLEASE message.
204-
The publisher replies with ANNOUNCE messages for any matching broadcasts.
204+
The publisher replies with an ANNOUNCE_INIT message containing all currently active broadcasts that currently match the prefix, followed by ANNOUNCE messages for any changes.
205+
206+
The ANNOUNCE_INIT message contains an array of all currently active broadcast paths encoded as a suffix.
207+
Each path in ANNOUNCE_INIT can be treated as if it were an ANNOUNCE message with status `active`.
208+
209+
After ANNOUNCE_INIT, the publisher sends ANNOUNCE messages for any changes also encoded as a suffix.
205210
Each ANNOUNCE message contains one of the following statuses:
206211

207212
- `active`: a matching broadcast is available.
208213
- `ended`: a previously `active` broadcast is no longer available.
209214

210-
Each broadcast starts as `ended` and MUST alternate between `active` and `ended`.
215+
Each broadcast starts as `ended` (unless included in ANNOUNCE_INIT) and MUST alternate between `active` and `ended`.
211216
The subscriber MUST reset the stream if it receives a duplicate status, such as two `active` statuses in a row or an `ended` without `active`.
212217
When the stream is closed, the subscriber MUST assume that all broadcasts are now `ended`.
213218

214219
Path prefix matching and equality is done on a byte-by-byte basis.
215-
There MAY be multiple Announce Streams, potentially containing overlapping prefixes, that get their own copy of each ANNOUNCE.
220+
There MAY be multiple Announce Streams, potentially containing overlapping prefixes, that get their own ANNOUNCE_INIT and ANNOUNCE messages.
216221

217222
## Subscribe
218223
A subscriber can open a Subscribe Stream to request a Track.
@@ -315,14 +320,45 @@ ANNOUNCE_PLEASE Message {
315320
**Broadcast Path Prefix**:
316321
Indicate interest for any broadcasts with a path that starts with this prefix.
317322

318-
The publisher MAY close the stream with an error code if the prefix is too expansive.
319-
Otherwise, the publisher SHOULD respond with an ANNOUNCE message for any matching broadcasts.
323+
The publisher MUST respond with an ANNOUNCE_INIT message containing any matching and active broadcasts, followed by ANNOUNCE messages for any updates.
324+
Implementations SHOULD consider reasonable limits on the number of matching broadcasts to prevent resource exhaustion.
325+
326+
327+
328+
## ANNOUNCE_INIT
329+
A publisher sends an ANNOUNCE_INIT message immediately after receiving an ANNOUNCE_PLEASE to communicate all currently active broadcasts that match the requested prefix.
330+
Only the suffixes are encoded on the wire, as the full path can be constructed by prepending the requested prefix.
331+
332+
This message is useful to avoid race conditions, as ANNOUNCE_INIT does not trickle in like ANNOUNCE messages.
333+
For example, an API server that wants to list the current participants could issue an ANNOUNCE_PLEASE and immediately return the ANNOUNCE_INIT response.
334+
Without ANNOUNCE_INIT, the API server would have use a timer to wait until ANNOUNCE to guess when all ANNOUNCE messages have been received.
335+
336+
~~~
337+
ANNOUNCE_INIT Message {
338+
Suffix Count (i),
339+
[
340+
Broadcast Path Suffix (s),
341+
]...
342+
}
343+
~~~
344+
345+
**Suffix Count**:
346+
The number of active broadcast path suffixes that follow.
347+
This can be 0.
348+
A publisher MUST NOT include duplicate suffixes in a single ANNOUNCE_INIT message.
349+
350+
**Broadcast Path Suffix**:
351+
Each suffix is combined with the broadcast path prefix from ANNOUNCE_PLEASE to form the full broadcast path.
352+
This includes all currently active broadcasts matching the prefix.
320353

321354

322355

323356
## ANNOUNCE
324-
A publisher sends an ANNOUNCE message to advertise a broadcast in response to an ANNOUNCE_PLEASE.
325-
Only the suffix is encoded on the wire, the full path is constructed by prepending the requested prefix.
357+
A publisher sends an ANNOUNCE message to advertise a change in broadcast availability.
358+
Only the suffix is encoded on the wire, as the full path can be constructed by prepending the requested prefix.
359+
360+
The status is relative to the ANNOUNCE_INIT and all prior ANNOUNCE messages combined.
361+
A client MUST ONLY alternate between status values (from active to ended or vice versa).
326362

327363
~~~
328364
ANNOUNCE Message {
@@ -425,8 +461,13 @@ An application specific payload.
425461
A generic library or relay MUST NOT inspect or modify the contents unless otherwise negotiated.
426462

427463

428-
429464
# Appendix A: Changelog
465+
466+
## moq-lite-01
467+
- Added ANNOUNCE_INIT.
468+
469+
470+
# Appendix B: Upstream Differences
430471
A quick comparison of moq-lite and moq-transport-10:
431472

432473
## Deleted Messages

0 commit comments

Comments
 (0)