Re: [rtcweb] Data Channels Proposal: Now in Internet Draft Form

Martin Thomson <> Mon, 04 March 2013 17:00 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id EFD6B21F8CC2 for <>; Mon, 4 Mar 2013 09:00:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, J_CHICKENPOX_48=0.6, NO_RELAYS=-0.001]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id krG23uPFuC+I for <>; Mon, 4 Mar 2013 09:00:51 -0800 (PST)
Received: from ( [IPv6:2a00:1450:400c:c05::22a]) by (Postfix) with ESMTP id 0070021F8C26 for <>; Mon, 4 Mar 2013 09:00:50 -0800 (PST)
Received: by with SMTP id hm11so2466493wib.5 for <>; Mon, 04 Mar 2013 09:00:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=dX6agABwqy9ODLaSygMTyLuea9GcNH0SKDmXJB9AQpw=; b=vP/F/lUZQHX54B9rHxZGNjY0wjKbFnWC3k6ozEDnaFvqi3o7lC11PXcvkJo0b0iVGI HUB8dFWgFbk9CS2ftATn8fPhjIeEJkEig9RqIuWcgiFR4kzkLlwM42vRSFUnvpFxEA5+ JJk/lg8sfr6ioOY6iAbOY0RYpKPigTj2FL8c3hRwchsEW0ctxXq9w+b/TEsr2cGAhmv/ 1JGPsOyYPainkiURoCumigTqMdWByt6gDmNU0ZFtnW0fxuoK4LyP6XTgpqwoZLlCcvkg Wno5V1OtERfAIEm7vkaLMSgU3K/AY0LeAGh6FNLwTK7LvSK9f7SR7kwzXg8uxBltDgYp eqDg==
MIME-Version: 1.0
X-Received: by with SMTP id ft8mr13149994wib.28.1362416449949; Mon, 04 Mar 2013 09:00:49 -0800 (PST)
Received: by with HTTP; Mon, 4 Mar 2013 09:00:49 -0800 (PST)
In-Reply-To: <>
References: <> <>
Date: Mon, 04 Mar 2013 09:00:49 -0800
Message-ID: <>
From: Martin Thomson <>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: "" <>
Subject: Re: [rtcweb] Data Channels Proposal: Now in Internet Draft Form
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 04 Mar 2013 17:00:52 -0000

Brief answers inline.

On 4 March 2013 08:28, MARCON, JEROME (JEROME)
<> wrote:
> Hi Martin, thanks for your proposal. I have some comments/questions:
> 1. So the label locally assigned to a data channel created in-band is not transmitted to the peer ? (note that I am fine with this)

The label is a handle that is provided to the application as a
convenience.  The label is a new invention, which I'm not certain we
entirely need.  It might provide some use, but it's unclear how it
adds value over the subprotocol label.

> 2. Whereas defaulting properties like order or reliability is more or less OK, it seems more critical to default the subprotocol property. The app would have to parse the incoming user message to guess if this message is about 'chat' or 'file transfer'

Actually, in most cases, an application will only ever receive packets
that they know about beforehand.  If they need to distinguish between
chat and file transfer, they will have established conventions for
identifying those packets.  PPID is one possible convention, though I
note that most uses of SCTP I've seen don't use more than one value,
so most code ends up ignoring the PPID.

I share the same leeriness about the "protocol" label used in

> 3. Why does StreamID need to be exposed to the app ? I first thought it was to allow in-band data channel creation by a simple message sending. But then:
> - either the StreamID is a parameter of send(streamID, data) - and this breaks the alignment with WebSocket API and also the app has no handle on this data channel
> - or streamID is a parameter of createDataChannel and this seems useless as the browser is able to select a new stream number internally

Stream ID is exposed to the app because it allows the app to create
their own usage pattern.  It can create the streams it wants and
attach meaning to those numbers.  That said, stream IDs are allocated
automatically by the browser for most uses.  I'd expect that streamId
would be an optional constraint (i.e., optional in usage) on channel

There is no in-band protocol, except for the one that the application
uses.  That's important.

> 4.  Why does binaryPPID need to be exposed to the app ? The browser is expected to infer the message type from the data passed to send().

binaryPPID allows the application to generate (though not consume,
except in constrained cases) SCTP that can be consumed by any
application.  The browser doesn't "infer" anything about message
types, other than when messages use the textual PPID, in which case
they are surfaced as strings rather than the specified binary type (a
Blob or ArrayBuffer).

> 5. Finally to decrease the number of mismatching properties situations, you could simply assign a "Default=strict|loose" property to one of the data channels in the SDP.
> If set to "strict", endpoints could only create in-band data channels for which the default set of properties applies. To create other types of data channels in-band, renegotiation is required
> If set to "loose'", an endpoint receiving a user message on an closed data channel would open the data channel using these default properties. But with the risk of mismatch on subprotocol...
> This would make scalable setup scenarios like:
> - the SDP offer/answer exchange negotiates one 'chat' data channel, and one 'file transfer' Default data channel
> - later on, either endpoint creates in-band 100 data channels for file transfer -> no renegotiation needed, no property mismatch.

That's unnecessary.  If I want an application that has one "special"
channel and an arbitrary number of "normal" channels, I can do exactly
as you say and then set the properties of those spontaneously created
channels as they appear.  It doesn't require any more standardization
or browser machinery:

pc.addEventListener('datachannel', function(e) {
  var fileTransferChannel =;
  fileTransferChannel.ordered = true;
  fileTransferChannel.subprotocol = 'filetransfer';

> This reduces the mismatching situations, in the case where one single set of properties is mostly used at a given time in the session. But the browser (or the app) has to guess at the time of SDP negotiation which set of properties should be the default, i.e. will be used more frequently than the others later on in the session.
> An extended (and deterministic) approach is to restrict the role of SDP offer/answer to the negotiation of some identified set of properties (not data channels). Then data channels are created in-band by the sending of user messages on closed streams, where each user message includes a "set of properties" identifier. You may have a look at the draft I have submitted.

I didn't see a specific need for negotiating properties in such a
generic fashion.  Ultimately, each property needs some semantics when
you use it, so it seemed excessive.  In SDP at least, the extension
mechanism is well enough understood to be able to support extension
enough to allow for new properties to be defined (like ordering, which
I omitted from my draft by mistake).

That said, if you are defining an in-band protocol (a bad idea in my
opinion), the idea that properties are generic makes a great deal of
sense.  That allows applications to define what they need and allows
them to avoid unnecessary noise.