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

Lennart Grahl <lennart.grahl@gmail.com> Thu, 31 May 2018 22:52 UTC

Return-Path: <lennart.grahl@gmail.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 1BA231318DD for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 15:52:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 BNRKQzW1eMiX for <rtcweb@ietfa.amsl.com>; Thu, 31 May 2018 15:52:29 -0700 (PDT)
Received: from mail-wr0-x231.google.com (mail-wr0-x231.google.com [IPv6:2a00:1450:400c:c0c::231]) (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 0A4FF131831 for <rtcweb@ietf.org>; Thu, 31 May 2018 15:52:29 -0700 (PDT)
Received: by mail-wr0-x231.google.com with SMTP id f16-v6so19171364wrm.3 for <rtcweb@ietf.org>; Thu, 31 May 2018 15:52:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RNV61n2iNIRNcBDIIrsOndIlXHb5fhNCtQ1HH5EE6D8=; b=F+31j33wLSDErhyz6Z1dC1/7vybHu+M6L2b0PmKObDZyFR5wtDXe8GF45JZgXX8yQ5 R3trdNiK94x55i6Xo7vVcGOL1JQZm0ieppVEFjh7y9CN6w14m4lALsdX+h0xmoo8KEpf FV6t9A/f6bP8QNZFab4ddC5v0tVNOmXAAuEEpA4sfqul/8WSe6mWrz4uxCphaK9baCbF QL8NPvjpzlILlX7oAqHlhKVQDI01OF+1urbIZ9WD/aMcODcObGiPYA1PzzuG5RekFUM+ FnVdPx4JJr6E90ePmiqfWuahGdyIYY5g8W8jRy0+VQv3OVhHwFtB5OJwUrWVYmKkYxsE 0d/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RNV61n2iNIRNcBDIIrsOndIlXHb5fhNCtQ1HH5EE6D8=; b=j2w6Tq/7b3p3ov22JP41FdqfyOTiEkTQt8a2MsLpxEv+gUS7WidjGfNoLwM10WHLxX tz8z0Jc0B8opvN/OMo/VoD7qlHpZsnuiVqfTXDokLWTj9QQSY7rqpEFipruVxTLTHhh2 lgZdAkhGqJdBqpQxCu7EAY1hfAjG3mOfkzffNJm1N1t0FQEfKGMi83GLfPHFdP89M7Tb XbGsXFlx+hPa1o0jazNuLFcZaAHYUldX8DdKBprVxV3q/DsDDKnt8PpGY9ai2AWqQ4da 3UJaZJdLjYx/1mSaYgSBXVuJli4AzXtVMqqsrnweakWlUhz+JFfVcxrWzGke5JdOqGNU bRGw==
X-Gm-Message-State: ALKqPwd5hJ9gBr8aXYXF+j0M/9Ow97+zK3pRIpGZ95ASwi1BnSJP1sdY ZV21jx8ILBaN0nRaitwZLtRbrg==
X-Google-Smtp-Source: ADUXVKI0FixbFr4F8+miDcnQKKf/xpzbYzLRRmYWhKKFdBzs89oPUWvrut0+DzwFXh49YmsNFplhSg==
X-Received: by 2002:adf:8462:: with SMTP id 89-v6mr7371171wrf.138.1527807147548; Thu, 31 May 2018 15:52:27 -0700 (PDT)
Received: from ?IPv6:2003:cd:6f1f:4900:dda4:b912:267f:26de? (p200300CD6F1F4900DDA4B912267F26DE.dip0.t-ipconnect.de. [2003:cd:6f1f:4900:dda4:b912:267f:26de]) by smtp.gmail.com with ESMTPSA id k4-v6sm1014220wrr.68.2018.05.31.15.52.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 15:52:27 -0700 (PDT)
To: rtcweb@ietf.org
References: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com>
Cc: Taylor Brandstetter <deadbeef=40google.com@dmarc.ietf.org>
From: Lennart Grahl <lennart.grahl@gmail.com>
Message-ID: <ec00b135-8c47-c4a0-7ff9-4e211afd9669@gmail.com>
Date: Fri, 01 Jun 2018 00:52:26 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
MIME-Version: 1.0
In-Reply-To: <CAK35n0bLdXMVOeh+R5EHegMT4+7eP0dWZ+-7Y82VJkTC4wk5QQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-GB
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/rtcweb/IyjTgrRm4ga1vjbKJXgKm1Hz2rY>
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 22:52:33 -0000

Hi,

I'm not sure yet going for anything but 4. is a good idea but this is 
just a gut feeling. If it has to be any of the first three options, I 
would want it to be 3. on the sender side and 2. on the receiver side 
because I very much prefer APIs that fail explicitly rather than implicitly.

Cheers
Lennart


On 31.05.2018 20:24, Taylor Brandstetter 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.
> 
> Corresponding webrtc-pc issue: https://github.com/w3c/webrtc-pc/issues/1879
> 
> 
> 
> _______________________________________________
> rtcweb mailing list
> rtcweb@ietf.org
> https://www.ietf.org/mailman/listinfo/rtcweb
>