Re: [rtcweb] DataChannels API and external negotiation

Martin Thomson <martin.thomson@gmail.com> Mon, 01 April 2013 16:48 UTC

Return-Path: <martin.thomson@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 06DA511E80D1 for <rtcweb@ietfa.amsl.com>; Mon, 1 Apr 2013 09:48:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.099
X-Spam-Level:
X-Spam-Status: No, score=-7.099 tagged_above=-999 required=5 tests=[AWL=-3.500, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
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 rdXWwlRtd1SU for <rtcweb@ietfa.amsl.com>; Mon, 1 Apr 2013 09:48:43 -0700 (PDT)
Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by ietfa.amsl.com (Postfix) with ESMTP id 01C7C11E80A2 for <rtcweb@ietf.org>; Mon, 1 Apr 2013 09:48:42 -0700 (PDT)
Received: by mail-wg0-f47.google.com with SMTP id y10so2220071wgg.26 for <rtcweb@ietf.org>; Mon, 01 Apr 2013 09:48:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Ga5gPeyVLmCo3vMCkncZqsuHXv3/HGMzUu94C8OwZbI=; b=azyj0KHep6/cLBLfZyXIDHFNUNG+Eig01oGW4JooGJhpXEYOA6JLeRS613+F+CJcJV B8mJN4E87DTUpfUEdb+fUPtD4PKK94xAdkj8ETFfJQ5wQvLC84H0ppj7UEQGuehhmMhr M5SBilWwNS0s314yDZ+bfnaAPwYOpoBjwpnomhBsHmrZCsDKJX+h05PIJR4H95QNtUna OTi4tmgB5Azru3hJ1LgfgxCFGIlUHbljl/Ala6Ai4E/MjM4kmIYZNnHkwSp7QmVkJ7bo Nlpi+cU3G0H/AaI3ZdUZzIwMnwYx9g4jdCX0LqvKf3gleXvUH3vBEEbUScXQuKAx6xmz JI/A==
MIME-Version: 1.0
X-Received: by 10.194.82.104 with SMTP id h8mr16704070wjy.3.1364834922021; Mon, 01 Apr 2013 09:48:42 -0700 (PDT)
Received: by 10.194.41.35 with HTTP; Mon, 1 Apr 2013 09:48:41 -0700 (PDT)
In-Reply-To: <5158F0FC.3070104@jesup.org>
References: <5158F0FC.3070104@jesup.org>
Date: Mon, 1 Apr 2013 09:48:41 -0700
Message-ID: <CABkgnnWBR5SqOF6Ygp7AaEyG19yoG88hpUs4_mWbv59dyCm1gA@mail.gmail.com>
From: Martin Thomson <martin.thomson@gmail.com>
To: Randell Jesup <randell-ietf@jesup.org>
Content-Type: text/plain; charset=UTF-8
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>, "public-webrtc@w3.org" <public-webrtc@w3.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 16:48:44 -0000

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.  'rtxCount' or 'retransmitCount' rather than
'maxRetransmitNum'  (max is implied).

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

> 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?