Re: [rtcweb] JSEP: codecs in answer: ordering (was codecs in answer: MUST vs. MAY)

Jonathan Lennox <jonathan@vidyo.com> Fri, 27 October 2017 20:05 UTC

Return-Path: <jonathan@vidyo.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 31B7C13F445 for <rtcweb@ietfa.amsl.com>; Fri, 27 Oct 2017 13:05:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.1
X-Spam-Level:
X-Spam-Status: No, score=-1.1 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_SORBS_WEB=1.5, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=vidyo-com.20150623.gappssmtp.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 RqWx65lY4wCt for <rtcweb@ietfa.amsl.com>; Fri, 27 Oct 2017 13:05:16 -0700 (PDT)
Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::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 49D8213F43F for <rtcweb@ietf.org>; Fri, 27 Oct 2017 13:05:16 -0700 (PDT)
Received: by mail-qk0-x235.google.com with SMTP id n5so9730794qke.11 for <rtcweb@ietf.org>; Fri, 27 Oct 2017 13:05:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vidyo-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=7Vo4gsAsZKC/Fbx44G3wV1fUxXQQM7rU8t2GhJmpQSg=; b=WOucHpdrfRZzw4va6OD5eyanyhhuC9kD3VXqOcu9kxElhh2oycqHMqYOJ4tCkrAlIS xVBVc6OXQyEuPSgXio9iFAGOo9k8r+ZNFsG4o29O93HBU/FewFhQL/p9XDOQqsLGRR1H 5AGm0BSl1lXq178+U/KLwwTP0A3YXeqxdQin2y2g+kxwxY02CKstyNJA4a0b76q6PLN6 F1vXPQZIYo+7OdIyRc9bmDsSqZDnEvt64URZn+jCpGnkvz7My7Om+ndbrjp1FhYWiJ5+ y5k2DwNzpW+NelBb10yO5O24hVeLVWz/2LFnoU8e8IkCQl+eSd8SdW9X5Q3BsBi4Kf8L teRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=7Vo4gsAsZKC/Fbx44G3wV1fUxXQQM7rU8t2GhJmpQSg=; b=tgpqF02d0eve0qXO20zVxqWkPBqK/GOCuAkrv80q7y3GFycNm9tPO/lO+a0boZ271F Jn+rdHcmTUlY5+CpkR1nAZiKN8RHWvXwnAu7GNEnMyVNCGrFfsl93YrC7envDAGsVppx Zat5TmZei+W35ALQBhdOT8HQCPEoGlizqkVHs6MlOVZCCcOTPU+UBdmaq086Auxxb/y+ XFMXKlYwwyvDaJPKRmd40ZamZfqAlBhvF2vUiipE6/I+4zsHava8cabdtKoucjUhQudG b4bf8tFuJ1o+UvJu9rcZb1bQi7G7HExSnTMtSksd6WSYdyZiCvhgy5zNdZhi+WvqdZFW NPlw==
X-Gm-Message-State: AMCzsaXtFKAAMiHDz5mL/ZcXhTmSSgEVfIzy4vOt5ohTDkvwSfyQpisd yPJ1yGkaa7KwMcId6JrQbz0F/A==
X-Google-Smtp-Source: ABhQp+S3NrJYdBoJAVzVZxVnHcB2Bma4hNNS/TaaXz/D+0JVsOtUcF7Ki8E1R7OZ7umGsvVBsrWGsw==
X-Received: by 10.55.27.136 with SMTP id m8mr2610669qkh.356.1509134715329; Fri, 27 Oct 2017 13:05:15 -0700 (PDT)
Received: from [172.16.2.142] ([160.79.219.114]) by smtp.gmail.com with ESMTPSA id o70sm5609657qki.35.2017.10.27.13.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Oct 2017 13:05:14 -0700 (PDT)
Content-Type: multipart/alternative; boundary="Apple-Mail=_2C18E05B-98AB-47B0-B97B-F9C54BFDD655"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Jonathan Lennox <jonathan@vidyo.com>
In-Reply-To: <2CFCA859-B941-4AFF-B80A-792509EED6F5@vidyo.com>
Date: Fri, 27 Oct 2017 16:05:13 -0400
Cc: Ted Hardie <ted.ietf@gmail.com>, "rtcweb@ietf.org" <rtcweb@ietf.org>
Message-Id: <7CA6CF4C-6A92-4198-B2E6-10FB5EC6EA5D@vidyo.com>
References: <4CB5EF91-8CB2-433F-85E9-A86140CECC62@vidyo.com> <CA+9kkMDJEggHar5JbBb9GaNMBsZjgvO0F2VN5UVObv-3VTzE4w@mail.gmail.com> <CAOJ7v-2FEpidRsFf3Km5XjW5Jj7gXC2h9Pcy_GWOqb_P7jTHQw@mail.gmail.com> <2CFCA859-B941-4AFF-B80A-792509EED6F5@vidyo.com>
To: Justin Uberti <juberti@google.com>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/ImpSkEAVP0jUJdQqZJ1E19FqskA>
Subject: Re: [rtcweb] JSEP: codecs in answer: ordering (was codecs in answer: MUST vs. MAY)
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: Fri, 27 Oct 2017 20:05:17 -0000

Another question about JSEP’s codec answer rules.

The spec currently says:
>>    o  Otherwise, the media formats on the m= line MUST be generated in
>>       the same order as those offered in the current remote description,
>>       excluding any currently unsupported formats.  Any currently
>>       available media formats that are not present in the current remote
>>       description MUST be added after all existing formats.
>> 
>> This is what you do if codec preferences are not set (keep the order, add any new ones to the end)

Why are remotely-unsupported codecs added at the end of the list, rather than just listing all locally-supported codecs in the browser’s preference order?

My concern is in an SFU conferencing scenario.  Consider the following:

* Participant 1 joins a conference.  It supports only codec A.
* Participant 2 joins the conference.  It supports codecs A and B, but prefers B.  Since the conference can only do A, if the offer/answer exchange goes SFU->Participant, the participant’s answer must list its codecs as A, B.
* Participant 3 joins the conference.  It is the same as Participant 2, preferring B to A.

If participant 1 leaves, the SFU can re-offer to participants 2 and 3; but as far as it knows, everyone prefers A to B, so the conference can end up in a scenario where everyone’s using a less-preferred codec.

I would suggest that instead, the browser’s codec preference order always be sent as-is in an answer (unless overridden by the app with setCodecPreferences).  This also has the benefit of aligning the behavior with and without app codec preferences, rather than having two separate behaviors (where the order is fixed if the app has set codec preferences, and mirrored otherwise).