Skip to content

Commit c94b36b

Browse files
authored
Rewrite the Priority section to improve clarity (moq-wg#518)
This change provides a step-by-step algorithm for how to pick the next object to send, and which priorities take precedence over another, all in one place. This PR may or may not change the normative behavior of priorities depending on one's interpretation of the current text (which, as we learned in today's call, appears to vary between people). Fixes moq-wg#517 Closes moq-wg#585
2 parents 139a999 + 46dbf7e commit c94b36b

File tree

1 file changed

+60
-46
lines changed

1 file changed

+60
-46
lines changed

draft-ietf-moq-transport.md

Lines changed: 60 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -617,56 +617,70 @@ MoQ priorities allow a subscriber and original publisher to influence
617617
the transmission order of Objects within a session in the presence of
618618
congestion.
619619

620+
## Definitions
621+
622+
MoQT maintains priorities between different _schedulable objects_.
623+
A schedulable object in MoQT is either:
624+
625+
1. An object that belongs to a peep where that object would be the next object
626+
to be sent in that peep.
627+
1. An object that belongs to a track with delivery preference Datagram.
628+
629+
Since a single peep or datagram has a single publisher priority, it can be
630+
useful to conceptualize this process as scheduling peeps or datagrams
631+
instead of individual objects on them.
632+
633+
A _priority number_ is an unsigned integer with a value between 0 and 255.
634+
A lower priority number indicates higher priority; the highest priority is 0.
635+
636+
_Subscriber Priority_ is a priority number associated with an individual
637+
subscription. It is specified in the SUBSCRIBE message, and can be updated via
638+
SUBSCRIBE_UPDATE message. The subscriber priority of an individual schedulable
639+
object is the subscriber priority of the subscription that caused that object
640+
to be sent. When subscriber priority is changed, a best effort SHOULD be made
641+
to change the apply that to all objects that have not been sent, but it is
642+
implementation dependent what happens to objects that have already been
643+
received and possibly scheduled.
644+
645+
_Publisher Priority_ is a priority number associated with an indiviaul
646+
schedulable object. It is specified in the header of the respective peep or
647+
datagram, and is the same for all objects in a single peep.
648+
649+
_Group Order_ is a property of an invidual subscription. It can be either
650+
'Ascending' (groups with lower group ID are sent first), or 'Descending'
651+
(groups with higher group ID are sent first). The publisher communicates its
652+
group order in the SUBSCRIBE_OK message; the subscriber can override it in its
653+
SUBSCRIBE message. The group order of an existing subscription cannot be
654+
changed.
655+
656+
## Scheduling Algorithm
657+
658+
When an MoQT publisher has multiple schedulable objects it can choose between,
659+
the objects SHOULD be selected as follows:
660+
661+
1. If two objects have a different subscriber priority associated with them,
662+
the one with **the highest subscriber priority** is sent first.
663+
1. If two objects have the same subscriber priority, but a different publisher
664+
priority, the one with **the highest publisher priority** is sent first.
665+
1. If two objects have the same subscriber and publisher priority, but belong
666+
to two different groups of the same track received through the same
667+
subscription, **the group order** of the associated subscription is used to
668+
decide the one that is sent first.
669+
1. If two objects belong to the same group of the same track received through
670+
the same subscription, the one with **the lowest Peep ID** (for tracks with
671+
delivery preference Peep), or **the lowest Object ID** (for tracks with
672+
delivery preference Datagram) is sent first.
673+
674+
This algorithm does not provide a well-defined ordering for objects that belong
675+
to different subscriptions, but have the same subscriber and publisher
676+
priority. The ordering in those cases is implementation-defined, though the
677+
expectation is that all subscriptions will be able to send some data.
678+
620679
Given the critical nature of control messages and their relatively
621680
small size, the control stream SHOULD be prioritized higher than all
622681
subscribed Objects.
623682

624-
Both SUBSCRIBE and FETCH messages indicate a subscriber priority and
625-
group order, so the following text applies equally to both types of
626-
subscriptions.
627-
628-
The subscriber indicates the priority of a subscription via the
629-
Subscriber Priority field and the original publisher indicates priority
630-
in every stream or datagram header. As such, the subscriber's priority is a
631-
property of the subscription and the original publisher's priority is a
632-
property of the Track and the Objects it contains. In both cases, a lower
633-
value indicates a higher priority, with 0 being the highest priority.
634-
635-
When Objects are contained in Subgroups, all Objects in the Subgroup have the same
636-
priority.
637-
638-
The Subscriber Priority is considered first when selecting a subscription
639-
to send data on within a given session. When two or more subscriptions
640-
have equal subscriber priority, the original publisher priority is considered
641-
next and can change within the track, so subscriptions are prioritized based
642-
on the highest priority data available to send. For example, if the subscription
643-
had data at priority 6 and priority 10 to send, the subscription priority would
644-
be 6. When both the subscriber and original publisher priorities for a
645-
subscription are equal, how much data to send from each subscription is
646-
implementation-dependent, but the expectation is that all subscriptions will
647-
be able to send some data.
648-
649-
The subscriber's priority can be changed via a SUBSCRIBE_UPDATE message.
650-
This updates the priority of all unsent data within the subscription,
651-
though the details of the reprioritization are implementation-specific.
652-
653-
Subscriptions have a Group Order of either 'Ascending' or 'Descending',
654-
which indicates whether the lowest or highest Group Id SHOULD be sent first
655-
when multiple Groups are available to send. A subscriber can specify either
656-
'Ascending' or 'Descending' in the SUBSCRIBE message or they can specify they
657-
want to use the Original Publisher's Group Order, which is indicated in
658-
the corresponding SUBSCRIBE_OK.
659-
660-
Within the same Group, and the same priority level,
661-
Objects with a lower Object Id are always sent before objects with a
662-
higher Object Id, regardless of the specified Group Order. If the group
663-
contains more than one Subgroup and the priority varies between these Subgroups,
664-
higher priority Subgroups are sent before lower priority Subgroups. If the specified
665-
priority of two Subgroups in a Group are equal, the lower Subgroup ID has priority.
666-
Within a Subgroup, Objects MUST be sent in increasing Object ID order.
667-
668-
The Group Order cannot be changed via a SUBSCRIBE_UPDATE message, and
669-
instead an UNSUBSCRIBE and SUBSCRIBE can be used.
683+
## Considerations for Setting Priorities
670684

671685
Relays SHOULD respect the subscriber and original publisher's priorities.
672686
Relays SHOULD NOT directly use Subscriber Priority or Group Order

0 commit comments

Comments
 (0)