Skip to content

Commit 8c34239

Browse files
committed
Initial draft-02 work.
1 parent 7919cfa commit 8c34239

1 file changed

Lines changed: 80 additions & 75 deletions

File tree

draft-lcurley-moq-transfork.md

Lines changed: 80 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,20 @@ This provides robust and generic one-to-many transmission, even for latency sens
7474
A Session consists of a connection between a QUIC client and server.
7575

7676
A session is established after the necessary QUIC, WebTransport, and MoqTransfork handshakes.
77-
The MoqTransfork handshake consists of version information and an optional ROLE extension, signaling if the endpoint supports only supports publishing or subscribing.
77+
The MoqTransfork handshake consists of version and extension negotiation.
7878

7979
The intent is that sessions are chained together via relays.
8080
A broadcaster could establish a session with an CDN ingest edge while the viewers establish separate sessions to CDN distribution edges.
8181
A MoqTransfork session is hop-by-hop, but the application should be designed end-to-end.
8282

8383
## Broadcast
84-
A Broadcast is a collection of tracks from a single producer, identified by a unique name within the session.
84+
A Broadcast is a collection of tracks from a single producer identified by a unique path within the session.
8585
A MoqTransfork session may be used to publish and subscribe to multiple, potentially unrelated, broadcasts.
8686

87+
A broadcast path is an a UTF-8 string which may be discovered using a prefix.
88+
Correlated broadcasts should utilize this and share a path, for example: `meeting.1234.alice` and `meeting.1234.bob`
89+
A subscriber could then discover all broadcasts starting with `meeting.1234.`
90+
8791
The application determines if tracks within a broadcast are correlated.
8892
For example, a "video" track and "audio" track could share timestamp domains.
8993
This is possible as a broadcast is created by a single publisher, avoiding the need for clock synchronization.
@@ -174,24 +178,23 @@ See the Extension section for more information.
174178

175179
## Bidirectional Streams
176180
Bidirectional streams are primarily used for control streams.
177-
178181
The first byte of each stream indicates the Stream Type.
179-
A Stream Type is created by an endpoint with the associated Role and MUST be enforced when the ROLE extension is negotiated.
180-
181-
|------|-----------|------------|
182-
| ID | Type | Role |
183-
|-----:|:----------|------------|
184-
| 0x0 | Session | Client |
185-
|------|-----------|------------|
186-
| 0x1 | Announce | Publisher |
187-
|------|-----------|------------|
188-
| 0x2 | Subscribe | Subscriber |
189-
|------|-----------|------------|
190-
| 0x3 | Fetch | Subscriber |
191-
|------|-----------|------------|
192-
| 0x4 | Info | Subscriber |
193-
|------|-----------|------------|
194182

183+
The second column in this table indicates which endpoint or role will create a stream.
184+
185+
|------|------------|------------|
186+
| ID | Type | Role |
187+
|-----:|:-----------|------------|
188+
| 0x0 | Session | Client |
189+
|------|------------|------------|
190+
| 0x1 | Announced | Subscriber |
191+
|------|------------|------------|
192+
| 0x2 | Subscribe | Subscriber |
193+
|------|------------|------------|
194+
| 0x3 | Fetch | Subscriber |
195+
|------|------------|------------|
196+
| 0x4 | Info | Subscriber |
197+
|------|------------|------------|
195198

196199
### Session
197200
The Session stream contains all messages that are session level.
@@ -203,17 +206,30 @@ Afterwards, both endpoints SHOULD send SESSION_UPDATE messages, such as after a
203206

204207
The session remains active until the Session Stream is closed or reset by either endpoint.
205208

209+
#### Versions
210+
The SESSION_CLIENT and SESSION_SERVER messages are used to negotiate versions.
211+
This draft's version is combined with the constant `0xff0bad00`.
212+
213+
For example, moq-transfork-draft-03 is identified as `0xff0bad03`.
214+
215+
A client may advertise support for multiple versions.
216+
The server chooses one of the supported versions, or errors if none of the listing versions are supported.
206217

207218
### Announce
208-
A publisher can open an Announce Stream to advertise a broadcast.
209-
This is OPTIONAL and the application can determine the broadcast name out-of-band.
219+
A subscriber can open a Announce Stream to discover broadcasts matching a prefix.
220+
This is OPTIONAL and the application can determine broadcast paths out-of-band.
210221

211-
The publisher MUST start the stream with an ANNOUNCE message.
212-
The subscriber MUST reply with an ANNOUNCE_OK message or reset the stream.
213-
The announcement is active until the stream is closed or reset by either endpoint.
222+
The subscriber MUST start the stream with a ANNOUNCE_INTEREST message.
223+
The publisher MAY reply with any number of ANNOUNCE message to indicate when a broadcast has started or stopped.
224+
Both sides may close/reset the stream at any point.
214225

215-
There is currently no expectation that a relay will forward an ANNOUNCE message downstream.
216-
A future draft may introduce a mechanism to discover broadcasts matching a prefix.
226+
The publisher SHOULD send an ANNOUNCE message for each broadcast path that matches the prefix.
227+
There MAY be multiple Announce Streams, potentially containing overlapping prefixes, that get their own copy of each ANNOUNCE.
228+
The publisher MAY choose to not ANNOUNCE matching streams, such as when they are private or the prefix is too expansive.
229+
The publisher SHOULD close the stream with an error code when this happens.
230+
231+
When a broadcast has ended, the publisher sends an ANNOUNCE message with an identical name.
232+
This will toggle the availability of the broadcast and avoids the need for a dedicated UNANNOUNCE message.
217233

218234
### Subscribe
219235
A subscriber can open a Subscribe Stream to request a named track within a broadcast.
@@ -270,9 +286,25 @@ A future version of this draft may utilize reliable reset instead.
270286
# Encoding
271287
This section covers the encoding of each message.
272288

273-
Note that these message do not contain a type identifier.
289+
Note that these message do not currently contain a type identifier.
274290
The message type is determined by the stream type and the current state.
275291

292+
## Types
293+
Unless otherwise indicated, all types are big-endian (network order).
294+
295+
`(i)`:
296+
A QUIC VarInt with a maximum size of 62-bits.
297+
The highest two bits in the first byte indicate the total size; 1 bytes, 2 bytes, 4 bytes or 8 bytes.
298+
This value is unsigned unless otherwise indicated.
299+
300+
`(b)`:
301+
VarInt size followed by that many indicated bytes.
302+
303+
`(s)`:
304+
A VarInt size followed by that many indicated bytes.
305+
The bytes MUST be a valid UTF-8 string.
306+
307+
276308
## SESSION_CLIENT
277309
The client advertises supported versions and any extensions.
278310

@@ -316,30 +348,33 @@ This SHOULD be sourced directly from the QUIC congestion controller.
316348
A value of 0 indicates that this information is not available.
317349

318350

319-
## ANNOUNCE
320-
A publisher sends an ANNOUNCE message to advertise a broadcast.
351+
## ANNOUNCE_INTEREST
352+
A subscriber sends an ANNOUNCE_INTEREST message to indicate it wants any cooresponding ANNOUNCE messages.
321353

322354
~~~
323-
ANNOUNCE Message {
324-
Broadcast Name (b),
355+
ANNOUNCE_INTEREST Message {
356+
Broadcast Prefix (s),
325357
}
326358
~~~
327359

328-
**Broadcast Name**:
329-
The name of the broadcast.
330-
A zero-sized name is valid but not recommended.
360+
**Broadcast Prefix**:
361+
Indicate interest for any broadcasts that start with this prefix.
362+
The publisher SHOULD reply with an ANNOUNCE message for any matching broadcasts.
331363

332364

333-
## ANNOUNCE_OK
334-
A subscriber replies to an ANNOUNCE with an ANNOUNCE_OK message.
365+
## ANNOUNCE
366+
A publisher sends an ANNOUNCE message to advertise a broadcast.
335367

336368
~~~
337-
ANNOUNCE_OK Message {
338-
Cool = 0x1
369+
ANNOUNCE Message {
370+
Broadcast Path (s),
339371
}
340372
~~~
341373

342-
This message is a single byte long (😎).
374+
**Broadcast Path**
375+
The broadcast path.
376+
This MUST start with the requested prefix.
377+
343378

344379
## SUBSCRIBE
345380
SUBSCRIBE is sent by a subscriber to start a subscription.
@@ -542,7 +577,8 @@ An error code indicated by the application.
542577

543578

544579
## FRAME
545-
The FRAME message consists of a length followed by that many bytes.
580+
The FRAME message is a payload at a specific point of time.
581+
546582

547583
~~~
548584
FRAME Message {
@@ -555,46 +591,15 @@ An application specific payload.
555591
A generic library or relay MUST NOT inspect or modify the contents unless otherwise negotiated.
556592

557593

558-
# Extensions
559-
SESSION_CLIENT and SESSION_SERVER have a flexible encoding to facilitate extension negotiation without causing breaking changes.
560-
561-
This draft registers some extensions and reserves any IDs smaller than 64 for future drafts.
562-
Other documents MAY introduce additional extensions.
563-
564-
|------|-----------|
565-
| ID | Extension |
566-
|-----:|:----------|
567-
| 0x0 | Role |
568-
|------|-----------|
569-
570-
## Role
571-
The Role Extension indicates the desired role for the endpoint.
572-
This is useful for indicating intent, such as a client indicating that it will not publish any tracks.
573-
574-
The Role payload is a single varint indicating the functionality of the sender:
575-
576-
|-------|------------|
577-
| ID | Role |
578-
|------:|:-----------|
579-
| 0x0 | Publisher |
580-
|-------|------------|
581-
| 0x1 | Subscriber |
582-
|-------|------------|
583-
| 0x2 | Both |
584-
|-------|------------|
585-
| 0x3 | Any |
586-
|-------|------------|
587-
588-
589-
590-
If the extension is not present, the default value is Both.
591-
An endpoint MAY close the session with a RequiredExtension error (TODO) if the extension is missing and this default role is incompatible.
592-
593-
594594

595595
# Appendix: Changelog
596596
Notable changes between versions of this draft.
597597

598+
## moq-transfork-02
599+
- Document version numbers.
600+
- Added ANNOUNCE_INTEREST to opt-into ANNOUNCE messages.
601+
- Remove ROLE extension.
602+
598603
## moq-transfork-01
599604
- Removed datagram support
600605
- Removed native QUIC support

0 commit comments

Comments
 (0)