Re: [rtcweb] SDP_PRANSWER followed by SDP_OFFER scenario in JSEP

Roman Shpount <> Wed, 02 May 2012 16:23 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id E096521F861B for <>; Wed, 2 May 2012 09:23:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.817
X-Spam-Status: No, score=-2.817 tagged_above=-999 required=5 tests=[AWL=0.159, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id EO50DThItl-P for <>; Wed, 2 May 2012 09:23:38 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id C402921F85B7 for <>; Wed, 2 May 2012 09:23:37 -0700 (PDT)
Received: by bkty8 with SMTP id y8so767313bkt.31 for <>; Wed, 02 May 2012 09:23:36 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=7ipmZ5PPoWLFZ5dIY3HclgreXG6SzzpxKJpgSljwa5A=; b=eRLTFKkdqt/zXByVI+llvw71IahaW5F8hJuRJRMkSpKJr9L3dNrPo5Ew39EJzU30Pj YqgNpM+smeetrJSBbJmnThXS+TEh7JD6YSdGpliE5jxWSYFnoJKkjVBMEjjgomOSNPHK nLqBeS6yuhtXd7DS8MuR+KYIpprNxoCs+AwirCn+XZIjviKHAJvIOwlQKwfz3OGDwMVI CRQz1KwxbOgxwUqcMA5AZ3e66LgvJzy+oFOI6HmDjVtmv/inA+dVm40K9z63yASUy1t8 pMqCKCl7L+r1S9FAcvxpxG+LGplPXi7SA1fgsfoOZz+j0/zjhQusJTBTa5b53tySfLJI w98w==
Received: by with SMTP id l7mr5171307bkw.86.1335975816662; Wed, 02 May 2012 09:23:36 -0700 (PDT)
Received: from ( []) by with ESMTPS id r14sm5012675bkv.11.2012. (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 May 2012 09:23:35 -0700 (PDT)
Received: by bkty8 with SMTP id y8so767269bkt.31 for <>; Wed, 02 May 2012 09:23:34 -0700 (PDT)
MIME-Version: 1.0
Received: by with SMTP id o19mr6296592bkv.96.1335975811443; Wed, 02 May 2012 09:23:31 -0700 (PDT)
Received: by with HTTP; Wed, 2 May 2012 09:23:27 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <> <> <> <>
Date: Wed, 02 May 2012 12:23:27 -0400
Message-ID: <>
From: Roman Shpount <>
To: Harald Alvestrand <>
Content-Type: multipart/alternative; boundary="0015175cdc56ab6ae104bf101b98"
X-Gm-Message-State: ALoCoQnnPmlu/UFfU5tzpon0AhVMsa7n1Lkrh0Guk0VINQRG37k8ZNxLsgfLiSdFIm50yuEX45ff
Subject: Re: [rtcweb] SDP_PRANSWER followed by SDP_OFFER scenario in JSEP
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: Wed, 02 May 2012 16:23:39 -0000

On Wed, May 2, 2012 at 11:54 AM, Harald Alvestrand <>wrote:

>  It does mean that the implementation will have to do reference counting
> to know when it can close the port - if one clones the socket and binds the
> clones to different remote ports, I think the OS will take care of it on
> Unix, I'm not sure how it goes for other OSes.
> Does someone know what the semantic of bind() is here - whether one needs
> to have an unbound port to fork from in order to bind to different remote
> addresses? I've not tried this myself.

I actually do not think this cloning the socket will work properly even on
Unix. You can connect a cloned UDP socket to a different remote IP/port but
both sockets will continue to receive packets from ALL the remote IP/ports.

Even if it does work, this does not prevent the implementation from
reference counting, since the same TURN allocation would need to be reused
across multiple peerconnections, with a new set of permissions/channels
created for each connection.

In the case of hardware codecs that must be allocated to a specific stream
> .... if one supports forking, which connection (if any) gets the codec? The
> first one to start using it? What happens to the second one?

My understanding was that you do not really need to allocated hardware
resources until the answer arrives and ICE handshake completes. So, my
assumption was that in case of forking, original connection does not
allocate any codec related resources. If the connection is cloned, then it
does not allocation any codec related resources either and stores the
reference for the sockets and TURN allocations from the original
connection. When either connection receives an answer, it conducts the ICE
handshake and allocates resources as needed.

>  I kind of think it's less disruptive to the people who don't want to fork
> stuff if you must instantiate a different object in order to support
> forking. Then implementations that don't support forking can simply not
> offer a constructor for that object.

Alternatively clone can return and error/null if cloning is not supported.
Roman Shpount