Skip to content

Commit b37f0b1

Browse files
authored
Clarify subscribe / annouce interaction (#525)
Fixes #362 #267 #227 #225 #79
2 parents 65b9aba + 24c43db commit b37f0b1

File tree

1 file changed

+80
-12
lines changed

1 file changed

+80
-12
lines changed

draft-ietf-moq-transport.md

Lines changed: 80 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,13 @@ interest. Relays MUST ensure subscribers are authorized to access the
692692
content associated with the track. The authorization
693693
information can be part of subscription request itself or part of the
694694
encompassing session. The specifics of how a relay authorizes a user are
695-
outside the scope of this specification.
695+
outside the scope of this specification. The subscriber is notified
696+
of the result of the subscription via a
697+
SUBSCRIBE_OK ({{message-subscribe-ok}}) or SUBSCRIBE_ERROR
698+
{{message-subscribe-error}} control message. The entity receiving the
699+
SUBSCRIBE MUST send only a single response to a given SUBSCRIBE of
700+
either SUBSCRIBE_OK or SUBSCRIBE_ERROR.
696701

697-
The subscriber making the subscribe request is notified of the result of
698-
the subscription, via SUBSCRIBE_OK ({{message-subscribe-ok}}) or the
699-
SUBSCRIBE_ERROR {{message-subscribe-error}} control message.
700-
The entity receiving the SUBSCRIBE MUST send only a single response to
701-
a given SUBSCRIBE of either SUBSCRIBE_OK or SUBSCRIBE_ERROR.
702702
If a relay does not already have a subscription for the track,
703703
or if the subscription does not cover all the requested Objects, it
704704
will need to make an upstream subscription. The relay SHOULD NOT
@@ -710,7 +710,16 @@ subscribers for each track. Each new OBJECT belonging to the
710710
track within the subscription range is forwarded to each active
711711
subscriber, dependent on the congestion response. A subscription
712712
remains active until the publisher of the track terminates the
713-
track with a SUBSCRIBE_DONE (see {{message-subscribe-done}}).
713+
subscription with a SUBSCRIBE_DONE (see {{message-subscribe-done}}).
714+
715+
A caching relay saves Objects to its cache identified by the Object's
716+
Full Track Name, Group ID and Object ID. Relays MUST be able to
717+
process objects for the same Full Track Name from multiple
718+
publishers and forward objects to active matching subscriptions.
719+
If multiple objects are received with the same Full Track Name,
720+
Group ID and Object ID, Relays MAY ignore subsequently received Objects
721+
or MAY use them to update the cache. Implementations that update the
722+
cache need to be protect against cache poisoning.
714723

715724
Objects MUST NOT be sent for unsuccessful subscriptions, and if a subscriber
716725
receives a SUBSCRIBE_ERROR after receiving objects, it MUST close the session
@@ -765,24 +774,44 @@ SUBSCRIBE_DONE, as defined below:
765774
| 0x6 | Expired |
766775
|------|---------------------------|
767776

777+
### Graceful Publisher Relay Switchover
778+
779+
This section describes behavior a subscriber MAY implement
780+
to allow for a better user experience when a relay sends a GOAWAY.
781+
782+
When a subscriber receives the GOAWAY message, it starts the process
783+
of connecting to a new relay and sending the SUBSCRIBE requests for
784+
all active subscriptions to the new relay. The new relay will send a
785+
response to the subscribes and if they are successful, the subscriptions
786+
to the old relay can be stopped with an UNSUBSCRIBE.
787+
788+
768789
## Publisher Interactions
769790

770791
Publishing through the relay starts with publisher sending ANNOUNCE
771792
control message with a `Track Namespace` ({{model-track}}).
793+
The announce enables the relay to know which publisher to forward a
794+
SUBSCRIBE to.
772795

773796
Relays MUST ensure that publishers are authorized by:
774797

775798
- Verifying that the publisher is authorized to publish the content
776799
associated with the set of tracks whose Track Namespace matches the
777-
announced namespace. Specifics of where the authorization happens,
778-
either at the relays or forwarded for further processing, depends on
779-
the way the relay is managed and is application specific (typically
780-
based on prior business agreement).
800+
announced namespace. Where the authorization and identification of
801+
the publisher occurs depends on the way the relay is managed and
802+
is application specific.
781803

782804
Relays respond with an ANNOUNCE_OK or ANNOUNCE_ERROR control message
783805
providing the result of announcement. The entity receiving the
784806
ANNOUNCE MUST send only a single response to a given ANNOUNCE of
785-
either ANNOUNCE_OK or ANNOUNCE_ERROR. When a publisher wants to stop
807+
either ANNOUNCE_OK or ANNOUNCE_ERROR.
808+
809+
A Relay can receive announcements from multiple publishers for the same
810+
Track Namespace and it SHOULD respond with the same response to each of the
811+
publishers, as though it was responding to an ANNOUNCE
812+
from a single publisher for a given tracknamespace.
813+
814+
When a publisher wants to stop
786815
new subscriptions for an announced namespace it sends an UNANNOUNCE.
787816
A subscriber indicates it will no longer route subscriptions for a
788817
namespace it previously responded ANNOUNCE_OK to by sending an
@@ -794,13 +823,52 @@ match on track namespace unless otherwise negotiated by the application.
794823
For example, a SUBSCRIBE namespace=foobar message will be forwarded to
795824
the session that sent ANNOUNCE namespace=foobar.
796825

826+
When a relay receives an incoming SUBSCRIBE request that triggers an
827+
upstream subscription, it SHOULD send a SUBSCRIBE request to each
828+
publisher that has announced the subscription's namespace, unless it
829+
already has an active subscription for the Objects requested by the
830+
incoming SUBSCRIBE request from all available publishers.
831+
832+
When a relay receives an incoming ANNOUCE for a given namespace, for
833+
each active upstream subscription that matches that namespace, it SHOULD send a
834+
SUBSCRIBE to that publisher that send the ANNOUNCE.
835+
797836
OBJECT message headers carry a short hop-by-hop `Track Alias` that maps to
798837
the Full Track Name (see {{message-subscribe-ok}}). Relays use the
799838
`Track Alias` of an incoming OBJECT message to identify its track and find
800839
the active subscribers for that track. Relays MUST forward OBJECT messages to
801840
matching subscribers in accordance to each subscription's priority, group order,
802841
and delivery timeout.
803842

843+
### Graceful Publisher Network Switchover
844+
845+
This section describes behavior that a publisher MAY
846+
choose to implement to allow for a better users experience when
847+
switching between networks, such as WiFi to Cellular or vice versa.
848+
849+
If the original publisher detects it is likely to need to switch networks,
850+
for example because the WiFi signal is getting weaker, and it does not
851+
have QUIC connection migration available, it establishes a new session
852+
over the new interface and sends an ANNOUCE. The relay will forward
853+
matching subscribes and the publisher publishes objects on both sessions.
854+
Once the subscriptions have migrated over to session on the new network,
855+
the publisher can stop publishing objects on the old network. The relay
856+
will drop duplicate objects received on both subscriptions.
857+
Ideally, the subscriptions downstream from the relay do no observe this
858+
change, and keep receiving the objects on the same subscription.
859+
860+
### Graceful Publisher Relay Switchover
861+
862+
This section describes behavior that a publisher MAY choose to implement
863+
to allow for a better user experience when a relay sends them a GOAWAY.
864+
865+
When a publisher receives a GOAWAY, it starts the process of
866+
connecting to a new relay and sends announces, but it does not immediately
867+
stop publishing objects to the old relay. The new relay will send
868+
subscribes and the publisher can start sending new objects to the new relay
869+
instead of the old relay. Once objects are going to the new relay,
870+
the announcement and subscription to the old relay can be stopped.
871+
804872
## Relay Object Handling
805873

806874
MOQT encodes the delivery information for a stream via OBJECT headers

0 commit comments

Comments
 (0)