@@ -626,6 +626,114 @@ and announcements. The client can choose to delay closing the session if it
626626expects more OBJECTs to be delivered. The server closes the session with a
627627' GOAWAY Timeout' if the client doesn't close the session quickly enough.
628628
629+ # Track Discovery and Retrieval (#track-discovery}
630+
631+ Discovery of MoQT servers is always done out-of-band. Namespace discovery can be
632+ done in the context of an established MoQT session.
633+
634+ Given sufficient out of band information, it is valid for a subscriber
635+ to send a SUBSCRIBE or FETCH message to a publisher (including a relay) without
636+ any previous MoQT messages besides SETUP. However, SUBSCRIBE_ANNOUNCES and
637+ ANNOUNCE messages provide an in-band means of discovery of subscribers and
638+ publishers for a namespace.
639+
640+ The syntax of these messages is described in {{message}}.
641+
642+ # # SUBSCRIBE_ANNOUNCES
643+
644+ If the subscriber is aware of a namespace of interest, it can send
645+ SUBSCRIBE_ANNOUNCES to publishers/relays it has established a session with. The
646+ recipient of this message will send any relevant ANNOUNCE messages for that
647+ namespace, or subset of that namespace.
648+
649+ A publisher MUST send exactly one SUBSCRIBE_ANNOUNCES_OK or
650+ SUBSCRIBE_ANNOUNCES_ERROR in response to a SUBSCRIBE_ANNOUNCES. The subscriber
651+ SHOULD close the session with a protocol error if it detects receiving more than
652+ one.
653+
654+ The receiver of a SUBSCRIBE_NAMESPACES_OK or SUBSCRIBE_NAMESPACES_ERROR ought to
655+ forward the result to the application, so that it can make decisions about
656+ further publishers to contact.
657+
658+ An UNSUBSCRIBE_NAMESPACES withdraws a previous SUBSCRIBE_NAMESPACES. It does
659+ not prohibit the receiver (publisher) from sending further ANNOUNCE messages.
660+
661+ # # ANNOUNCE
662+
663+ A publisher MAY send ANNOUNCE messages to any subscriber. An ANNOUNCE indicates
664+ to the subscriber where to route a SUBSCRIBE or FETCH for that namespace. A
665+ subscriber MAY send SUBSCRIBE or FETCH for a namespace without having received
666+ an ANNOUNCE for it.
667+
668+ If a publisher is authoritative for a given namespace, or is a relay that has
669+ received an authorized ANNOUNCE for that namespace from an upstream publisher,
670+ it MUST send an ANNOUNCE to any subscriber that has subscribed to ANNOUNCE for
671+ that namespace, or a subset of that namespace. A publisher MAY send the ANNOUNCE
672+ to any other subscriber.
673+
674+ An endpoint SHOULD NOT, however, send an ANNOUNCE advertising a namespace that
675+ exactly matches a namespace for which the peer sent an earlier ANNOUNCE
676+ (i.e. an ANNOUNCE ought not to be echoed back to its sender).
677+
678+ The receiver of an ANNOUNCE_OK or ANNOUNCE_ERROR SHOULD report this to the
679+ application to inform the search for additional subscribers for a namespace,
680+ or abandoning the attempt to publish under this namespace. This might be
681+ especially useful in upload or chat applications. A subscriber MUST send exactly
682+ one ANNOUNCE_OK or ANNOUNCE_ERROR in response to an ANNOUNCE. The publisher
683+ SHOULD close the session with a protocol error if it receives more than one.
684+
685+ An UNANNOUNCE message withdraws a previous ANNOUNCE, although it is not a
686+ protocol error for the subscriber to send a SUBSCRIBE or FETCH message after
687+ receiving an UNANNOUNCE.
688+
689+ A subscriber can send ANNOUNCE_CANCEL to revoke acceptance of an ANNOUNCE, for
690+ example due to expiration of authorization credentials. The message enables the
691+ publisher to ANNOUNCE again with refreshed authorization, or discard associated
692+ state. After receiving an ANNOUNCE_CANCEL, the publisher does not send UNANNOUNCE.
693+
694+ While ANNOUNCE does provide hints on where to route a SUBSCRIBE or FETCH, it is
695+ not a full-fledged routing protocol and does not protect against loops and other
696+ phenomena. In particular, ANNOUNCE SHOULD NOT be used to find paths through
697+ richly connected networks of relays.
698+
699+ # # SUBSCRIBE/FETCH
700+
701+ The central interaction with a publisher is to send SUBSCRIBE and/or FETCH for
702+ a particular track. The subscriber expects to receive a
703+ SUBSCRIBE_OK/FETCH_OK and objects from the track.
704+
705+ A subscriber MAY send a SUBSCRIBE or FETCH for a track to any publisher. If it
706+ has accepted an ANNOUNCE with a namespace that exactly matches the namespace for
707+ that track, it SHOULD only request it from the senders of those ANNOUNCE
708+ messages.
709+
710+ A publisher MUST send exactly one SUBSCRIBE_OK or SUBSCRIBE_ERROR in response to
711+ a SUBSCRIBE. It MUST send exactly one FETCH_OK or FETCH_ERROR in response to a
712+ FETCH. The subscriber SHOULD close the session with a protocol error if it
713+ receives more than one.
714+
715+ A subscriber keeps SUBSCRIBE state until it sends UNSUBSCRIBE, or after receipt
716+ of a SUBSCRIBE_DONE or SUBSCRIBE_ERROR. Note that SUBSCRIBE_DONE does not
717+ usually indicate that state can immediately be destroyed, see
718+ {{message-subscribe-done}}.
719+
720+ A subscriber keeps FETCH state until it sends FETCH_CANCEL, receives
721+ FETCH_ERROR, or receives a FIN or RESET_STREAM for the FETCH data stream. If the
722+ data stream is already open, it MAY send STOP_SENDING for the data stream along
723+ with FETCH_CANCEL, but MUST send FETCH_CANCEL.
724+
725+ The Publisher can destroy subscription or fetch state as soon as it has received
726+ UNSUBSCRIBE or FETCH_CANCEL, respectively. It MUST reset any open streams
727+ associated with the SUBSCRIBE or FETCH. It can also destroy state after closing
728+ the FETCH data stream.
729+
730+ The publisher can immediately delete SUBSCRIBE state after sending
731+ SUBSCRIBE_DONE, but MUST NOT send it until it has closed all related streams. It
732+ can destroy all FETCH state after closing the data stream.
733+
734+ A SUBSCRIBE_ERROR or FETCH_ERROR indicates no objects will be delivered, and
735+ both endpoints can immediately destroy relevant state. Objects MUST NOT be sent
736+ for requests that end with an error.
629737
630738# Priorities {#priorities}
631739
@@ -735,17 +843,13 @@ Relays MAY cache Objects, but are not required to.
735843
736844# # Subscriber Interactions
737845
738- Subscribers interact with the Relays by sending a SUBSCRIBE or FETCH
739- control message for the tracks of interest. Relays MUST ensure subscribers are
740- authorized to access the content associated with the track. The authorization
846+ Subscribers subscribe to tracks by sending a SUBSCRIBE
847+ ({{message-subscribe-req}}) control message for each track of
848+ interest. Relays MUST ensure subscribers are authorized to access the
849+ content associated with the track. The authorization
741850information can be part of subscription request itself or part of the
742- encompassing session. The specifics of how a relay authorizes a user are
743- outside the scope of this specification. The subscriber is notified
744- of the result of the subscription via a
745- SUBSCRIBE_OK ({{message-subscribe-ok}}) or SUBSCRIBE_ERROR
746- {{message-subscribe-error}} control message. The entity receiving the
747- SUBSCRIBE MUST send only a single response to a given SUBSCRIBE of
748- either SUBSCRIBE_OK or SUBSCRIBE_ERROR.
851+ encompassing session. The specifics of how a relay authorizes a user are outside
852+ the scope of this specification.
749853
750854The relay will have to send an upstream SUBSCRIBE and/or FETCH if it does not
751855have all the objects in the FETCH, or is not currently subscribed to the full
@@ -756,9 +860,7 @@ one from upstream.
756860For successful subscriptions, the publisher maintains a list of
757861subscribers for each track. Each new OBJECT belonging to the
758862track within the subscription range is forwarded to each active
759- subscriber, dependent on the congestion response. A subscription
760- remains active until soon after the publisher of the track terminates the
761- subscription with a SUBSCRIBE_DONE (see {{message-subscribe-done}}).
863+ subscriber, dependent on the congestion response.
762864
763865A caching relay saves Objects to its cache identified by the Object's
764866Full Track Name, Group ID and Object ID. Relays MUST be able to
@@ -769,12 +871,6 @@ Group ID and Object ID, Relays MAY ignore subsequently received Objects
769871or MAY use them to update the cache. Implementations that update the
770872cache need to protect against cache poisoning.
771873
772- Caching can also reduce the number of upstream FETCH requests.
773-
774- Objects MUST NOT be sent for unsuccessful subscriptions, and if a subscriber
775- receives a SUBSCRIBE_ERROR after receiving objects, it MUST close the session
776- with a 'Protocol Violation'.
777-
778874A relay MUST NOT reorder or drop objects received on a multi-object stream when
779875forwarding to subscribers, unless it has application specific information.
780876
@@ -843,19 +939,14 @@ to the old relay can be stopped with an UNSUBSCRIBE.
843939Publishing through the relay starts with publisher sending ANNOUNCE
844940control message with a `Track Namespace` ({{model-track}}).
845941The ANNOUNCE enables the relay to know which publisher to forward a
846- SUBSCRIBE to if the track belongs to the namespace in the ANNOUNCE .
942+ SUBSCRIBE to.
847943
848944Relays MUST verify that publishers are authorized to publish
849945the content associated with the set of
850946tracks whose Track Namespace matches the announced namespace. Where the
851947authorization and identification of the publisher occurs depends on the way the
852948relay is managed and is application specific.
853949
854- Relays respond with an ANNOUNCE_OK or ANNOUNCE_ERROR control message
855- providing the result of announcement. The entity receiving the
856- ANNOUNCE MUST send only a single response to a given ANNOUNCE of
857- either ANNOUNCE_OK or ANNOUNCE_ERROR.
858-
859950A Relay can receive announcements from multiple publishers for the same
860951Track Namespace and it SHOULD respond with the same response to each of the
861952publishers, as though it was responding to an ANNOUNCE
@@ -1390,9 +1481,8 @@ See {{priorities}}.
13901481# # UNSUBSCRIBE {#message-unsubscribe}
13911482
13921483A subscriber issues a `UNSUBSCRIBE` message to a publisher indicating it is no
1393- longer interested in receiving media for the specified track and Objects
1394- should stop being sent as soon as possible. The publisher sends a
1395- SUBSCRIBE_DONE to acknowledge the unsubscribe was successful.
1484+ longer interested in receiving media for the specified track and requesting that
1485+ the publisher stop sending Objects as soon as possible.
13961486
13971487The format of `UNSUBSCRIBE` is as follows :
13981488
@@ -1564,10 +1654,6 @@ The subscriber sends an `ANNOUNCE_CANCEL` control message to
15641654indicate it will stop sending new subscriptions for tracks
15651655within the provided Track Namespace.
15661656
1567- If a publisher receives new subscriptions for that namespace after
1568- receiving an ANNOUNCE_CANCEL, it SHOULD close the session as a
1569- ' Protocol Violation' .
1570-
15711657~~~
15721658ANNOUNCE_CANCEL Message {
15731659 Type (i) = 0xC,
@@ -1749,7 +1835,6 @@ SUBSCRIBE_ERROR
17491835 the subscriber MUST close the connection with a Duplicate Track Alias error
17501836 ({{session-termination}}).
17511837
1752-
17531838# # FETCH_OK {#message-fetch-ok}
17541839
17551840A publisher sends a FETCH_OK control message in response to successful fetches.
@@ -1814,7 +1899,6 @@ FETCH_ERROR
18141899
18151900* Reason Phrase: Provides the reason for fetch error.
18161901
1817-
18181902# # SUBSCRIBE_DONE {#message-subscribe-done}
18191903
18201904A publisher sends a `SUBSCRIBE_DONE` message to indicate it is done publishing
@@ -2067,8 +2151,6 @@ failure.
20672151
20682152* Reason Phrase: Provides the reason for the namespace subscription error.
20692153
2070-
2071-
20722154# Data Streams {#data-streams}
20732155
20742156A publisher sends Objects matching a subscription on Data Streams.
0 commit comments