You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: draft-lcurley-moq-transfork.md
+80-75Lines changed: 80 additions & 75 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,16 +74,20 @@ This provides robust and generic one-to-many transmission, even for latency sens
74
74
A Session consists of a connection between a QUIC client and server.
75
75
76
76
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.
78
78
79
79
The intent is that sessions are chained together via relays.
80
80
A broadcaster could establish a session with an CDN ingest edge while the viewers establish separate sessions to CDN distribution edges.
81
81
A MoqTransfork session is hop-by-hop, but the application should be designed end-to-end.
82
82
83
83
## 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.
85
85
A MoqTransfork session may be used to publish and subscribe to multiple, potentially unrelated, broadcasts.
86
86
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
+
87
91
The application determines if tracks within a broadcast are correlated.
88
92
For example, a "video" track and "audio" track could share timestamp domains.
89
93
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.
174
178
175
179
## Bidirectional Streams
176
180
Bidirectional streams are primarily used for control streams.
177
-
178
181
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
-
|------|-----------|------------|
194
182
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
+
|------|------------|------------|
195
198
196
199
### Session
197
200
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
203
206
204
207
The session remains active until the Session Stream is closed or reset by either endpoint.
205
208
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.
206
217
207
218
### 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.
210
221
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.
214
225
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.
217
233
218
234
### Subscribe
219
235
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.
270
286
# Encoding
271
287
This section covers the encoding of each message.
272
288
273
-
Note that these message do not contain a type identifier.
289
+
Note that these message do not currently contain a type identifier.
274
290
The message type is determined by the stream type and the current state.
275
291
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
+
276
308
## SESSION_CLIENT
277
309
The client advertises supported versions and any extensions.
278
310
@@ -316,30 +348,33 @@ This SHOULD be sourced directly from the QUIC congestion controller.
316
348
A value of 0 indicates that this information is not available.
317
349
318
350
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.
321
353
322
354
~~~
323
-
ANNOUNCE Message {
324
-
Broadcast Name (b),
355
+
ANNOUNCE_INTEREST Message {
356
+
Broadcast Prefix (s),
325
357
}
326
358
~~~
327
359
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.
331
363
332
364
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.
335
367
336
368
~~~
337
-
ANNOUNCE_OK Message {
338
-
Cool = 0x1
369
+
ANNOUNCE Message {
370
+
Broadcast Path (s),
339
371
}
340
372
~~~
341
373
342
-
This message is a single byte long (😎).
374
+
**Broadcast Path**
375
+
The broadcast path.
376
+
This MUST start with the requested prefix.
377
+
343
378
344
379
## SUBSCRIBE
345
380
SUBSCRIBE is sent by a subscriber to start a subscription.
@@ -542,7 +577,8 @@ An error code indicated by the application.
542
577
543
578
544
579
## 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
+
546
582
547
583
~~~
548
584
FRAME Message {
@@ -555,46 +591,15 @@ An application specific payload.
555
591
A generic library or relay MUST NOT inspect or modify the contents unless otherwise negotiated.
556
592
557
593
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
-
594
594
595
595
# Appendix: Changelog
596
596
Notable changes between versions of this draft.
597
597
598
+
## moq-transfork-02
599
+
- Document version numbers.
600
+
- Added ANNOUNCE_INTEREST to opt-into ANNOUNCE messages.
0 commit comments