Re: [rtcweb] Open data channel issues

Randell Jesup <randell-ietf@jesup.org> Mon, 03 March 2014 11:26 UTC

Return-Path: <randell-ietf@jesup.org>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C8A021A0F47 for <rtcweb@ietfa.amsl.com>; Mon, 3 Mar 2014 03:26:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.5
X-Spam-Level:
X-Spam-Status: No, score=-0.5 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham
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 tpGDoCVeyNb4 for <rtcweb@ietfa.amsl.com>; Mon, 3 Mar 2014 03:26:55 -0800 (PST)
Received: from r2-chicago.webserversystems.com (r2-chicago.webserversystems.com [173.236.101.58]) by ietfa.amsl.com (Postfix) with ESMTP id E736C1A0F45 for <rtcweb@ietf.org>; Mon, 3 Mar 2014 03:26:54 -0800 (PST)
Received: from pool-71-175-4-197.phlapa.fios.verizon.net ([71.175.4.197]:1582 helo=[192.168.1.12]) by r2-chicago.webserversystems.com with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.82) (envelope-from <randell-ietf@jesup.org>) id 1WKR17-0006Ss-AC; Mon, 03 Mar 2014 05:26:41 -0600
Message-ID: <5314669C.3090301@jesup.org>
Date: Mon, 03 Mar 2014 06:25:16 -0500
From: Randell Jesup <randell-ietf@jesup.org>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: rtcweb@ietf.org
References: <31B9253D-E826-4D07-A8A1-1B062B50F163@lurchi.franken.de> <530D9CC5.5080508@ericsson.com> <5312FBBC.5080006@jesup.org> <CAOJ7v-2GHt37u8raWDKquNFLCjSv-ptP0YGojPwuLv02da_m1Q@mail.gmail.com> <5313EC0D.9030808@jesup.org> <6C3E8CBC-9EC4-4222-8073-7D7903FEC38A@fh-muenster.de>
In-Reply-To: <6C3E8CBC-9EC4-4222-8073-7D7903FEC38A@fh-muenster.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - r2-chicago.webserversystems.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - jesup.org
X-Get-Message-Sender-Via: r2-chicago.webserversystems.com: authenticated_id: randell@jesup.org
Archived-At: http://mailarchive.ietf.org/arch/msg/rtcweb/dlaK9u0btp9YP-SzVWMFDfwZHTE
Cc: Michael Tuexen <tuexen@fh-muenster.de>, Randall Stewart <rrs@lakerest.net>
Subject: Re: [rtcweb] Open data channel issues
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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: Mon, 03 Mar 2014 11:26:56 -0000

On 3/3/2014 1:53 AM, Michael Tuexen wrote:
> On 03 Mar 2014, at 02:42, Randell Jesup <randell-ietf@jesup.org> wrote:
>
>
>> EMSGSIZE if the sendto() is larger than available buffer space, and the alternative (EOR mode) doesn't allow for interleaving of messages when sending at all (and I'm not sure it allows interleaving on reception either, but I didn't check right now).
> If you want to send messages larger than the socket send buffer, you must use the explicit
> EOR more. This is independent from using NDATA or not.

right.

> If you use NDATA, you can have on each outgoing stream a single message (order or unordered)
> being sent using explicit EOR mode and the calls can be interleaved. I don't think I have
> tested this up to know, but this is how it should work.
>
> rrs@: Just to double check: Am I right? Please note that RTCWeb doesn't use ordered and
>        unordered on the same stream, and you don't need to send more than one message with
>        explicit EOR on the same stream at the same time. Therefore the above simplification...

If this is the case, this should deal with the issue I believe, with one 
caveat for the W3 layer:

If we can only send one at a time, we get an issue where we call 
channel.send(blob1); channel.send(blob2);

the JS interface to send() is synchronous and can't block.  This implies 
that if send(blob1) hasn't completed, the send(blob2) can't start, and 
all following send()s must also be buffered in memory. For a blob, since 
a blob reference is read-only, this is likely ok (need to verify what 
happens if we haven't read the blob into memory - if this isn't the 
case, we have a problem).  For sending an ArrayBuffer (or string), we'll 
have to snapshot the buffer at send() time if it's queued since the 
referenced data may change.  However, this really isn't anything that 
new, since if the SCTP buffers are full you have to do something similar 
anyways, even without any messages using fragmentation.

I presume from your comment (since it wasn't entirely clear) that if I 
have channel.send(blob1); channel.send("foo") that "foo" can't be sent 
until blob1 has been fully transmitted (has hit EOR at the send side), 
even though "foo" doesn't require fragmentation, and so all send()s for 
a channel during a fragmented send() must be copied and queued.

>> Now, this is an implementation/API issue which could be fixed with some work, but so far as I know no work has been done on it.  So ndata will allow us to expand the max-sending size to
> This API work is part of getting NDATA implemented. Randall has implemented it, we do have
> code, but it needs some testing and cleaning up in the API which supports the scheduling...

So the last issue would be backwards compatibility.  If today an app 
must be written to query (via an unspecified W3 property) the max size 
you can reliably send() to the other side, then it must buy into (and 
test!) that functionality now and until it's pretty certain that all 
non-compliant implementations are gone.  This can take a while, even if 
you assume people update promptly, due to things like Firefox "ESR" 
releases (Extended Support for businesses, schools, etc).  Thes are 
valid for most of a year, and if we land ndata support right after one 
is created it could be closer to 1-1.5 years before if even starts to 
reach clients - and it may take even more time for all ESR users to 
approve/test it and update.

The arguments about having all the apps be required to implement their 
own fragmentation, etc for a considerable period adds lots of complexity 
to the apps.  Implementing the PPID chunking as the stopgap (and 
retiring it once ndata is universal) means the API to the application 
remains stable and simple.  Since all DataChannel implementations must 
implement queuing of JS send()s (since the SCTP bufferspace may be 
full), it's easy to support PPID fragmentation if you don't worry about 
memory-use optimization).  ndata not being available yet highlights this 
issue.

>> min(SCTP_BUFFER_SIZE - N, other-sides-max-receive-size).  It does not allow us to expand the size to any useful Blob size.
> Please note that you never have a limitation of the receive buffer send size, since SCTP
> would use partial delivery. So other-sides-max-receive-size is only relevant if there are
> buffering limits on top of SCTP.

I was referring to the SDP value for "minimum value I guarantee receiving".

We would need to specify that if ndata is agreed to (I presume we know 
that) that the application would be told an "infinite" value for 
max-I-can-receive (since we can't use the value from the SDP, as that 
predates the two sides creating the association and negotiating ndata).  
I don't want to renegotiate just to remove the max SCTP receive size.

   Randell

-- 
Randell Jesup -- rjesup a t mozilla d o t com