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
+35-32Lines changed: 35 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,20 +48,21 @@ The draft supports multiple different approaches, but it does so by leaving impo
48
48
In our RUSH to standardize a protocol, the QUICR solutions have led to WARP in ideals.
49
49
50
50
This fork is meant to be constructive; an alternative vision.
51
-
However, we've been arguing about some of these issues for years now and I don't expect that will change any time soon.
51
+
We've been arguing about some of these issues for years now and I don't expect that will change any time soon.
52
52
I'd like to try leading by example, demonstrating that it's possible to simplify the protocol and still support a documented set of use-cases.
53
53
54
54
Here's an overview of the notable differences between MoqTransport and MoqTransfork:
55
55
56
56
## Object Model
57
-
The object model is an abstraction exposed to the application outlining how the transport is used.
57
+
The object model is an abstraction exposed to the application, forming the basis of the transport API.
58
58
59
-
The MoqTransport object model vaguely maps to media concepts, where `group = GoP` and `object = frame`.
60
-
However, this causes my biggest complaint with the draft: the properties of the object model change dynamically based on the publisher's "delivery preference" as there's no agreed upon way to utilize QUIC.
61
-
This creates a lot of complexity and edge cases as the meaning of a track/group/object will subtly change at runtime based on the application.
59
+
The MoqTransport object model vaguely maps to media concepts, where a Group is a Video GoP and an Object is a Video Frame.
60
+
However, there's no agreed upon way to utilize QUIC, leading to the compromise that the publisher chooses a "delivery preference" for each track.
61
+
As a the result the properties of the object model change dynamically at runtime, as the properties of a QUIC stream (or datagram) are moved between a track, group, or object.
62
+
The number of permutations quickly becomes unmanageable and every conversion has to be caveated with "when using a stream per X".
62
63
63
64
The MoqTransfork object model is instead static and maps directly to QUIC.
64
-
A Group is always an ordered set of bytes, although it may be served via a QUIC stream or datagram depending on the subscription.
65
+
A Group is always an ordered set of bytes, served via a QUIC stream or datagram depending on the subscription.
65
66
This simplification is able to support all of the documented use-cases; see the Appendix.
66
67
67
68
## Prioritization
@@ -80,10 +81,10 @@ However when there are multiple conflicting viewers, then a relay should use the
80
81
At the core of any transport are control messages.
81
82
82
83
MoqTransport control messages are fine, but have the potential for head-of-line blocking as they share a single stream.
83
-
There's also just a lot of messages for errors and state transitions such as `UNSUBSCRIBE`, `SUBSCRIBE_ERROR`, `SUBSCRIBE_DONE`, etc.
84
+
There's also just a lot of messages for state transitions such as `UNSUBSCRIBE`, `SUBSCRIBE_ERROR`, `SUBSCRIBE_DONE`, etc.
84
85
85
-
MoqTransfork continues the trend of leveraging QUIC with separate control streams, such as one stream per subscription.
86
-
These control streams are terminated when endpoints close or reset (including an error code) the stream, directly leveraging QUIC's stream state machine.
86
+
MoqTransfork continues the trend of leveraging QUIC with separate control streams, like one stream per subscription.
87
+
These control streams are terminated when endpoints close or reset (including an error code) the stream in order to directly leverage QUIC's stream state machine.
87
88
This removes any messages that start with `UN` or end with `_DONE`, `_ERROR`, `_RESET`, etc.
88
89
89
90
## Byte Offsets
@@ -94,7 +95,7 @@ This is an okay approach, however it results in redownloading partial objects an
94
95
95
96
MoqTransfork instead utilizes FETCH to serve incomplete Groups starting at a byte offset.
96
97
QUIC streams are tail dropped when reset so there's no need for a more complex mechanism.
97
-
This also allows an advanced relay to forward STREAM frames directly.
98
+
This means a relay doesn't need to parse frame/object boundaries and it can even forward STREAM frames out-of-order.
98
99
99
100
## Datagrams
100
101
Datagrams are useful when payloads are small, overhead is important, and the desired latency is below the RTT.
@@ -104,13 +105,13 @@ This can work for real-time viewers but results in a poor experience for higher
104
105
105
106
MoqTransfork instead lets the subscriber indicate if it wants to receive a subscription via streams or datagrams.
106
107
Datagrams should only be used when Groups are smaller than the MTU and the desired latency is smaller than the RTT.
107
-
If so, Groups via datagrams may be silently dropped for whatever reason, saving a few bytes on the wire (~10 per Group) which is desirable for audio use-cases.
108
+
In doing so, Groups sent via datagrams may be silently dropped for whatever reason, saving a few bytes on the wire (~10 per Group) which is desirable for audio use-cases.
108
109
109
110
## Use-Cases
110
-
It's boring, but you should write down what you're trying to accomplish before you start writing a protocol.
111
+
It's boring, but you should write down what you're trying to accomplish before you start designing a protocol especially by committee.
111
112
112
113
MoqTransport is intentionally vague and doesn't mention any use-cases.
113
-
This has caused unnecessary or incomplete features, as it's impossible to argue against a feature or suggest alternatives "some application might need it".
114
+
This has caused unnecessary or incomplete features, as it's impossible to argue against a feature or suggest alternatives when "some application might need it".
114
115
115
116
MoqTransfork instead includes an Appendix contains a number of media use-cases and recommended approaches that are by no means required or comprehensive.
116
117
This also serves to illustrate the careful layering of Media over QUIC which has otherwise not been documented.
@@ -144,7 +145,6 @@ Each subscription is scoped to a single Track and starts/ends at a Group boundar
144
145
A subscriber chooses the priority of each subscription, dictating which Track arrives first during congestion.
145
146
146
147
There is currently no way to discover tracks within a broadcast; it must be negotiated out-of-band.
147
-
For example, a `catalog` track that lists all other tracks and their association.
148
148
149
149
### Group
150
150
A Group is an ordered stream of Frames within a Track.
@@ -157,7 +157,9 @@ A Frame is a payload of bytes within a Group.
157
157
158
158
Frames currently only provides framing, hence the name.
159
159
Framing is useful in some applications but can also be redundant or increase memory usage, as the size must be known upfront.
160
-
This will be removed in a future version of the draft, delegated to a higher layer.
160
+
161
+
Frame will be removed in a future version of the draft and delegated to a higher layer.
162
+
However, it's useful when being compared to an Object in MoqTransport.
161
163
162
164
## Streams vs Datagrams
163
165
MoqTransfork supports two primary methods of transmitting data: QUIC streams and datagrams.
@@ -172,7 +174,6 @@ Each Group MUST have an upfront size that is smaller than network MTU, limiting
172
174
These restrictions allow the Group to be delivered with less overhead than a stream (~10 bytes per group) which is significant for some real-time use-cases.
173
175
174
176
A subscriber is responsible for choosing if a subscription is served via streams or datagrams.
175
-
The publisher MUST support both modes for all tracks.
176
177
177
178
# Workflow
178
179
This section outlines the flow of messages within a MoqTransfork session.
@@ -187,7 +188,7 @@ The client opens the Session Stream and sends a SESSION_CLIENT message and the s
187
188
## Bidirectional Streams
188
189
Bidirectional streams are primarily used for control streams.
189
190
190
-
Note that QUIC bidirectional streams have both a send and recv direction can be closed or reset (with an error code) independently.
191
+
Note that QUIC bidirectional streams have both a send and recvieve direction that can be closed or reset (with an error code) independently.
191
192
This is used to indicate completion or errors respectively.
192
193
193
194
The first byte of each stream indicates the Stream Type.
@@ -224,7 +225,7 @@ The session remains active until the Session Stream is closed or reset by either
224
225
225
226
### Announce
226
227
A publisher can open an Announce Stream to advertise a broadcast.
227
-
This is optional, as the subscriber can determine the broadcast name out-of-band.
228
+
This is optional, as the application determine the broadcast name out-of-band.
228
229
229
230
The publisher MUST start the stream with an ANNOUNCE message.
230
231
The subscriber MUST reply with an ANNOUNCE_OK message or reset the stream.
@@ -238,29 +239,22 @@ A subscriber can open a Subscribe Stream to request a named track within a broad
238
239
The Stream Type indicates if the subscription is served via QUIC streams or datagrams.
239
240
240
241
The SUBSCRIBE message contains a requested Broadcast and Track.
241
-
It also contains prioritization information and a range of Groups, which MAY be updated by the subscriber via a SUBSCRIBE_UPDATE message.
242
+
It also contains prioritization information and a range of Groups, all of which MAY be updated by the subscriber via a SUBSCRIBE_UPDATE message.
242
243
The subscription is active until the either endpoint closes or resets the stream.
243
244
244
245
The subscriber MUST start a Info Stream with a SUBSCRIBE message followed by any number SUBSCRIBE_UPDATE messages.
245
-
The publisher MUST reply with an INFO message followed by any number of GROUP_DROPPED messages (streams only), or reset the stream.
246
+
The publisher MUST reply with an INFO message followed by any number of GROUP_DROPPED messages (streams only).
247
+
A publisher MAY reset the stream at any point if it is unable to serve the subscription.
246
248
247
-
**When QUIC streams are used**, the publisher MUST transmit a complete Group Stream or a GROUP_DROPPED message for each Group within the range.
249
+
**When QUIC streams are used**, the publisher MUST transmit a complete Group Stream or a GROUP_DROPPED message for each Group within the subscription range.
248
250
This means the publisher MUST transmit a GROUP_DROPPED if a Group Stream is reset.
249
251
The subscriber SHOULD close the subscription when all GROUP and GROUP_DROP messages have been received, and the publisher MAY close the subscription after all messages have been acknowledged.
250
252
251
-
**When QUIC datagrams are used**, the publisher MAY transmit a Group/Frame Datagram for each Group within the range.
253
+
**When QUIC datagrams are used**, the publisher MAY transmit a Group/Frame Datagram for each Group within the subscription range.
252
254
The publisher MUST NOT transmit a GROUP_DROPPED message.
253
255
The publisher SHOULD close the subscription after all Group/Frame Datagrams have been transmitted, and the subscriber MAY close the subscription after all Groups have been received.
254
256
255
257
256
-
### Info
257
-
A subscriber can open an Info Stream to request information about a track.
258
-
This is not necessary for a subscription, as SUBSCRIBE will trigger an INFO reply.
259
-
260
-
The subscriber MUST start the stream with a INFO_REQUEST message.
261
-
The publisher MUST reply with an INFO message or reset the stream.
262
-
Both endpoints MUST close the stream afterwards.
263
-
264
258
### Fetch
265
259
A subscriber can open a Fetch Stream to receive a single Group at a specified offset.
266
260
This is primarily used to recover from an abrupt stream termination, causing the truncation of a Group.
@@ -271,6 +265,15 @@ The publisher MUST reply with a GROUP message followed by the rest of a Group St
271
265
The fetch is active until both endpoints close the stream, or either endpoint resets the stream.
272
266
273
267
268
+
### Info
269
+
A subscriber can open an Info Stream to request information about a track.
270
+
This is not often necessary as SUBSCRIBE will trigger an INFO reply.
271
+
272
+
The subscriber MUST start the stream with a INFO_REQUEST message.
273
+
The publisher MUST reply with an INFO message or reset the stream.
274
+
Both endpoints MUST close the stream afterwards.
275
+
276
+
274
277
## Unidirectional
275
278
Unidirectional streams are used for subscription data.
276
279
@@ -315,7 +318,7 @@ This saves 1-2 bytes by skipping the FRAME header when there's a only single Fra
315
318
This section covers the encoding of each message.
316
319
317
320
Note that none of these message have a type identifier.
318
-
Valid messages are determined by the stream type and state.
321
+
The message is determined by the stream type and the current state.
319
322
320
323
## SESSION_CLIENT
321
324
TODO copy from moq-transport.
@@ -534,7 +537,7 @@ FRAME Message {
534
537
535
538
**Payload**:
536
539
An application specific payload.
537
-
A MoqTransfork library MUST NOT inspect or modify the contents unless otherwise negotiated.
540
+
A generic library or relay MUST NOT inspect or modify the contents unless otherwise negotiated.
0 commit comments