[rtcweb] When are ICE candidates added to the SDP

Eric Rescorla <ekr@rtfm.com> Sun, 11 May 2014 23:52 UTC

Return-Path: <ekr@rtfm.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 DA42D1A037F for <rtcweb@ietfa.amsl.com>; Sun, 11 May 2014 16:52:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 gqaLA_jXGO_x for <rtcweb@ietfa.amsl.com>; Sun, 11 May 2014 16:52:29 -0700 (PDT)
Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by ietfa.amsl.com (Postfix) with ESMTP id 4EDC41A0381 for <rtcweb@ietf.org>; Sun, 11 May 2014 16:52:29 -0700 (PDT)
Received: by mail-wi0-f176.google.com with SMTP id n15so3623386wiw.9 for <rtcweb@ietf.org>; Sun, 11 May 2014 16:52:23 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=1NHUlu30nYtfeNfmKmPF/A9qXgN+eJOVCSc8aYJHrPw=; b=b/eFcS1/bjA76r3D34n+VrJG9e4LogX5j9Lcz0C0VQsWkozTSdCLGAQx6aHArn7fD+ OjWvCHMTczSW9y0WmfLvk8Fnt9lNuX9m3kP6XUyMyVZkcbwLstum49Rp20+ghvcaOah3 unFGfN+qwQdT3UIeyvjNxcLz5008wMfyohWUkVXU0oEpNL7yAYdoykXIXZPlwQz3IL32 qKmFtwGcmmSIo/+Imzo9Nwz4gURsD6Z764V8D2APdDegkQs2vjgzNqkh+oYJkYRxw0BY IdFTM5n7Xq2daawOkYfPGTWq+/N+vrH/VKJZ47FAyyUdLhI8PGBRabHW/U9rD6b2Qo79 VVnA==
X-Gm-Message-State: ALoCoQncUDOOerDSK2YF1QMDockb4bj3SrqMYkUMP1Y3MaQpIbDcX92xtiBrbSbEkdCeZ7JLtR+g
X-Received: by 10.180.94.98 with SMTP id db2mr12883200wib.1.1399852343151; Sun, 11 May 2014 16:52:23 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.218.198 with HTTP; Sun, 11 May 2014 16:51:43 -0700 (PDT)
X-Originating-IP: [74.95.2.168]
From: Eric Rescorla <ekr@rtfm.com>
Date: Sun, 11 May 2014 16:51:43 -0700
Message-ID: <CABcZeBNUTf42tS9FrjS9Q6Zk8LBkhpKOR1z2v8MHoeNEUf93Mw@mail.gmail.com>
To: "rtcweb@ietf.org" <rtcweb@ietf.org>
Content-Type: multipart/alternative; boundary=f46d04427140a6e57304f9288529
Archived-At: http://mailarchive.ietf.org/arch/msg/rtcweb/uz7llD_kzlAmaVH3gfThrhC6S4Y
Subject: [rtcweb] When are ICE candidates added to the SDP
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: Sun, 11 May 2014 23:52:31 -0000

See: https://github.com/rtcweb-wg/jsep/issues/11

Section 3.4 reads:

When a new ICE candidate is available, the ICE Agent will notify the
application via a callback; these candidates will automatically be
added to the local session description. When all candidates have
been gathered, the callback will also be invoked to signal that the
gathering process is complete.

However, we agreed in London that we would do "always trickle", and
that even if there were candidates available at the time when CreateOffer
(because of candidate pooling) was called, they would not be included
in the initial offer. Consider the following sequence of events.

0. pc = new RTCPeerConnection();
1. pc.AddStream(stream);
2. pc.CreateOffer();
3. CreateOffer callback fires with offer A, and you call
SetLocalDescription();
4. onicecandidate fires with candidate X.
5. pc.CreateOffer()
6. CreateOffer callback fires with offer B.
7. onicecandidate fires with null.

So, in London, I think we agreed that offer A would have no candidates.
The above text implies that if you were to examine localdescription prior
to step #5 or at step #7 it would contain candidate X, and probably that
offer B would
also contain candidate X.

Note that it's quite inconvenient for non-trickle applications to never
have any candidates in the SDP, especially after gathering is completed
at step #7. However it also seems kind of inconsistent to only update the
candidates after SetLocal() has been called.

-Ekr