Skip to content

Commit 95a28c2

Browse files
kixelatedclaude
andauthored
Add GOAWAY stream and rename ANNOUNCE_PLEASE to ANNOUNCE_SUBSCRIBE (#22)
* Add GOAWAY stream to moq-lite (version 04) Restores GOAWAY as a bidirectional stream type (0x5) for graceful session shutdown and migration. Either endpoint can open a Goaway stream with an optional new session URI for the peer to reconnect to. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG * Rename ANNOUNCE_PLEASE to ANNOUNCE_SUBSCRIBE Gives all messages on the Announce stream a consistent ANNOUNCE_ prefix. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG * Rename ANNOUNCE_SUBSCRIBE to ANNOUNCE_INTEREST Better semantics: the subscriber expresses interest in a prefix, avoiding overloading "subscribe" which is already used elsewhere. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG * Add RTT to PROBE message, use 0 for unknown values The smoothed RTT (per RFC 9002) is needed because browser WebTransport doesn't expose it. Both Bitrate and RTT use 0 to indicate unknown. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG * Add GOAWAY URI validation requirement and RFC9002 reference Require recipients to validate the New Session URI against local policy before reconnecting, and add RFC9002 to normative references for the smoothed RTT citation in PROBE. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG * Add note explaining why RTT is in PROBE message Not all browsers/QUIC libraries expose RTT stats yet, so the server needs to report it. May be deprecated once universally available. https://claude.ai/code/session_01LCkQcr69mLdMHo9RQSL8xG --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9aa095e commit 95a28c2

1 file changed

Lines changed: 50 additions & 9 deletions

File tree

draft-lcurley-moq-lite.md

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ author:
1818

1919
normative:
2020
moqt: I-D.ietf-moq-transport
21+
RFC9002:
2122

2223
informative:
2324

@@ -91,7 +92,7 @@ A Broadcast is a collection of Tracks from a single publisher.
9192
This corresponds to a MoqTransport's "track namespace".
9293

9394
A publisher may produce multiple broadcasts, each of which is advertised via an ANNOUNCE message.
94-
The subscriber uses the ANNOUNCE_PLEASE message to discover available broadcasts.
95+
The subscriber uses the ANNOUNCE_INTEREST message to discover available broadcasts.
9596
These announcements are live and can change over time, allowing for dynamic origin discovery.
9697

9798
A broadcast consists of any number of Tracks.
@@ -178,11 +179,13 @@ There's a 1-byte STREAM_TYPE at the beginning of each stream.
178179
| ------- | ------------- | ---------- |
179180
| 0x4 | Probe | Subscriber |
180181
| ------- | ------------- | ----------- |
182+
| 0x5 | Goaway | Either |
183+
| ------- | ------------- | ----------- |
181184

182185
### Announce
183186
A subscriber can open a Announce Stream to discover broadcasts matching a prefix.
184187

185-
The subscriber creates the stream with a ANNOUNCE_PLEASE message.
188+
The subscriber creates the stream with a ANNOUNCE_INTEREST message.
186189
The publisher replies with ANNOUNCE messages for any matching broadcasts and any future changes.
187190
Each ANNOUNCE message contains one of the following statuses:
188191

@@ -223,10 +226,20 @@ A subscriber opens a Probe Stream (0x4) to measure the available bitrate of the
223226
The subscriber sends a PROBE message with a target bitrate on the bidirectional stream.
224227
The subscriber MAY send additional PROBE messages on the same stream to update the target bitrate; the publisher MUST treat each PROBE as a new target to attempt.
225228
The publisher SHOULD pad the connection to achieve the most recent target bitrate.
226-
The publisher periodically replies with PROBE messages on the same bidirectional stream containing the current measured bitrate.
229+
The publisher periodically replies with PROBE messages on the same bidirectional stream containing the current estimated bitrate and smoothed RTT.
227230

228231
If the publisher does not support PROBE (e.g., congestion controller is not exposed), it MUST reset the stream.
229232

233+
### Goaway
234+
Either endpoint can open a Goaway Stream (0x5) to initiate a graceful session shutdown.
235+
236+
The sender sends a GOAWAY message containing an optional new session URI.
237+
If the URI is non-empty, the peer SHOULD establish a new session at the provided URI and migrate any active subscriptions.
238+
The peer MUST NOT open new streams on the current session after receiving a GOAWAY.
239+
240+
The sender closes the stream (FIN) when it is ready to terminate the session.
241+
The peer SHOULD close all streams and the session after migrating or when it no longer needs the session.
242+
230243
# Delivery
231244
The most important concept in moq-lite is how to deliver a subscription.
232245
QUIC can only improve the user experience if data is delivered out-of-order during congestion.
@@ -354,11 +367,11 @@ A receiver MUST reset the stream if it receives an unknown stream type.
354367
Unknown stream types MUST NOT be treated as fatal; this enables extension negotiation via stream probing.
355368

356369

357-
## ANNOUNCE_PLEASE
358-
A subscriber sends an ANNOUNCE_PLEASE message to indicate it wants to receive an ANNOUNCE message for any broadcasts with a path that starts with the requested prefix.
370+
## ANNOUNCE_INTEREST
371+
A subscriber sends an ANNOUNCE_INTEREST message to indicate it wants to receive an ANNOUNCE message for any broadcasts with a path that starts with the requested prefix.
359372

360373
~~~
361-
ANNOUNCE_PLEASE Message {
374+
ANNOUNCE_INTEREST Message {
362375
Message Length (i)
363376
Broadcast Path Prefix (s),
364377
}
@@ -563,12 +576,36 @@ PROBE is used to measure the available bitrate of the connection.
563576
PROBE Message {
564577
Message Length (i)
565578
Bitrate (i)
579+
RTT (i)
566580
}
567581
~~~
568582

569583
**Bitrate**:
570584
When sent by the subscriber (stream opener): the target bitrate in bits per second that the publisher should pad up to.
571-
When sent by the publisher (responder): the current measured bitrate in bits per second.
585+
When sent by the publisher (responder): the current estimated bitrate in bits per second.
586+
A value of 0 means unknown.
587+
588+
**RTT**:
589+
The smoothed round-trip time in milliseconds, as defined in {{!RFC9002}}.
590+
A value of 0 means unknown.
591+
592+
> NOTE: RTT is included in the PROBE message because not all QUIC implementations and browser WebTransport APIs expose RTT statistics directly. This field may be deprecated once RTT is universally available via the underlying transport API.
593+
594+
## GOAWAY
595+
A GOAWAY message is sent to initiate a graceful session shutdown with an optional redirect.
596+
597+
~~~
598+
GOAWAY Message {
599+
Message Length (i)
600+
New Session URI (s)
601+
}
602+
~~~
603+
604+
**New Session URI**:
605+
A URI for the peer to reconnect to.
606+
An empty string indicates no redirect; the peer should simply close the session.
607+
A recipient MUST validate the URI against local policy before reconnecting, including verifying the scheme, authority, and port are permitted.
608+
If validation fails, the recipient MUST close the session without reconnecting.
572609

573610
## GROUP
574611
The GROUP message contains information about a Group, as well as a reference to the subscription being served.
@@ -608,6 +645,11 @@ A generic library or relay MUST NOT inspect or modify the contents unless otherw
608645

609646
# Appendix A: Changelog
610647

648+
## moq-lite-04
649+
- Added GOAWAY stream for graceful session shutdown and migration.
650+
- Renamed ANNOUNCE_PLEASE to ANNOUNCE_INTEREST.
651+
- Added RTT to PROBE message. Bitrate and RTT use 0 for unknown.
652+
611653
## moq-lite-03
612654
- Version negotiated via ALPN (`moq-lite-xx`) instead of SETUP messages.
613655
- Removed Session, SessionCompat streams and SESSION_CLIENT/SESSION_SERVER/SESSION_UPDATE messages.
@@ -648,7 +690,6 @@ A quick comparison of moq-lite and moq-transport-14:
648690
- No paused subscriptions (forward=0)
649691

650692
## Deleted Messages
651-
- GOAWAY
652693
- MAX_SUBSCRIBE_ID
653694
- REQUESTS_BLOCKED
654695
- SUBSCRIBE_ERROR
@@ -674,7 +715,7 @@ A quick comparison of moq-lite and moq-transport-14:
674715
- OBJECT_DATAGRAM
675716

676717
## Renamed Messages
677-
- SUBSCRIBE_NAMESPACE -> ANNOUNCE_PLEASE
718+
- SUBSCRIBE_NAMESPACE -> ANNOUNCE_INTEREST
678719
- SUBGROUP_HEADER -> GROUP
679720

680721
## Deleted Fields

0 commit comments

Comments
 (0)