Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message flows and endpoint state management (Was: ANNOUNCE) #643

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ef230ed
rebase hell
martinduke Dec 13, 2024
d3f5d84
Added more issues
martinduke Dec 13, 2024
4583f9c
lint
martinduke Dec 13, 2024
2ebdc95
Ian comments
martinduke Dec 17, 2024
42fef47
Tune up announce rules
martinduke Dec 17, 2024
6b7d93a
alan comments
martinduke Dec 18, 2024
af79906
rebase hell
martinduke Jan 10, 2025
004a765
Remove #646
martinduke Jan 10, 2025
35ee766
Require exact namespace match
martinduke Jan 10, 2025
f17dd76
MAY aggregate subscriptions
martinduke Jan 10, 2025
92c4480
Alan comments
martinduke Jan 16, 2025
163040b
rebase hell
afrind Nov 15, 2024
3fc379f
rebase hell
afrind Nov 15, 2024
882b9b9
rebase hell
martinduke Jan 8, 2025
66efa0d
Add expectations for SUBSCRIBE_ANNOUNCES, ANNOUNCE, and SUBSCRIBE/FETCH
martinduke Dec 13, 2024
6d5da25
rebase hell
martinduke Jan 10, 2025
61d8dd9
clarify what can be discovered
martinduke Jan 16, 2025
8b5f637
Revert any changes to namespace matching logic
martinduke Jan 16, 2025
1d3903f
alan comments
martinduke Jan 16, 2025
b7936c6
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
d6ac5b9
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
1794121
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
76b42a7
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
bbe15fb
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
59c55e4
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
a8a830a
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
e5124c9
Update draft-ietf-moq-transport.md
martinduke Jan 16, 2025
377191d
Ian comment
martinduke Jan 16, 2025
4a017e0
Ian comment
martinduke Jan 16, 2025
8143f69
Update draft-ietf-moq-transport.md
martinduke Jan 17, 2025
d810186
Update draft-ietf-moq-transport.md
martinduke Jan 17, 2025
b3f6b37
more Ian comments
martinduke Jan 17, 2025
eee381e
MAY aggregate subscriptions
martinduke Jan 21, 2025
b3a1b6c
Revert error code changes; now a separate PR
martinduke Jan 21, 2025
c465ec3
nit
martinduke Jan 21, 2025
d3bfcbd
Suhas comment
martinduke Jan 22, 2025
9451f90
Added warning not to use this for relay mesh routing
martinduke Jan 22, 2025
73ceefb
Removed non-normative should
martinduke Jan 22, 2025
7304204
Removed definitions
martinduke Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 118 additions & 36 deletions draft-ietf-moq-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,114 @@ and announcements. The client can choose to delay closing the session if it
expects more OBJECTs to be delivered. The server closes the session with a
'GOAWAY Timeout' if the client doesn't close the session quickly enough.

# Track Discovery and Retrieval (#track-discovery}

Discovery of MoQT servers is always done out-of-band. Namespace discovery can be
done in the context of an established MoQT session.
martinduke marked this conversation as resolved.
Show resolved Hide resolved

Given sufficient out of band information, it is valid for a subscriber
to send a SUBSCRIBE or FETCH message to a publisher (including a relay) without
any previous MoQT messages besides SETUP. However, SUBSCRIBE_ANNOUNCES and
ANNOUNCE messages provide an in-band means of discovery of subscribers and
martinduke marked this conversation as resolved.
Show resolved Hide resolved
martinduke marked this conversation as resolved.
Show resolved Hide resolved
publishers for a namespace.

The syntax of these messages is described in {{message}}.

## SUBSCRIBE_ANNOUNCES

If the subscriber is aware of a namespace of interest, it can send
SUBSCRIBE_ANNOUNCES to publishers/relays it has established a session with. The
recipient of this message will send any relevant ANNOUNCE messages for that
namespace, or subset of that namespace.

A publisher MUST send exactly one SUBSCRIBE_ANNOUNCES_OK or
SUBSCRIBE_ANNOUNCES_ERROR in response to a SUBSCRIBE_ANNOUNCES. The subscriber
SHOULD close the session with a protocol error if it detects receiving more than
one.

The receiver of a SUBSCRIBE_NAMESPACES_OK or SUBSCRIBE_NAMESPACES_ERROR ought to
forward the result to the application, so that it can make decisions about
further publishers to contact.

An UNSUBSCRIBE_NAMESPACES withdraws a previous SUBSCRIBE_NAMESPACES. It does
not prohibit the receiver (publisher) from sending further ANNOUNCE messages.

## ANNOUNCE

A publisher MAY send ANNOUNCE messages to any subscriber. An ANNOUNCE indicates
to the subscriber where to route a SUBSCRIBE or FETCH for that namespace. A
subscriber MAY send SUBSCRIBE or FETCH for a namespace without having received
an ANNOUNCE for it.

If a publisher is authoritative for a given namespace, or is a relay that has
received an authorized ANNOUNCE for that namespace from an upstream publisher,
it MUST send an ANNOUNCE to any subscriber that has subscribed to ANNOUNCE for
that namespace, or a subset of that namespace. A publisher MAY send the ANNOUNCE
to any other subscriber.

An endpoint SHOULD NOT, however, send an ANNOUNCE advertising a namespace that
exactly matches a namespace for which the peer sent an earlier ANNOUNCE
(i.e. an ANNOUNCE ought not to be echoed back to its sender).

The receiver of an ANNOUNCE_OK or ANNOUNCE_ERROR SHOULD report this to the
application to inform the search for additional subscribers for a namespace,
or abandoning the attempt to publish under this namespace. This might be
especially useful in upload or chat applications. A subscriber MUST send exactly
one ANNOUNCE_OK or ANNOUNCE_ERROR in response to an ANNOUNCE. The publisher
SHOULD close the session with a protocol error if it receives more than one.

An UNANNOUNCE message withdraws a previous ANNOUNCE, although it is not a
protocol error for the subscriber to send a SUBSCRIBE or FETCH message after
receiving an UNANNOUNCE.

A subscriber can send ANNOUNCE_CANCEL to revoke acceptance of an ANNOUNCE, for
example due to expiration of authorization credentials. The message enables the
publisher to ANNOUNCE again with refreshed authorization, or discard associated
state. After receiving an ANNOUNCE_CANCEL, the publisher does not send UNANNOUNCE.

While ANNOUNCE does provide hints on where to route a SUBSCRIBE or FETCH, it is
not a full-fledged routing protocol and does not protect against loops and other
phenomena. In particular, ANNOUNCE SHOULD NOT be used to find paths through
richly connected networks of relays.

## SUBSCRIBE/FETCH

The central interaction with a publisher is to send SUBSCRIBE and/or FETCH for
martinduke marked this conversation as resolved.
Show resolved Hide resolved
a particular track. The subscriber expects to receive a
SUBSCRIBE_OK/FETCH_OK and objects from the track.

A subscriber MAY send a SUBSCRIBE or FETCH for a track to any publisher. If it
has accepted an ANNOUNCE with a namespace that exactly matches the namespace for
that track, it SHOULD only request it from the senders of those ANNOUNCE
messages.

A publisher MUST send exactly one SUBSCRIBE_OK or SUBSCRIBE_ERROR in response to
a SUBSCRIBE. It MUST send exactly one FETCH_OK or FETCH_ERROR in response to a
FETCH. The subscriber SHOULD close the session with a protocol error if it
receives more than one.

A subscriber keeps SUBSCRIBE state until it sends UNSUBSCRIBE, or after receipt
martinduke marked this conversation as resolved.
Show resolved Hide resolved
of a SUBSCRIBE_DONE or SUBSCRIBE_ERROR. Note that SUBSCRIBE_DONE does not
usually indicate that state can immediately be destroyed, see
{{message-subscribe-done}}.

A subscriber keeps FETCH state until it sends FETCH_CANCEL, receives
FETCH_ERROR, or receives a FIN or RESET_STREAM for the FETCH data stream. If the
data stream is already open, it MAY send STOP_SENDING for the data stream along
with FETCH_CANCEL, but MUST send FETCH_CANCEL.

The Publisher can destroy subscription or fetch state as soon as it has received
afrind marked this conversation as resolved.
Show resolved Hide resolved
UNSUBSCRIBE or FETCH_CANCEL, respectively. It MUST reset any open streams
martinduke marked this conversation as resolved.
Show resolved Hide resolved
martinduke marked this conversation as resolved.
Show resolved Hide resolved
associated with the SUBSCRIBE or FETCH. It can also destroy state after closing
the FETCH data stream.

The publisher can immediately delete SUBSCRIBE state after sending
SUBSCRIBE_DONE, but MUST NOT send it until it has closed all related streams. It
can destroy all FETCH state after closing the data stream.

A SUBSCRIBE_ERROR or FETCH_ERROR indicates no objects will be delivered, and
both endpoints can immediately destroy relevant state. Objects MUST NOT be sent
for requests that end with an error.

# Priorities {#priorities}

Expand Down Expand Up @@ -735,17 +843,13 @@ Relays MAY cache Objects, but are not required to.

## Subscriber Interactions

Subscribers interact with the Relays by sending a SUBSCRIBE or FETCH
control message for the tracks of interest. Relays MUST ensure subscribers are
authorized to access the content associated with the track. The authorization
Subscribers subscribe to tracks by sending a SUBSCRIBE
({{message-subscribe-req}}) control message for each track of
interest. Relays MUST ensure subscribers are authorized to access the
content associated with the track. The authorization
information can be part of subscription request itself or part of the
encompassing session. The specifics of how a relay authorizes a user are
outside the scope of this specification. The subscriber is notified
of the result of the subscription via a
SUBSCRIBE_OK ({{message-subscribe-ok}}) or SUBSCRIBE_ERROR
{{message-subscribe-error}} control message. The entity receiving the
SUBSCRIBE MUST send only a single response to a given SUBSCRIBE of
either SUBSCRIBE_OK or SUBSCRIBE_ERROR.
encompassing session. The specifics of how a relay authorizes a user are outside
the scope of this specification.

The relay will have to send an upstream SUBSCRIBE and/or FETCH if it does not
have all the objects in the FETCH, or is not currently subscribed to the full
Expand All @@ -756,9 +860,7 @@ one from upstream.
For successful subscriptions, the publisher maintains a list of
subscribers for each track. Each new OBJECT belonging to the
track within the subscription range is forwarded to each active
subscriber, dependent on the congestion response. A subscription
remains active until soon after the publisher of the track terminates the
subscription with a SUBSCRIBE_DONE (see {{message-subscribe-done}}).
subscriber, dependent on the congestion response.

A caching relay saves Objects to its cache identified by the Object's
Full Track Name, Group ID and Object ID. Relays MUST be able to
Expand All @@ -769,12 +871,6 @@ Group ID and Object ID, Relays MAY ignore subsequently received Objects
or MAY use them to update the cache. Implementations that update the
cache need to protect against cache poisoning.

Caching can also reduce the number of upstream FETCH requests.

Objects MUST NOT be sent for unsuccessful subscriptions, and if a subscriber
receives a SUBSCRIBE_ERROR after receiving objects, it MUST close the session
with a 'Protocol Violation'.

A relay MUST NOT reorder or drop objects received on a multi-object stream when
forwarding to subscribers, unless it has application specific information.

Expand Down Expand Up @@ -843,19 +939,14 @@ to the old relay can be stopped with an UNSUBSCRIBE.
Publishing through the relay starts with publisher sending ANNOUNCE
control message with a `Track Namespace` ({{model-track}}).
The ANNOUNCE enables the relay to know which publisher to forward a
SUBSCRIBE to if the track belongs to the namespace in the ANNOUNCE.
SUBSCRIBE to.

Relays MUST verify that publishers are authorized to publish
the content associated with the set of
tracks whose Track Namespace matches the announced namespace. Where the
authorization and identification of the publisher occurs depends on the way the
relay is managed and is application specific.

Relays respond with an ANNOUNCE_OK or ANNOUNCE_ERROR control message
providing the result of announcement. The entity receiving the
ANNOUNCE MUST send only a single response to a given ANNOUNCE of
either ANNOUNCE_OK or ANNOUNCE_ERROR.

A Relay can receive announcements from multiple publishers for the same
Track Namespace and it SHOULD respond with the same response to each of the
publishers, as though it was responding to an ANNOUNCE
Expand Down Expand Up @@ -1390,9 +1481,8 @@ See {{priorities}}.
## UNSUBSCRIBE {#message-unsubscribe}

A subscriber issues a `UNSUBSCRIBE` message to a publisher indicating it is no
longer interested in receiving media for the specified track and Objects
should stop being sent as soon as possible. The publisher sends a
SUBSCRIBE_DONE to acknowledge the unsubscribe was successful.
longer interested in receiving media for the specified track and requesting that
the publisher stop sending Objects as soon as possible.

The format of `UNSUBSCRIBE` is as follows:

Expand Down Expand Up @@ -1564,10 +1654,6 @@ The subscriber sends an `ANNOUNCE_CANCEL` control message to
indicate it will stop sending new subscriptions for tracks
within the provided Track Namespace.

If a publisher receives new subscriptions for that namespace after
receiving an ANNOUNCE_CANCEL, it SHOULD close the session as a
'Protocol Violation'.

~~~
ANNOUNCE_CANCEL Message {
Type (i) = 0xC,
Expand Down Expand Up @@ -1749,7 +1835,6 @@ SUBSCRIBE_ERROR
the subscriber MUST close the connection with a Duplicate Track Alias error
({{session-termination}}).


## FETCH_OK {#message-fetch-ok}

A publisher sends a FETCH_OK control message in response to successful fetches.
Expand Down Expand Up @@ -1814,7 +1899,6 @@ FETCH_ERROR

* Reason Phrase: Provides the reason for fetch error.


## SUBSCRIBE_DONE {#message-subscribe-done}

A publisher sends a `SUBSCRIBE_DONE` message to indicate it is done publishing
Expand Down Expand Up @@ -2067,8 +2151,6 @@ failure.

* Reason Phrase: Provides the reason for the namespace subscription error.



# Data Streams {#data-streams}

A publisher sends Objects matching a subscription on Data Streams.
Expand Down
Loading