Re: [rtcweb] Issue with "priority" defined in rtcweb-transports

Harald Alvestrand <harald@alvestrand.no> Tue, 17 October 2017 14:45 UTC

Return-Path: <harald@alvestrand.no>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A81F5134212 for <rtcweb@ietfa.amsl.com>; Tue, 17 Oct 2017 07:45:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mR36SKrYMy12 for <rtcweb@ietfa.amsl.com>; Tue, 17 Oct 2017 07:45:48 -0700 (PDT)
Received: from mork.alvestrand.no (mork.alvestrand.no [158.38.152.117]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EFCD2132F30 for <rtcweb@ietf.org>; Tue, 17 Oct 2017 07:45:47 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mork.alvestrand.no (Postfix) with ESMTP id 686B37C32DB; Tue, 17 Oct 2017 16:45:46 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at alvestrand.no
Received: from mork.alvestrand.no ([127.0.0.1]) by localhost (mork.alvestrand.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7EMz6YXZWQuj; Tue, 17 Oct 2017 16:45:45 +0200 (CEST)
Received: from [IPv6:2001:470:de0a:1::5ea] (unknown [IPv6:2001:470:de0a:1::5ea]) by mork.alvestrand.no (Postfix) with ESMTPSA id EB51D7C0AF4; Tue, 17 Oct 2017 16:45:44 +0200 (CEST)
To: Taylor Brandstetter <deadbeef@google.com>, Magnus Westerlund <magnus.westerlund@ericsson.com>
Cc: RTCWeb IETF <rtcweb@ietf.org>
References: <CAK35n0Z6_N9iMZ3F2y1QXG1M9Efx4ha9sm8CBcahzjYtHwWSEg@mail.gmail.com> <183cc5c2-470b-0dab-d474-7f22134f867a@ericsson.com> <CAK35n0Y90137Y5hsMgS-1XoLsW5V9hkMpd1MNf9JUT7OrJKGcw@mail.gmail.com>
From: Harald Alvestrand <harald@alvestrand.no>
Message-ID: <85ff04f8-bcae-8561-9866-48d5c16bf0a1@alvestrand.no>
Date: Tue, 17 Oct 2017 16:45:44 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
MIME-Version: 1.0
In-Reply-To: <CAK35n0Y90137Y5hsMgS-1XoLsW5V9hkMpd1MNf9JUT7OrJKGcw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/NP3da70-xGMkfynuuGz0TWp21Is>
Subject: Re: [rtcweb] Issue with "priority" defined in rtcweb-transports
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rtcweb/>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Oct 2017 14:45:51 -0000

Den 16. okt. 2017 20:28, skrev Taylor Brandstetter:
> This is something that came up in the WebRTC virtual interim as well
> (but for the simulcast use case, rather than audio vs. video). When
> bandwidth is constrained, you don't necessarily want to send multiple
> simulcast layers, each with a low bitrate. You want to start by sending
> only the lowest quality encoding, until you have enough bits to send the
> next encoding, etc.
> 
> I think we could meet most everyone's use cases with a combination of:
> 
>   * Priority
>   * Min bitrate
>   * Max bitrate
>   * "Relative" bitrate ratio

My thinking is that this grows very complex.

I don't think we have much chance of getting this right for all use
cases. For instance, screenshare-type video varies enormously in
bandwidth (very low at static images, enormous at slide change) - if it
competes against audio, a "relative" bitrate ratio will not be useful at
all.

> 
> For example, suppose I set up simulcast layers like so:
> 
> encodings = [
> {
>   rid: "f",
>   priority: "low",
>   minBitrate:  600000,
>   maxBitrate: 2500000,
>   relativeBitrate: 4.0
> },
> {
>   rid: "h",
>   priority: "medium",
>   scaleResolutionDownBy: 2.0,
>   minBitrate: 150000,
>   maxBitrate: 700000,
>   relativeBitrate: 2.0
> },
> {
>   rid: "q",
>   priority: "high",
>   scaleResolutionDownBy: 4.0,
>   maxBitrate: 200000,
>   relativeBitrate: 1.0
> }
> ]
> 
> The algorithm would be "if you can't meet the minimums of every
> encoding, prioritize the higher priority encodings." So if only 100kbps
> is available, only the "q" (quarter-resolution) encoding would be used.
> If the available bandwidth reaches, say, 300kbps, then it would be split
> between "h" and "q", with a split of 200kbps/100kbps. And so on.
> 
> I believe this is pretty similar to how our hard-coded implementation
> already works (I took some of these values directly from the code
I worry about the complexity of getting this specified. Having code
helps, of course.

I like extension specs. Especially for trying out things where our
solutions may be perfect for some scenarios, but might not work in other
scenarios, and the base specs attempt to cover all cases.

Is there a way we can punt this?

> 
> 
> On Mon, Oct 16, 2017 at 5:10 AM, Magnus Westerlund
> <magnus.westerlund@ericsson.com <mailto:magnus.westerlund@ericsson.com>>
> wrote:
> 
>     Hi Taylor,
> 
>     I think the text you quoted is directly related to your transmission
>     queuing. And as no one was willing to write up a specific queuing
>     algorithm that would be more flexible, the discussion in the WG at
>     the time this was written ended up in a per prioritization level
>     round robin queue basically, where each lower priority is given one
>     transmission slot in the upper queue. Thus giving roughly halving,
>     but it could be less actually depending on how many processes are
>     part of a particular level.
> 
>     I also think you scheme for relative capacity is likely good, but
>     appear to be missing two important parameters. One for minimal
>     bit-rate, and one for maximum. At least for audio sources, there is
>     a limit to scaling these both upwards and downwards. The upper limit
>     when reached should be redistributed, or otherwise it might be
>     wasted. The minimal is an interesting one. Because one have to
>     decided if this means taking more from the lower prioritise and how
>     they relate to other. The classical example of one audio plus one
>     video comes to mind, where one would like to maintain the audio in
>     user interactive applications despite taking more from the video. To
>     the point where one have to turn off video to maintain audio.
> 
>     So, I think you have to work on the proposal a bit more.
> 
>     Cheers
> 
>     Magnus
> 
> 
>     Den 2017-10-11 kl. 19:29, skrev Taylor Brandstetter:
>>
>>     (Mainly copied from https://github.com/w3c/webrtc-pc/issues/1625
>>     <https://github.com/w3c/webrtc-pc/issues/1625>)
>>
>>     When defining priority, rtcweb-transports says:
>>
>>         The WebRTC prioritization model is that the application tells the
>>         WebRTC endpoint about the priority of media and data that is
>>         controlled from the API.
>>         ...
>>         The priority settings affect two pieces of behavior: Packet send
>>         sequence decisions and packet markings. Each is described in
>>         its own
>>         section below.
>>
>>     The sections below are "Local prioritization" and "Usage of
>>     Quality of Service - DSCP and Multiplexing". The "local
>>     prioritization" section gives this guidance:
>>
>>         When an WebRTC endpoint has packets to send on multiple
>>         streams that
>>         are congestion-controlled under the same congestion control
>>         regime,
>>         the WebRTC endpoint SHOULD cause data to be emitted in such a way
>>         that each stream at each level of priority is being given
>>         approximately twice the transmission capacity (measured in payload
>>         bytes) of the level below.
>>
>>         Thus, when congestion occurs, a "high" priority flow will have the
>>         ability to send 8 times as much data as a "very-low" priority
>>         flow if
>>         both have data to send. This prioritization is independent of the
>>         media type. The details of which packet to send first are
>>         implementation defined.
>>
>>         For example: If there is a high priority audio flow sending
>>         100 byte
>>         packets, and a low priority video flow sending 1000 byte
>>         packets, and
>>         outgoing capacity exists for sending >5000 payload bytes, it
>>         would be
>>         appropriate to send 4000 bytes (40 packets) of audio and 1000
>>         bytes
>>         (one packet) of video as the result of a single pass of sending
>>         decisions.
>>
>>     This has two significant issues I can see:
>>
>>       * It only allows ratios of 1:2:4:8. This is not granular enough
>>         to be very useful. Especially when balancing transmission
>>         capacity between audio tracks and video tracks; in practice
>>         it's common for video tracks to use much more than 8 times the
>>         bitrate of audio tracks.
>>       * A single enum is used for both relative bitrate and relative
>>         QoS priority. But in my experience it's common for an
>>         application to want a flow that uses /less/ bitrate to have
>>         a /higher/ QoS priority. This may even be the /more/ common
>>         situation.
>>
>>     So, why do we have one enum for both things? I'd propose defining
>>     the priority as something that only impacts the priority in
>>     network queues (QoS-level priority and SCTP priority, as
>>     previously discussed), and use something else to control the
>>     relative bitrate allocation.
>>
>>     For example, a floating point value attached to
>>     each |RTCEncodingParameters| (say, |relativeCapacity|), where an
>>     encoding with twice the |relativeCapacity| of another encoding
>>     will be given twice the transmission capacity. If implementations
>>     can handle ratios of 1:2:4:8, I don't see any reason why they
>>     shouldn't be able to handle arbitrary ratios.
>>
>>
>>
>>     _______________________________________________
>>     rtcweb mailing list
>>     rtcweb@ietf.org <mailto:rtcweb@ietf.org>
>>     https://www.ietf.org/mailman/listinfo/rtcweb
>>     <https://www.ietf.org/mailman/listinfo/rtcweb>
> 
>     -- 
> 
>     Magnus Westerlund 
> 
>     ----------------------------------------------------------------------
>     Media Technologies, Ericsson Research
>     ----------------------------------------------------------------------
>     Ericsson AB                 | Phone  +46 10 7148287 <tel:+46%2010%20714%2082%2087>
>     Torshamnsgatan 23
>     <https://maps.google.com/?q=Torshamnsgatan+23&entry=gmail&source=g>           | Mobile +46 73 0949079 <tel:+46%2073%20094%2090%2079>
>     SE-164 80 Stockholm, Sweden | mailto: magnus.westerlund@ericsson.com <mailto:magnus.westerlund@ericsson.com>
>     ----------------------------------------------------------------------
> 
> 
> 
> 
> _______________________________________________
> rtcweb mailing list
> rtcweb@ietf.org
> https://www.ietf.org/mailman/listinfo/rtcweb
>