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

Proposal: Subscriber Prioritization #411

Open
kixelated opened this issue Mar 6, 2024 · 2 comments
Open

Proposal: Subscriber Prioritization #411

kixelated opened this issue Mar 6, 2024 · 2 comments
Labels
Transmission Issues involving what to transmit when, what to drop, priorities, etc

Comments

@kixelated
Copy link
Collaborator

kixelated commented Mar 6, 2024

I know we're not allowed to talk about priorities any longer but I wanted to float another option.

The subscriber is in charge of prioritization:

  • Add order to SUBSCRIBE: ASC or DESC
  • Add priority to SUBSCRIBE: VarInt?
  • Remove send_order from OBJECT.

The publisher prioritizes streams based on:

let order = subscribe.order == DESC ? 1 : -1;
subscribe.priority > object.group * order > -object.id

Depending on the QUIC API, publisher still needs to compute a send order for each stream. It can do this by inserting each stream into a priority queue based on the above comparison, using the resulting position in the queue as the send order. This was already a requirement for QUIC APIs that did not support a u64 send order.

Alternatively, a QUIC API could implement nested priority groups, perhaps something like sendGroup.

Pros: Order

The benefits of order=ASC are similar to the proposed FETCH API in #368.

  • Supports HLS/DASH-like experiences, where playback buffers instead of skips.
  • Supports VOD playback.
  • Supports advertisement playback.

Note that you could perform head-of-line blocking today* by issuing a SUBSCRIBE per group. However this is quite verbose, and it creates an RTT at the end of each group where the network is not being utilized.

Pros: Priority

  • Supports prioritizing unrelated tracks (from different encoders).
  • Supports prioritizing based on focus state (sideline cam > main cam)
  • Supports prioritizing high bitrate (main cam > sideline cam)
  • The encoder is dumb, unaware of network priorities.

These could only be performed today by rewriting send order at a relay, which is impossible without catalog access.

Cons

  • SUBSCRIBE is even more complicated.
  • No interleaved prioritizes between tracks/groups. (who cares?)
  • Publisher has to compute/update send order on each stream/datagram created.
  • Relay has to deduplicate conflicting SUBSCRIBEs

The main challenge is the last one. For example, two viewers could issue:

SUBSCRIBE track=720p order=ASC priority=3
SUBSCRIBE track=720p order=DESC priority=9

What does the relay send upstream? The idea behind publisher prioritization was to avoid this dilemma, but maybe there's another way we can solve it.

@kixelated kixelated changed the title Proposal: Subscriber prioritization Proposal: Subscriber Prioritization Mar 6, 2024
@kixelated
Copy link
Collaborator Author

kixelated commented Mar 6, 2024

One dumb idea for the publisher prioritization dilemma is to put the "preferred" priority and order for each track in ANNOUNCE. A relay could choose to use this information when fetching upstream, instead of relying on the values provided by N subscribers.

However this would require switching ANNOUNCE to be per-track instead of per-namespace as it is currently.

@ianswett ianswett added the Transmission Issues involving what to transmit when, what to drop, priorities, etc label Mar 18, 2024
@ianswett
Copy link
Collaborator

The FETCH/SUBSCRIBE split solves your largest CON above, because there can only be one active SUBSCRIBE for a track at once.

Otherwise this SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Transmission Issues involving what to transmit when, what to drop, priorities, etc
Projects
None yet
Development

No branches or pull requests

2 participants