Re: [rtcweb] Possible to lose initial messages sent by reliable, out-of-band negotiated data channels

Taylor Brandstetter <deadbeef@google.com> Thu, 14 June 2018 17:06 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 E8E0B130E4A for <rtcweb@ietfa.amsl.com>; Thu, 14 Jun 2018 10:06:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.509
X-Spam-Level:
X-Spam-Status: No, score=-17.509 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5] 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 aGV8idyfqb-w for <rtcweb@ietfa.amsl.com>; Thu, 14 Jun 2018 10:06:06 -0700 (PDT)
Received: from mail-ua0-x229.google.com (mail-ua0-x229.google.com [IPv6:2607:f8b0:400c:c08::229]) (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 988CF1294D0 for <rtcweb@ietf.org>; Thu, 14 Jun 2018 10:06:06 -0700 (PDT)
Received: by mail-ua0-x229.google.com with SMTP id d7-v6so4577832uam.13 for <rtcweb@ietf.org>; Thu, 14 Jun 2018 10:06:06 -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=gKkP+S1/NAkJgY3/bOlefhA6viwC+4JXIgAsl1WqXR0=; b=J1bojhKaRIg6/XNPRnBN8xPoRbh4IjkeK0MY2RB2O81JJwdXlFPzqEmf63eS5QCBkq 4oHDY9Fu8EAOq+iK1xzUU1JL5+R9za4Zo67q6UCAhHdYWBaAGaoedbK9EF9BkjV/PjaM vixyxhbStRx+fAyU0q99lsY3ag8mMT925VQulss41PMJqBbbu/L+g/KdsfoqmR/KLcNp h/7vTiDYzPKLs/gIfJSr7XZIri68DU5fDt3L0rWAfP0MITDPHNVCijwhg0LQHBoCrcy9 9DnKbujmx1c5S99BPD7/w7LAcNYkkDgkNHK7XBo7iAXp9BUj3JdMkf5Y4RMNcVLSzQ+4 jmng==
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=gKkP+S1/NAkJgY3/bOlefhA6viwC+4JXIgAsl1WqXR0=; b=OHKSQ/khM+tupznaSrGPZrKuhRdvRoOJttST34M8f+VSB81mJMDri0Di4qFjksuOHp y34Gd9bQP/NPEen0uTuNKgbFFmIkgwFACiLvrtgo4nwXtYUmIZwC+1uXWLJzpxdoZJtS Ir3vUK9PFfdFn73eJph/MhdSEpSTBkhSnekH4SOR/crHztC78Sr83gc8Fua/DjRs9BTQ 7Q57JI3GoP+ZvRhmbWiZqq2LGBJl10VXd02K5VKOzHK+NtHhOZfmmmYMU/bSV+HiObFT sjQWHmLFviyu857uR6XzuTo7Gu4tbeJLuvFaxr3AxiiZf8gr/sIcHGsxdaX2mRMrUaw1 uveA==
X-Gm-Message-State: APt69E2dpjaAoYjTGvCJHLjZ1EUpY+lAa5W7azrtiOMQo7j0E51oT4hl B7IwwN3Zvk9cM2pBMiQW8SPohVpQc6I3vOix3ONaQQ==
X-Google-Smtp-Source: ADUXVKLOKHu0jXyLmVmlm/Q3OTE+5MOvMQm/6yTZ8s9jGQoDF0syzqp3n0bUnQv+r5T0O4GWZ5hChykDYfjLMIWHSsE=
X-Received: by 2002:ab0:718c:: with SMTP id l12-v6mr2413273uao.197.1528995963786; Thu, 14 Jun 2018 10:06:03 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a1f:9302:0:0:0:0:0 with HTTP; Thu, 14 Jun 2018 10:06:03 -0700 (PDT)
In-Reply-To: <D747E0C4.31570%christer.holmberg@ericsson.com>
References: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com> <4C57BFED-4A4D-4B9E-931A-173E1FE493DF@iii.ca> <CAK35n0a6Ua3YOJS1DfdsMDWuk4wW4vWdZfiUJDK8XinSQnb9NQ@mail.gmail.com> <D747E0C4.31570%christer.holmberg@ericsson.com>
From: Taylor Brandstetter <deadbeef@google.com>
Date: Thu, 14 Jun 2018 10:06:03 -0700
Message-ID: <CAK35n0biOTXFku=SjwNyHsrZv=QhNCpZR89a1okAdUauP_aQGA@mail.gmail.com>
To: Christer Holmberg <christer.holmberg@ericsson.com>
Cc: Cullen Jennings <fluffy@iii.ca>, RTCWeb IETF <rtcweb@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000004964ea056e9d1d9e"
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/DD9_WDP_R_xIKMr6yZHTPL4x0t4>
Subject: Re: [rtcweb] Possible to lose initial messages sent by reliable, out-of-band negotiated data channels
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.26
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: Thu, 14 Jun 2018 17:06:10 -0000

So you're suggesting for the web app to just take care to avoid this? But
the point of this thread is to decide what happens if it *doesn't*.

On Wed, Jun 13, 2018 at 11:09 PM, Christer Holmberg <
christer.holmberg@ericsson.com> wrote:

> Hi,
>
> >It sounds like you and Christer are suggesting the same thing: "don't
> allow messages to be sent until you're sure the other peer has a channel to
> receive them". Except that there's no way for the WebRTC stack to know
> that, since these channels are not signaled in SDP or any in-band message.
>
> Even if the Web app cannot tell the WebRTC stack when the peer has a data
> channel, the Web app can still control when it starts sending data on the
> data channel, can’t it?
>
> Regards,
>
> Christer
>
>
>
>
>
> On Wed, Jun 13, 2018 at 1:32 PM, Cullen Jennings <fluffy@iii.ca> wrote:
>
>>
>>
>> On May 31, 2018, at 12:24 PM, Taylor Brandstetter <
>> deadbeef=40google.com@dmarc.ietf.org> wrote:
>>
>> One might expect that a "reliable" data channel is guaranteed to be,
>> well, reliable. But in current implementations, the first messages may be
>> lost if the application is negotiating the channels out-of-band, and
>> creates the receiving channel too late.
>>
>> Here's a fiddle that demonstrates this (happens with Chrome and Firefox):
>> https://jsfiddle.net/o2m8tp20/
>>
>> Normally this isn't an issue, because a typical application would create
>> the out-of-band negotiated channels before the first offer/answer is
>> complete, and thus before the SCTP association is established. Meaning that
>> by the time a data channel is "open", it's guaranteed that the other peer
>> has a corresponding channel.
>>
>> But if for whatever reason, an application creates a data channel *after*
>> the SCTP association is established, then it will instantly be "open" as
>> soon as it's created. If a message is sent at this point, and it's received
>> by the other peer before it's created its corresponding data channel, then
>> the message will just be discarded.
>>
>> So, how should we deal with this? Some possibilities:
>>
>>    1. Say "this is expected behavior" and document it better, breaking
>>    the reliability promise.
>>    2. Run the closing procedure if a message is received on a stream
>>    before a data channel is ready to receive it.
>>    3. Don't even allow an out-of-band negotiated channel to be created
>>    after the SCTP association is established.
>>    4. Buffer these messages for up to X seconds (or up to X bytes), to
>>    be delivered to the data channel once it's created. Run the closing
>>    procedure if X is exceeded.
>>
>> I'd vote for #2. Adding additional buffering logic seems like overkill if
>> this isn't a use case we really intended to support.
>>
>>
>> I lean toward something that just did not allow the  out-of-band channel
>> negotiation be used until it was set up.
>>
>> But whatever we do, not option 1
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>