Re: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)

Christer Holmberg <christer.holmberg@ericsson.com> Sat, 08 February 2014 16:00 UTC

Return-Path: <christer.holmberg@ericsson.com>
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 2FCC21A040B for <rtcweb@ietfa.amsl.com>; Sat, 8 Feb 2014 08:00:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.851
X-Spam-Level:
X-Spam-Status: No, score=-3.851 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_SE=0.35, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] 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 KCRE7R1f6jkT for <rtcweb@ietfa.amsl.com>; Sat, 8 Feb 2014 08:00:03 -0800 (PST)
Received: from mailgw2.ericsson.se (mailgw2.ericsson.se [193.180.251.37]) by ietfa.amsl.com (Postfix) with ESMTP id 3B33C1A03A5 for <rtcweb@ietf.org>; Sat, 8 Feb 2014 08:00:03 -0800 (PST)
X-AuditID: c1b4fb25-b7f038e000005d01-1e-52f654827468
Received: from ESESSHC005.ericsson.se (Unknown_Domain [153.88.253.124]) by mailgw2.ericsson.se (Symantec Mail Security) with SMTP id 06.9C.23809.28456F25; Sat, 8 Feb 2014 17:00:02 +0100 (CET)
Received: from ESESSMB209.ericsson.se ([169.254.9.99]) by ESESSHC005.ericsson.se ([153.88.183.33]) with mapi id 14.02.0387.000; Sat, 8 Feb 2014 17:00:02 +0100
From: Christer Holmberg <christer.holmberg@ericsson.com>
To: "Makaraju, Maridi Raju (Raju)" <Raju.Makaraju@alcatel-lucent.com>, Michael Tuexen <Michael.Tuexen@lurchi.franken.de>
Thread-Topic: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)
Thread-Index: AQHPI5G4gedSwhADR0Wr7uzX17tRu5qqSHkAgAAc9wCAABUk/4AAA9sAgACGp4CAABNZEIAAN5uAgAA2Dto=
Date: Sat, 08 Feb 2014 16:00:02 +0000
Message-ID: <7594FB04B1934943A5C02806D1A2204B1D164897@ESESSMB209.ericsson.se>
References: <7594FB04B1934943A5C02806D1A2204B1D15E955@ESESSMB209.ericsson.se> <74072016-DA11-41E8-9944-779428163EE4@lurchi.franken.de> <7594FB04B1934943A5C02806D1A2204B1D15ED94@ESESSMB209.ericsson.se> <E1FE4C082A89A246A11D7F32A95A17826DFCF6C8@US70UWXCHMBA02.zam.alcatel-lucent.com> <B304F67A-9EA2-44A0-86DD-9DD0E21CB86F@lurchi.franken.de> <52F4182F.60404@alvestrand.no> <E1FE4C082A89A246A11D7F32A95A17826DFD40C3@US70UWXCHMBA02.zam.alcatel-lucent.com>, <CABkgnnXMYt7teSpxm7chTvQPR8ThKzKQ_bq3Po_FNFv2tdBFGQ@mail.gmail.com> <7594FB04B1934943A5C02806D1A2204B1D163B26@ESESSMB209.ericsson.se> <E1FE4C082A89A246A11D7F32A95A17826DFD4581@US70UWXCHMBA02.zam.alcatel-lucent.com>, <23A98499-FA93-472A-B762-92BF72EAC2F1@lurchi.franken.de> <s2ej79huj4akcjl2tbtekvx8.1391851562242@email.android.com>, <E1FE4C082A89A246A11D7F32A95A17826DFD4E9D@US70UWXCHMBA02.zam.alcatel-lucent.com>
In-Reply-To: <E1FE4C082A89A246A11D7F32A95A17826DFD4E9D@US70UWXCHMBA02.zam.alcatel-lucent.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [153.88.183.18]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsUyM+JvjW5TyLcgg7N7bCyunfnHaHGxaQmj RcPGK6wWa/+1szuweLQ+28vqsXPWXXaPJUt+MnlsaNnBFMASxWWTkpqTWZZapG+XwJWx9/Ub 5oIrohUXDreyNDCeE+xi5OSQEDCRWDxrOxOELSZx4d56NhBbSOAQo8THw7VdjFxA9iJGiU0P Olm7GDk42AQsJLr/aYPUiAjUSBxZN48FxGYWCJF4ePYdM4gtLFAqcWffNDaQchGBMon9Ww0g ypMkJtxcDLaKRUBFYsvEvawgNq+Ar0THjI/MEKu+sEk83tgNVsQpECvRsmMNO4jNCHTb91Nr mCB2iUvcejIf6mYBiSV7zjND2KISLx//Y4WwFSU+vtrHCFGvI7Fg9yc2CFtbYtnC18wQiwUl Ts58wjKBUWwWkrGzkLTMQtIyC0nLAkaWVYzsuYmZOenlRpsYgZF0cMtv1R2Md86JHGKU5mBR Euf98NY5SEggPbEkNTs1tSC1KL6oNCe1+BAjEwenVAOjbVqM0+7LerJLv8810Ft1X5rTc7pT iVbhLeNZJt+0XQtZhUTsMvl/rdgure/JsyvaQin8ffkvlq0u62dNXdmwr+LW1J3nhRuW31oy q25jCmu0b63U/rtcc/vk5hS8kOhX+rFMyrnjsA+z3dHAptuBG4SE//atvcW4rmJX/uG2ly1n kjIyF/9VYinOSDTUYi4qTgQAyXW15HICAAA=
Cc: "rtcweb@ietf.org" <rtcweb@ietf.org>
Subject: Re: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)
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: Sat, 08 Feb 2014 16:00:06 -0000

Hi,

Without commenting on specifics: we shall NOT have a mechanism where one side needs to know whether the remote peer is a browswer or not. The data channel mechanism itself shall be generic.

Regards,

Christer



________________________________________
From: Makaraju, Maridi Raju (Raju) [Raju.Makaraju@alcatel-lucent.com]
Sent: Saturday, 08 February 2014 3:45 PM
To: Christer Holmberg; Michael Tuexen
Cc: Martin Thomson; rtcweb@ietf.org
Subject: RE: [rtcweb] PPID, UTF-16 and DOMString (Re: RTCWEB Data Channel: Usage of PPID for protocol multiplexing)

> We could have an informative note somewhere.in the draft, pointing out the
> format used by JavaScript, if people think it would be useful.

[Raju] The format used by Javascript is already documented in http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription
via various API calls:
    void send (DOMString data);
    void send (Blob data);
    void send (ArrayBuffer data);
    void send (ArrayBufferView data);

As long as browser+javascript is used by both webrtc clients the receiving gets these formats in onmessage () callback (NOTE: please see exceptions below).
So, what goes/comes on wire is controlled by browser to give the application suitable format.
If one side is a non-browser/javascript webrtc client then the wire format really matters, for which the Data Channel Core spec will have a note (per discussion and agreement).

The spec is already assuming, though not explictly, onwire UTF-8 format while doing "bufferedAmount" calculations. This is evident from the note:

"bufferedAmount of type unsigned long, readonly
The bufferedAmount attribute must return the number of bytes of application data (UTF-8 text and binary data) that have been queued using send() but that, as of the last time the event loop started executing a task, had not yet been transmitted to the network."

May be an additional explicit note in the above text about "onwire format is UTF-8" makes it very clear!?

Coming back to http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription :
As shown above the API has send() API which takes Blob or ArrayBuffer or ArrayBufferView as arguments. Now since there will only be one "binary" PPID defined, all these maps to it. Assuming browser on the other end, how does it knows which type of data type to give in the onmessage() callback? Is there any expectation on the other end it gets same data type? I guess not! Other end may always default to using "Blob". In either case, we need a note here about the data type to be expected in onmessage(), which may always be "Blob"/binary or "DOMString"/text?!


-Raju