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

Christer Holmberg <christer.holmberg@ericsson.com> Fri, 01 June 2018 03:49 UTC

Return-Path: <christer.holmberg@ericsson.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 570AE126C25 for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 20:49:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.31
X-Spam-Level:
X-Spam-Status: No, score=-4.31 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_MED=-2.3, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 dBEZUAv9Q0Fv for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 20:49:02 -0700 (PDT)
Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 449EF126CBF for <rtcweb@ietf.org>; Thu, 31 May 2018 20:49:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1527824940; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=IXN1aUBfZ56xq69kp3Wtzcrr259BihM6urXSXpGCAZc=; b=e/WrG2zY0fXv5rXV9v23Ws0JVKczCw0FjodNmkFa9NlGij+wJ29GM1lx2dGc9K0F +Pi8e9/X0zqi2xlUWg8150AqNWTgM19OMu810D2VBcxlUhjYgz56obg3EPEXieT+ bpfzMS8LEAPPzQjfn07Y9kH0JqAbBuerPTQdij83uO0=;
X-AuditID: c1b4fb3a-323229c000005fee-b1-5b10c22c6bf4
Received: from ESESSHC022.ericsson.se (Unknown_Domain [153.88.183.84]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 76.4E.24558.C22C01B5; Fri, 1 Jun 2018 05:49:00 +0200 (CEST)
Received: from ESESBMB504.ericsson.se (153.88.183.171) by ESESSHC022.ericsson.se (153.88.183.84) with Microsoft SMTP Server (TLS) id 14.3.382.0; Fri, 1 Jun 2018 05:48:43 +0200
Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMB504.ericsson.se (153.88.183.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 1 Jun 2018 05:48:42 +0200
Received: from ESESBMB503.ericsson.se ([153.88.183.186]) by ESESBMB503.ericsson.se ([153.88.183.186]) with mapi id 15.01.1466.003; Fri, 1 Jun 2018 05:48:42 +0200
From: Christer Holmberg <christer.holmberg@ericsson.com>
To: Taylor Brandstetter <deadbeef@google.com>
CC: Taylor Brandstetter <deadbeef=40google.com@dmarc.ietf.org>, RTCWeb IETF <rtcweb@ietf.org>
Thread-Topic: [rtcweb] Possible to lose initial messages sent by reliable, out-of-band negotiated data channels
Thread-Index: AQHT+QykkBgeKHb7x06HnWNksweot6RKKQ9g///u3QCAAKzZlw==
Date: Fri, 01 Jun 2018 03:48:42 +0000
Message-ID: <6006213D-67E3-4AD3-8C0B-EEF9F5130087@ericsson.com>
References: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com> <c2aec186b055485c8705cfb24be6f70e@ericsson.com>, <CAK35n0bHhkuVoAAQoxaXQxRh1DWo5O_XHrr7XytSBESG0XxHeg@mail.gmail.com>
In-Reply-To: <CAK35n0bHhkuVoAAQoxaXQxRh1DWo5O_XHrr7XytSBESG0XxHeg@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Content-Type: multipart/alternative; boundary="_000_6006213D67E34AD38C0BEEF9F5130087ericssoncom_"
MIME-Version: 1.0
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsUyM2J7iK7OIYFog5PrpS0eXfaxuLziIavF 2n/t7A7MHieWXWH1WLCp1GPJkp9MAcxRXDYpqTmZZalF+nYJXBk7T01hKeiZz1jx4vkWtgbG N7MYuxg5OCQETCQWLqrtYuTiEBI4wiix9so2JghnM6PE4olt7BDOV0aJGauvQTlLGSXmvDnG DNLOJmAh0f1Pu4uRk0NEQFfi5teFbCA2s0C8xNT/+1lAbGGBAok/V5ewQtQUSpy73gu2WUTA SaJxEy9ImEVAReL8/yfMIDavgL3E9AuXWCFWHWeUaHjawg6S4BQIlDjy6zyYzSggJvH91Bom iF3iEreezAezJQQEJJbsOc8MYYtKvHz8jxWiJlniS/sTRogFghInZz4Bu01IQFuiZfEE9gmM YrOQjJqFpGUWkpZZQGczC2hKrN+lD1GiKDGl+yE7hK0h0TpnLjuy+AJG9lWMosWpxcW56UZG eqlFmcnFxfl5enmpJZsYgbF5cMtvqx2MB587HmIU4GBU4uE9uEUgWog1say4MvcQowQHs5II 75Qy/mgh3pTEyqrUovz4otKc1OJDjNIcLErivE5pFlFCAumJJanZqakFqUUwWSYOTqkGRvYP hfs+CVVPrZORuqR+Ivho55MEg8cVWftYJu36XiRdISxmqKXBnlZ1X065L9isYPb0Z/sOpl43 /LZyY6668rspppxa+n337i/ZI39p8575h7ZLVO4LMOw5khPbr5Mz8/qWdoOZR2O0I4uVeuc6 Bj39HHEh/fqyTf8PpEqHPcyxclRi+vF6shJLcUaioRZzUXEiAEV/6JTJAgAA
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/riyesfVg1EjDWI-XKxHdPLmwJAA>
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.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, 01 Jun 2018 03:49:06 -0000

Hi,

No matter what out-of-band protocol you use for opening a data channel, it needs to provide some kind of indication that the peer is ready - and that the peer accepts the data channel to begin with.

Regards,

Christer

Sent from my iPhone

On 31 May 2018, at 22.30, Taylor Brandstetter <deadbeef@google.com<mailto:deadbeef@google.com>> wrote:

As the data channel is realized as an SCTP stream, it sounds very weird that one would not be allowed to negotiate a data channel after the SCTP association has been established…

You can, using in-band negotiation. I'm only talking about out-of-band negotiation, where typically an application will create the data channel immediately after creating the PeerConnection.

Section 6.5 of draft-ietf-mmusic-data-channel-sdpneg says...

WebRTC doesn't use this, though. WebRTC data channels are established either in-band, using draft-ietf-rtcweb-data-protocol, or out-of-band, which is completely up to the application and doesn't involve SDP.


On Thu, May 31, 2018 at 11:38 AM, Christer Holmberg <christer.holmberg@ericsson.com<mailto:christer.holmberg@ericsson.com>> wrote:
Hi,

As the data channel is realized as an SCTP stream, it sounds very weird that one would not be allowed to negotiate a data channel after the SCTP association has been established…

But, if a data channel is established out-of-band, shouldn’t the associated offer/answer transaction complete before the data channel is used?

Section 6.5 of draft-ietf-mmusic-data-channel-sdpneg says:

      “Each agent application MUST wait to send data until it has
        confirmation that the data channel at the peer is instantiated.”

In addition, the section describes when the offerer and answerer can consider that the data channel has been instantiated at the peer.

So, in my opinion any data that is sent before that could simply be dropped, which I guess would be alternative 5 :)

Regards,

Christer

From: rtcweb [mailto:rtcweb-bounces@ietf.org<mailto:rtcweb-bounces@ietf.org>] On Behalf Of Taylor Brandstetter
Sent: 31 May 2018 20:24
To: RTCWeb IETF <rtcweb@ietf.org<mailto:rtcweb@ietf.org>>
Subject: [rtcweb] Possible to lose initial messages sent by reliable, out-of-band negotiated data channels

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.

Corresponding webrtc-pc issue: https://github.com/w3c/webrtc-pc/issues/1879

_______________________________________________
rtcweb mailing list
rtcweb@ietf.org<mailto:rtcweb@ietf.org>
https://www.ietf.org/mailman/listinfo/rtcweb