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

Christer Holmberg <christer.holmberg@ericsson.com> Thu, 31 May 2018 18:38 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 4502812EAD0 for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 11:38:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.309
X-Spam-Level:
X-Spam-Status: No, score=-4.309 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, URIBL_BLOCKED=0.001] autolearn=ham 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 BsMLKDLYxQlr for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 11:38:25 -0700 (PDT)
Received: from sessmg23.ericsson.net (sessmg23.ericsson.net [193.180.251.45]) (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 9845A12D886 for <rtcweb@ietf.org>; Thu, 31 May 2018 11:38:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/simple; q=dns/txt; i=@ericsson.com; t=1527791902; 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=043wNSv1mLG3ajLTrusdJg0NPqdFa5IrfORGqH8Ppvs=; b=KlixXlsGHsyvydqn6llfy822WQtDqBV57vFsIN32beoCAcMxbaaVlzkuej1/zPib i9QgVE8VqX6jjFCWdSmd22bPRsYlTGC/3JDCoWNy7aHu1ABJzXXhfaQZk3kqPCfO z73BL5LHqKDKqxNGM/hInqMZgUqR2o3C7h9bpQdznM8=;
X-AuditID: c1b4fb2d-c61ff700000028db-df-5b10411e7472
Received: from ESESSHC024.ericsson.se (Unknown_Domain [153.88.183.90]) by sessmg23.ericsson.net (Symantec Mail Security) with SMTP id 62.22.10459.E11401B5; Thu, 31 May 2018 20:38:22 +0200 (CEST)
Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESSHC024.ericsson.se (153.88.183.90) with Microsoft SMTP Server (TLS) id 14.3.382.0; Thu, 31 May 2018 20:38:22 +0200
Received: from ESESBMB503.ericsson.se (153.88.183.170) by ESESBMB503.ericsson.se (153.88.183.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 31 May 2018 20:38:22 +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; Thu, 31 May 2018 20:38:22 +0200
From: Christer Holmberg <christer.holmberg@ericsson.com>
To: 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
Date: Thu, 31 May 2018 18:38:21 +0000
Message-ID: <c2aec186b055485c8705cfb24be6f70e@ericsson.com>
References: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com>
In-Reply-To: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [153.88.183.153]
Content-Type: multipart/alternative; boundary="_000_c2aec186b055485c8705cfb24be6f70eericssoncom_"
MIME-Version: 1.0
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDIsWRmVeSWpSXmKPExsUyM2J7lK6co0C0weOFxhaPLvtYrP3Xzu7A 5HFi2RVWjyVLfjIFMEVx2aSk5mSWpRbp2yVwZcy7wl/QNZGx4sit10wNjDN6GbsYOTkkBEwk 9rYdZe9i5OIQEjjCKDFl2RtGCGcLo8Tuz33MEM43RomrK6dCOcsYJZb97WTrYuTgYBOwkOj+ pw0ySkQgXuLIz5VsILawQIHEwqX9LBDxQolz1yHWiQgYSTy61cIEYrMIqEpsbtjACmLzClhL TJp1DaxGSCBA4uLEncwg4zkFAiV2taqAhBkFxCS+n1oD1sosIC5x68l8JogPBCSW7DnPDGGL Srx8/I8VwlaS2HvsOgtEfbLEwQOnGSFWCUqcnPmEBWKVtkTL4gnsExjFZiEZOwtJyywkLbOA LmIW0JRYv0sfokRRYkr3Q3YIW0Oidc5cdmTxBYzsqxhFi1OLi3PTjYz1Uosyk4uL8/P08lJL NjEC4/Dglt+6OxhXv3Y8xCjAwajEwzvLXCBaiDWxrLgy9xCjBAezkgjvlDL+aCHelMTKqtSi /Pii0pzU4kOM0hwsSuK8eqv2RAkJpCeWpGanphakFsFkmTg4pRoYY3XfWO1qPn/b6XjJVCmT X4Z2+xZ/3vZHpUn5zxeHvlUcFa4Oh7a7aswpbThy8fGOaY+rzvrv1H93/PuWeXmzFz9ibJij 7Wd8R6OutWHxBW1ZjeXdSlq5Qv2/v9yc9uI194JDMSpfDXZnr+eS1rcXEd1YNI/xg/SGrnnu jmZHtKZMlV243kRKQImlOCPRUIu5qDgRAPS1/Cy/AgAA
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/BpXZKbioxCpv-TGX8lH1rOC07Ck>
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: Thu, 31 May 2018 18:38:29 -0000

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] On Behalf Of Taylor Brandstetter
Sent: 31 May 2018 20:24
To: RTCWeb IETF <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