Re: [rtcweb] Low Level Javascript API Proposal avail on the webrtc list

Roman Shpount <roman@telurix.com> Wed, 05 October 2011 06:18 UTC

Return-Path: <roman@telurix.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 B7D1321F8AB0 for <rtcweb@ietfa.amsl.com>; Tue, 4 Oct 2011 23:18:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.633
X-Spam-Level:
X-Spam-Status: No, score=-2.633 tagged_above=-999 required=5 tests=[AWL=0.343, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, 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 uBmXfCU4LePO for <rtcweb@ietfa.amsl.com>; Tue, 4 Oct 2011 23:18:54 -0700 (PDT)
Received: from mail-vw0-f44.google.com (mail-vw0-f44.google.com [209.85.212.44]) by ietfa.amsl.com (Postfix) with ESMTP id 6BA0E21F86EE for <rtcweb@ietf.org>; Tue, 4 Oct 2011 23:18:54 -0700 (PDT)
Received: by vws5 with SMTP id 5so1297035vws.31 for <rtcweb@ietf.org>; Tue, 04 Oct 2011 23:22:01 -0700 (PDT)
Received: by 10.52.75.195 with SMTP id e3mr2201108vdw.299.1317795721206; Tue, 04 Oct 2011 23:22:01 -0700 (PDT)
Received: from mail-vx0-f172.google.com (mail-vx0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id x19sm652016vdf.10.2011.10.04.23.22.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 04 Oct 2011 23:22:00 -0700 (PDT)
Received: by vcbfo11 with SMTP id fo11so1301993vcb.31 for <rtcweb@ietf.org>; Tue, 04 Oct 2011 23:21:59 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.182.67 with SMTP id cb3mr593604vcb.58.1317795719764; Tue, 04 Oct 2011 23:21:59 -0700 (PDT)
Received: by 10.220.178.74 with HTTP; Tue, 4 Oct 2011 23:21:59 -0700 (PDT)
In-Reply-To: <4E8BDC3B.7000501@skype.net>
References: <545388B3-3189-4291-BD1D-52898B888F3E@phonefromhere.com> <CAD5OKxt_3bnODVCWxrrrKVWO3R3Or1FjhMOHwgUzq3-h6dW0LA@mail.gmail.com> <4E8BC0ED.2020001@skype.net> <CAD5OKxv_xO0y+71X6ag-2te6TTey4Z77ezvBuYwS89022rL1hQ@mail.gmail.com> <4E8BDC3B.7000501@skype.net>
Date: Wed, 05 Oct 2011 02:21:59 -0400
Message-ID: <CAD5OKxtoePfjm3_-0UxFVh3zgP498M74JCDHp7eok1yqdZy=XQ@mail.gmail.com>
From: Roman Shpount <roman@telurix.com>
To: Matthew Kaufman <matthew.kaufman@skype.net>
Content-Type: multipart/alternative; boundary="90e6ba53ad40c35c6004ae8739ce"
Cc: rtcweb@ietf.org
Subject: Re: [rtcweb] Low Level Javascript API Proposal avail on the webrtc list
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: Wed, 05 Oct 2011 06:18:56 -0000

On Wed, Oct 5, 2011 at 12:25 AM, Matthew Kaufman
<matthew.kaufman@skype.net>wrote:

> How about I rephrase?
>
> If I generate an offer by writing SDP code in C++ using Win32 APIs to
> allocate sockets and send and receive packets, and I send a SIP packet that
> gets multiple answers in the same dialog, how do I process those answers
> using the Win32 API? See how silly that sounds?
>
> Seriously though, if you need an additional local endpoint because of
> forking, you need to create a second connection object, which will then give
> you an onCandidates() callback, as I understand this API proposal. The other
> way to do it is to have the connection object be able to bind to multiple
> possible far endpoints, but that's not exactly what this API says, and it
> isn't clear that it is needed. (Because it isn't how other SIP devices use
> their network stacks to solve this problem either).
>
>
I think you are completely missing the point: If I build similar thing using
Win32 API, I would re-initialize codec and  RTP states and re-do the ICE
candidate selection based on the new answer. This particular API has methods
to add and remove streams and candidates, but no method to start a
re-negotiation. Don't assume something is silly just because you did not
understand it.


> I don't see why you can't create a second connection object (or extend this
> API to allow cloning), and add streams and candidates to that connection
> object. Should be possible to add the same stream to two different
> connection objects, too.
>
>
Each connection object has an associated local port on which it is listening
for incoming media and ICE STUN messages. What I need is to be able to reuse
the same port to connect to multiple different sets of remote candidates.
Remote IP/port should be sufficient to disambiguate different streams.



>
> 6. How do we deal with CODEC negotiated parameters?
>
>
> I believe that the codec parameters are exposed by the codec object, at
> least that's how I read this spec.
>
>
> It is possible to have codec level parameter that needs to be negotiated
> via offer/answer exchange.
>
>
> Maybe. Or maybe there's an offer-answer at the server that picks the right
> answer and then sends that down as a setting to the browser.
>
>
>  There are also codec level parameters that are affected by stream level
> parameters (like iLBC mode=30 that only makes sense with ptime dividable by
> 30).
>
>
> That's just a bug with how RTP works.
>
>
>  Is it going to be implemented in JavaScript?
>
>
> I suppose it might need to be, if you really need to select
> connection-level things to match codec-level things and vice versa. Or
> control it up at the server and then send the right settings down.
>
>
>  This might not be the best idea, since this will require JavaScript to
> have a detailed knowledge about each codec implementation provided by the
> browser. For third party call control, it would be more robust to provide a
> way to return actual codec parameters selected by the browser so that they
> can be returned in the answer.
>
>
> Except that we often don't want the codec parameters to be "selected by the
> browser". We want to know what the browser can do and just set them a
> particular way.
>
> I've already suggested that the format of the "detailed knowledge" can
> actually just reuse the parameter strings that are already defined for use
> in SDP.
>
>
Once again, you are missing the point completely. Part of the problem here
is that typically codec information in offer/answer exchange does not
provide the list of all the codec level parameters supported by the codec.
The fact that, for instance SILK implementation supports FEC or DTX does not
have to be present in the offer to be present in the answer. This means
Codec object will need to expose a more information then typically provided
in SDP (ie all the supported codec parameters vs just the desired one). This
means RTC will need to define fields for this object for each codec it will
support and cannot simply reuse MMUSIC/PAYLOAD standards.

This also brings about the whole new problem -- asymmetric codecs and codec
parameters. There are a lot of valid use cases when you want to use
different codecs in different directions (different hardware optimized
codecs in different mobile devices). There are cases when different payload
types are used for the same codecs in different directions (It can also be
considered an RTP bug). You might want to use different video resolutions
due to device camera and display limitations. You might want to use
different codec bandwidths due to difference in up and down stream network
capacity. There is no way to handle this now. I would suggest that the
better model for third party call control or inbound call would be get the
offer from remote side, process it on the server or in javascript, pass it
to the RTC stack in the browser, get the answer from the RTC stack in the
browser, process it (if needed) in javascript or on the server and send it
to the remote side.

Yet another codec negotiation deficiency that I see here is that you cannot
specify multiple codecs. It is fairly typical to have audio codec, comfort
noise codec, and DTMF to be used at the same time for a single stream.

Final comment about the draft is that it is missing a lot of parameters
about codecs. It is missing things like media type, transport type, clock
rates, payload types, crypto attributes, etc. It would be interesting to see
which attributes would end up in which of the objects.
______________
Roman Shpount