Re: [rtcweb] DataChannels API and external negotiation

Randell Jesup <randell-ietf@jesup.org> Mon, 01 April 2013 20:00 UTC

Return-Path: <randell-ietf@jesup.org>
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 DE39411E80EE for <rtcweb@ietfa.amsl.com>; Mon, 1 Apr 2013 13:00:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.299
X-Spam-Level:
X-Spam-Status: No, score=-1.299 tagged_above=-999 required=5 tests=[AWL=1.300, BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0tSuqv9Yz8pO for <rtcweb@ietfa.amsl.com>; Mon, 1 Apr 2013 13:00:29 -0700 (PDT)
Received: from r2-chicago.webserversystems.com (r2-chicago.webserversystems.com [173.236.101.58]) by ietfa.amsl.com (Postfix) with ESMTP id CAF3C11E80E6 for <rtcweb@ietf.org>; Mon, 1 Apr 2013 13:00:27 -0700 (PDT)
Received: from pool-98-111-140-34.phlapa.fios.verizon.net ([98.111.140.34]:4526 helo=[192.168.1.12]) by r2-chicago.webserversystems.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from <randell-ietf@jesup.org>) id 1UMku1-000BcP-Sb; Mon, 01 Apr 2013 15:00:26 -0500
Message-ID: <5159E6F9.4070808@jesup.org>
Date: Mon, 01 Apr 2013 15:58:49 -0400
From: Randell Jesup <randell-ietf@jesup.org>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
MIME-Version: 1.0
To: public-webrtc@w3.org, "rtcweb@ietf.org" <rtcweb@ietf.org>
References: <5158F0FC.3070104@jesup.org> <CABkgnnWBR5SqOF6Ygp7AaEyG19yoG88hpUs4_mWbv59dyCm1gA@mail.gmail.com>
In-Reply-To: <CABkgnnWBR5SqOF6Ygp7AaEyG19yoG88hpUs4_mWbv59dyCm1gA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; 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
Subject: Re: [rtcweb] DataChannels API and external negotiation
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.12
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, 01 Apr 2013 20:00:30 -0000

On 4/1/2013 12:48 PM, Martin Thomson wrote:
> This looks fine, but I'd like to bike shed just a little.
>
> On 31 March 2013 19:29, Randell Jesup <randell-ietf@jesup.org> wrote:
>> Here's a proposed API for DataChannels with external negotiation, per the
>> recent Interim and IETF meeting (most of this was in my previous W3 email,
>> but I've added info on when 'stream' is valid to read, and how even/odd
>> roles are assigned for the IETF protocol). I'll note for the IETF folks that
>> 'protocol' is in a JS dictionary object in this update, which avoids
>> breaking any current experimental applications (and avoids them having any
>> incentive to UA-sniff).  Also, I think it works better in the dictionary.
>>
>>    channel = peerconnection.createDataChannel(label, dictionary_object);
>>
>> /* If either maxRetransmitTime or maxRetransmitNum are set, it's
>>     unreliable, else it's a reliable channel.  If both are set it's an
>>     error.  outOfOrderAllowed can be used with any type of channel.  The
>>     equivalent of UDP is { outOfOrderAllowed: true, maxRetransmitNum: 0 }.
>>     The TCP equivalent is {}.
>>
>>     preset is set to true if the channel is being externally negotiated, and
>>     no wireline OpenRequest message should be sent.  If preset is true,
>> stream
>>     can be optionally used to set a specific SCTP stream to use.  If it's
>>     not set but preset is true, then the application should read the 'stream'
>>     attribute from the returned DataChannel after onopen and convey it to the
>>     other end to pass in via the DataChannelInit dictionary.
>>   */
> A lot of your text can be replaced by defaults on the dictionary.
>
> I prefer 'ordered' over 'outOfOrderAllowed', even if it means an
> inversion of the values.

Probably is easier to understand, and defaults help.

>    'rtxCount' or 'retransmitCount' rather than
> 'maxRetransmitNum'  (max is implied).

I don't know that removing 'max' helps here or hurts.  Also, 
sorta-acronyms like rtx are obvious to networking people; not so much to 
JS app developers.  I see only minimal advantage here to brevity.  Count 
might be an improvement on Num.

> 'preset' doesn't sound right, maybe you could have 'inlineOpen'
> (default: true) to convey what is really happening here.

externallyNegotiated (default: false)?  Not great, but "inlineOpen" will 
be pretty meaningless to most developers who probably could care less if 
there's an in-band open message for a channel (whether externally 
negotiated or not) - or even know there's an in-band message.  Then 
again, 99% of developers don't need to care about this anyways.

>> dictionary DataChannelInit {
>>    boolean ordered = true;
>>    unsigned short retransmitPeriod = 65535; // !
>>    unsigned short retransmitCount = 65535;
>>    DOMString protocol;    // default: undefined
>>    boolean inlineOpen = true;
>>    unsigned short stream;    // default: browser selected
>> };
> unsigned short is an unusual type for time intervals, even if you
> don't foresee a need for more than 65 seconds.  Oh, and that assumes
> that you are using milliseconds, right?

Unsigned short has been the type in the protocol fields since the first 
draft (like a year).  Perhaps a silly optimization, though I think if 
you want partial reliability with >64K resends, or >64 seconds of retry 
that you *really* want reliable transmission (perhaps unordered, but 
reliable).   If we want to change it, now's the time, since we're 
breaking binary compatibility in FF with my landing today anyways.

-- 
Randell Jesup
randell-ietf@jesup.org