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

Taylor Brandstetter <deadbeef@google.com> Mon, 16 October 2017 18:29 UTC

Return-Path: <deadbeef@google.com>
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 B0FD7134534 for <rtcweb@ietfa.amsl.com>; Mon, 16 Oct 2017 11:29:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
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 TbfyrGIAXHqB for <rtcweb@ietfa.amsl.com>; Mon, 16 Oct 2017 11:29:02 -0700 (PDT)
Received: from mail-ua0-x235.google.com (mail-ua0-x235.google.com [IPv6:2607:f8b0:400c:c08::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CFAAA134532 for <rtcweb@ietf.org>; Mon, 16 Oct 2017 11:29:01 -0700 (PDT)
Received: by mail-ua0-x235.google.com with SMTP id b11so10346633uae.12 for <rtcweb@ietf.org>; Mon, 16 Oct 2017 11:29:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wW5ioRhJnovNxwSNi29waDck2luhlYW4cRRx+ZgNTbE=; b=MZXf+1/TmWyIxfKMIxI3yI/hYMaIrtSJrU/DDCIyb7F0QF+JRF+sREGNTjAG+emIoW Q7J3iMYrI7wj9vVCu9SlzrOXz+yyjOa8myijvVL515rFOoMGCVHVRACxem5yTAy0vA8d KUad7J56NlRMlbRfq8pZkD4fyvZRpAN0L0CINyDYussM8ORI0Rnsv5JMfB0nMzjR0f1s p3Fpkgm/DezbxHaM5qKBASpDP3HtahXEvQTB3WqLOArUL+iLyV1QVFFLJA+zXzThxV20 JagADeJE8gotQE06cN3tMRtlpi9GTuPYlezx45NF3Vu+QVk6Zf1edjGEawYoPlbENFuN ObcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wW5ioRhJnovNxwSNi29waDck2luhlYW4cRRx+ZgNTbE=; b=kYQxpBW0OYP6nlirWRv8SNGXFruXL4fUM9MmFCK3IusyedrT5azG3yCS8pQMRFcFwJ NCcDnnniE/uxEOh28ixZpvWtX8WWcifsAcRgaM46U+d/6Rr1G32V24erXv+nnhW7Ibwz HKXOCcpPoIfd1i4ar0DviMr9TmvnE8Oef+ZUPtCbSG6UAG7ow3Rvwp5wULjYmgQG58T9 JzPYxVLN5eDCwXwwQXzHkXnSc4hnyhvhSkP6f01diOp20BzpISKV04xI4PX6taPj3e7n v/Am3s3iXIVuEKkQ8miKToJcyoB2PSw3eJlZEMr2pgdrYLdieAOc/tL5XO1T1wzmnqly g2tA==
X-Gm-Message-State: AMCzsaWWZFXdBcb9s9uvYHYyKSPx6hlYT6ow79Vjkc3LH4zJGp2VfDFC ouKZTQ78O+c9G9E5wurECANQVZa0pxJYKry7cnaPOw==
X-Google-Smtp-Source: ABhQp+QeR35BoNes2Z+hLMFiBZIWGsrPZiIqTZH5rCDeEpxfnek84CdMGFxMc5cy4nO6oBJ234dEX/z8GbMAXSaErII=
X-Received: by 10.176.87.89 with SMTP id t25mr8028990uac.76.1508178540666; Mon, 16 Oct 2017 11:29:00 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.31.169.130 with HTTP; Mon, 16 Oct 2017 11:28:59 -0700 (PDT)
In-Reply-To: <183cc5c2-470b-0dab-d474-7f22134f867a@ericsson.com>
References: <CAK35n0Z6_N9iMZ3F2y1QXG1M9Efx4ha9sm8CBcahzjYtHwWSEg@mail.gmail.com> <183cc5c2-470b-0dab-d474-7f22134f867a@ericsson.com>
From: Taylor Brandstetter <deadbeef@google.com>
Date: Mon, 16 Oct 2017 11:28:59 -0700
Message-ID: <CAK35n0Y90137Y5hsMgS-1XoLsW5V9hkMpd1MNf9JUT7OrJKGcw@mail.gmail.com>
To: Magnus Westerlund <magnus.westerlund@ericsson.com>
Cc: RTCWeb IETF <rtcweb@ietf.org>
Content-Type: multipart/alternative; boundary="f403045e61902d2979055bae2eb5"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/BUyfUuS7QoEXv0B5rLELA6QlnAs>
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: Mon, 16 Oct 2017 18:29:13 -0000

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

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).


On Mon, Oct 16, 2017 at 5:10 AM, Magnus Westerlund <
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)
>
> 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 listrtcweb@ietf.orghttps://www.ietf.org/mailman/listinfo/rtcweb
>
>
> --
>
> Magnus Westerlund
>
> ----------------------------------------------------------------------
> Media Technologies, Ericsson Research
> ----------------------------------------------------------------------
> Ericsson AB                 | Phone  +46 10 7148287 <+46%2010%20714%2082%2087>Torshamnsgatan 23 <https://maps.google.com/?q=Torshamnsgatan+23&entry=gmail&source=g>           | Mobile +46 73 0949079 <+46%2073%20094%2090%2079>
> SE-164 80 Stockholm, Sweden | mailto: magnus.westerlund@ericsson.com
> ----------------------------------------------------------------------
>
>