[rtcweb] DataChannels API and external negotiation

Randell Jesup <randell-ietf@jesup.org> Mon, 01 April 2013 02:30 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 3C12E21F8511 for <rtcweb@ietfa.amsl.com>; Sun, 31 Mar 2013 19:30:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level:
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_50=0.001]
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 YQvxm4nQbKER for <rtcweb@ietfa.amsl.com>; Sun, 31 Mar 2013 19:30:52 -0700 (PDT)
Received: from r2-chicago.webserversystems.com (r2-chicago.webserversystems.com [173.236.101.58]) by ietfa.amsl.com (Postfix) with ESMTP id B3BDC21F8510 for <rtcweb@ietf.org>; Sun, 31 Mar 2013 19:30:52 -0700 (PDT)
Received: from pool-98-111-140-34.phlapa.fios.verizon.net ([98.111.140.34]:1679 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 1UMUWJ-0006CS-NL; Sun, 31 Mar 2013 21:30:51 -0500
Message-ID: <5158F0FC.3070104@jesup.org>
Date: Sun, 31 Mar 2013 22:29:16 -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" <public-webrtc@w3.org>
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
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>
Subject: [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 02:30:53 -0000

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.
  */

dictionary DataChannelInit {
   boolean outOfOrderAllowed;
   unsigned short maxRetransmitTime;
   unsigned short maxRetransmitNum;
   DOMString protocol;
   boolean preset;
   unsigned short stream;
};

And I added to the DataChannel object webidl:

   readonly attribute DOMString protocol;
   /* the 'stream' attribute is not valid until after onopen has fired */
   readonly attribute unsigned short stream;


Even/odd roles for the underlying DataChannel protocol are tied to the 
DTLS roles on the DTLS connection.  These are only available after the 
DTLS connection is established, and so we will set the even/odd roles 
when the initial association is established (which is when onconnection 
fires, and then any queued DataChannels would have onopen fire).

-- 
Randell Jesup
randell-ietf@jesup.org