Re: [rtcweb] JSEP: RTP demux algorithms

Peter Thatcher <pthatcher@google.com> Fri, 16 September 2016 18:48 UTC

Return-Path: <pthatcher@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 A6B0512B2D4 for <rtcweb@ietfa.amsl.com>; Fri, 16 Sep 2016 11:48:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.208
X-Spam-Level:
X-Spam-Status: No, score=-4.208 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_LOW=-0.7, RP_MATCHES_RCVD=-1.508, SPF_PASS=-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 IhJAbd2zFF6p for <rtcweb@ietfa.amsl.com>; Fri, 16 Sep 2016 11:48:15 -0700 (PDT)
Received: from mail-vk0-x230.google.com (mail-vk0-x230.google.com [IPv6:2607:f8b0:400c:c05::230]) (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 393FA12B2D1 for <rtcweb@ietf.org>; Fri, 16 Sep 2016 11:48:15 -0700 (PDT)
Received: by mail-vk0-x230.google.com with SMTP id b133so38627343vka.2 for <rtcweb@ietf.org>; Fri, 16 Sep 2016 11:48:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=iE6r/YlnaweQWrlyxluu9tGUd6KMyJb0eQ39uSeBs0k=; b=E7Kld2eWpD/YFU3kICZkFjviyQRJCAPj9H6cgXgmwdA7lOIFHOd0TF+NVIKyg1PCi5 vDrhVohY4mbu1Lojn/7CBpsBe1KQc7LQTDGsMbNGsif9I46eSqdwGEmyD1u4UgJSVsBr 4B9fRdiSqeBm19zrp/qJD4CQwOGYWBhft05as3Jc+cRe8FE26Z1UH5xchI63ktoTsI0v PktfgVfZ/1JofcxjPLsSD+wFcVmdCMr8yOUDfnXC2TVUJXKIxINNXAJnhCc6cnRbbANT ndEO8+LX++ZgudRRWKyvG/hkXg51mDA/9lBAwlyDolRQl+gO5ISe+Y6fyP5Ig1hAzIC6 iBfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=iE6r/YlnaweQWrlyxluu9tGUd6KMyJb0eQ39uSeBs0k=; b=E9881yUBl8LdLLBXtOJ6a/nzWrIC+kIG6ttvuCGU/8XbxyBFFZobdDopi/LPKNmHVo E7YBqD5WfHa8uvoK2AF4S8Ne63ofo1z4KmUQmCYU6q1DshTFfDSKrxlyzGt06MPnvgMP 1wCz2v1A8BuKxl6oIHumZCtduXZMP/L+BX0V8vx/RbE87mWnqGNOLP8AWuVdZH0Wmt7l PSX6jc56BcJ3aLKT77KJcTnNnKWWGoj+CixTA9WiB2fwtYbGKlSodUGDCFXxMrtZGzQd h42mJ6MIUvQQcW81tAB0QcXVzoWTNbKz/yPj8prAhvou3dLyV7F63eenBFcdbmDXG3y3 SjJw==
X-Gm-Message-State: AE9vXwP2YkfzpXOpBr7rT7FvKSIAldOrSEh06oKg+zChWuK589WP4ZeXpyCeHuVQ+c2IQ8p+UD3lv52D1qC1i4/V
X-Received: by 10.31.152.194 with SMTP id a185mr5061931vke.59.1474051694290; Fri, 16 Sep 2016 11:48:14 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.159.34.196 with HTTP; Fri, 16 Sep 2016 11:47:33 -0700 (PDT)
In-Reply-To: <CAJrXDUHAc9Gi=sqtFdZ4F-HjY-8w1m=6pJ2VjfkFAhrt_ja9rw@mail.gmail.com>
References: <CAOW+2dtN-tfmnsep8FjOFD2R2uZbUwZxHfDGBwx3N13Ue9Nb2w@mail.gmail.com> <CAJrXDUHAc9Gi=sqtFdZ4F-HjY-8w1m=6pJ2VjfkFAhrt_ja9rw@mail.gmail.com>
From: Peter Thatcher <pthatcher@google.com>
Date: Fri, 16 Sep 2016 11:47:33 -0700
Message-ID: <CAJrXDUG=AaYvEeV-U=nGEcS1M=E+ihO63K0tsqWkubwaAqnoRA@mail.gmail.com>
To: Bernard Aboba <bernard.aboba@gmail.com>
Content-Type: multipart/alternative; boundary="001a1141d9c49eae8a053ca467a2"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/UBLO4YkOxefSXGsxiI1x2nCc4sY>
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>, Robin R <robin@myjoe.com>
Subject: Re: [rtcweb] JSEP: RTP demux algorithms
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.17
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, 16 Sep 2016 18:48:17 -0000

By the way, as I mentioned elsewhere, I think we should not use RIDs for
demux between RtpReceivers, and only use them within an RtpReceiver.  Demux
between RtpReceivers should be done with MID.

On Fri, Sep 16, 2016 at 11:45 AM, Peter Thatcher <pthatcher@google.com>
wrote:

> I agree 100% that having a set of unit tests for the demux alogirthm.  I
> found it very difficult to write the algorithm in a way that covered all
> the known cases by just keeping all the cases in my head.  Any tweak (like
> swapping step 2 and step 3) can break something that you forget about.
> Having a set of unit tests would help a lot.
>
> I think we would need to formulate a unit test like this.  Each test is a
> series of 3 operations:
>
> 1.  Add an RtpReceiver with MID A, SSRCs 1, 2, 3, and PTs 4, 5, 6.
> 2.  Route a packet with MID X (or unset), SSRC 1, PT 2.
> 3.  Remove an RtpReceiver
>
>
> Then we have tests like:
>
> 1.  Add X
> 2.  Add Y
> 3.  Route Z
>
> Or:
>
> 1.  Add X
> 2.  Route Y
> 3.  Add Y
> 4.  Remove X
> 4.  Route Z
>
>
> Then I could write a little python to check these things.
>
>
>
> On Wed, Sep 14, 2016 at 10:49 AM, Bernard Aboba <bernard.aboba@gmail.com>
> wrote:
>
>> There is now a JSEP PR relating to RTP demux algorithms:
>> https://github.com/rtcweb-wg/jsep/pull/320
>>
>> Rather than commenting in detail on that PR in this post, I would like to
>> prove some thoughts on how we evaluate proposed RTP demux algorithms.
>>
>> The goal of an RTP demux algorithm is to determine whether an incoming
>> RTP packet received on a DtlsTransport can be forwarded to one of the
>> RtpReceivers attached to that DtlsTransport.  If none of the RtpReceivers
>> qualify, then the packet is either dropped (WebRTC 1.0) or generates an RTP
>> unhandled event (ORTC).
>>
>> In principle, RTP demux algorithms do not seem complicated, since they
>> often can be expressed in less than half a dozen steps, typically with less
>> than a page of text.
>>
>> However, in practice the difficulty has turned out to be not in stating
>> an algorithm, but in evaluating whether it is correct. This challenges
>> include:
>>
>> 1. Agreement on a set of use cases and desired outcomes that a proposed
>> algorithm must satisfy.  Think of this as a set of regression tests that
>> insure that a proposed algorithm behaves as we expect, as well as ensuring
>> that changes to that algorithm do not result in unintended consequences.
>>
>> 2. Agreement on all the inputs that the algorithm takes into account.
>> This includes fields within the RTP packet (e.g. SSRC, PT, RID, MID, etc.)
>> as well as methods within the API (e.g. setLocalDescription,
>> setRemoteDescription, setParameters, etc.).
>>
>> With respect to Issue #1, some of the trickiest use cases involve both PT
>> and SSRC signaling, SSRC "latching" and handling FEC and RTX.  Examples
>> include:
>>     a. Change of SSRCs (e.g. due to conflict).
>>     b. Codec switching (e.g. changing PT but same SSRC, or changing both
>> PT and SSRC).
>>     c. Use of both FEC and RTX (and perhaps RTX of FEC).
>>
>> IMHO it would be useful to come up a few (less than half a dozen) use
>> cases with agreed-upon outcomes.
>>
>> With respect to Issue #2, the proposed algorithms so far look at the SSRC
>> & PT fields in the RTP header as well as the MID RTP extension.  However, I
>> have not seen algorithms which take into account the role of the RID RTP
>> extension.  So agreement on whether the RID needs to be considered or not
>> would be helpful.
>>
>> Also, for WebRTC 1.0 it would appear to me that the algorithm will depend
>> on the inputs to the setLocalDescription/setRemoteDescription methods,
>> so that there is a potential dependency on the signaling state of the
>> PeerConnection.
>>
>> Overall, I believe that the discussion of RTP demux algorithms is likely
>> to go more smoothly (and conclude more quickly) if we get agreement on
>> these meta-issues upfront.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>