[Wish] Trickle ICE and ICE restart

Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com> Mon, 13 September 2021 14:33 UTC

Return-Path: <sergio.garcia.murillo@gmail.com>
X-Original-To: wish@ietfa.amsl.com
Delivered-To: wish@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C108C3A084F for <wish@ietfa.amsl.com>; Mon, 13 Sep 2021 07:33:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 sLWKKOgnXoVG for <wish@ietfa.amsl.com>; Mon, 13 Sep 2021 07:33:01 -0700 (PDT)
Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5BE8F3A0852 for <wish@ietf.org>; Mon, 13 Sep 2021 07:33:01 -0700 (PDT)
Received: by mail-pf1-x42c.google.com with SMTP id v123so9000472pfb.11 for <wish@ietf.org>; Mon, 13 Sep 2021 07:33:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=r84DgoahukPuowTAtlwJQPDUdqhnixoGR4/I9ZKxHVc=; b=anm4dhAHUlX47zaNP8lESiDgUWqGDlxb9Yi7sBYPUGcFKYqfA0ZSs5hE1PClvWRNCT Q78ZzEDMmvrdH2QgT5uMEfkM/Z9dbhkJpjDoYmE4kb3hR9QmQXsAF0+ZbVZJOZINib9p mHsQ4p1wYxb4Fg/t2koEwNz2G6nQA4J7/tEas4Ivwj5heVKd4NOcGpBkFxu1iWshWWtR cx0t4g4bR9NMnQmyqcfRMAmZV3YhNFPRFEM7jhUxo7KenqDIFonBciBEw84NyaiHxAzM jxp9pxBb4jj6oBZr3qEZ0zFBFa8utq+WhGbJqCGx94iCz3NzaGdzWGeOMUo9aLsWu9OW Y6RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=r84DgoahukPuowTAtlwJQPDUdqhnixoGR4/I9ZKxHVc=; b=A9J5+l1MkPQFCbJ5nc/X6UpiI5c7Y2/1Ld3tAbHRqcBLehScWfONjVtZyVAl44HzYh UngLEOkTKkPt2u+YSrkDJFEuu3bYEhStmlrQSNVXsg1admG0DEpmrIkYpBh9uJP4Yk8C WP+uOlIepeaUImTEfuFaeQzwlYOZXC4BCIR+6xU/C8oyjx4SUdj86NYQ7/rtzvUOAxQE 9PURjIXYcyOdjYRwiyI4ThJk9h/Ya4qwMPP6LfppKIvNTL9hCeezJy2ADDHpqWHK2j49 vNXsuBe4O87UwgWYki6wGs28AKSjtqpz0f+McpgUHzEb2OLxI8rcu/cQ8vtRWYy5SvA6 VKhQ==
X-Gm-Message-State: AOAM5310bkF6qeVlhiWesZ5c4Patck6KKGT3lQdY9qdJJ0o/mul25xTd WJP+r2Pu5tN2YGNzN1v4HkElaIuh3KbbvbcveNTFeGT1X4M=
X-Google-Smtp-Source: ABdhPJx8qHEpsZ4vY007F+Rm6mrrXmuPrQkgaczeI8w67r6DST/j529yShqpKsu8CS7FYSS2RWnaM0IHVNfSzpU98Vs=
X-Received: by 2002:a62:8fc3:0:b0:405:473a:7461 with SMTP id n186-20020a628fc3000000b00405473a7461mr11568102pfd.28.1631543579110; Mon, 13 Sep 2021 07:32:59 -0700 (PDT)
MIME-Version: 1.0
From: Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com>
Date: Mon, 13 Sep 2021 16:32:48 +0200
Message-ID: <CA+ag07Y1NBSAqSgiV7SXj2chuQ6PSYbha9n9OmLZ8250yxTbkA@mail.gmail.com>
To: WISH List <wish@ietf.org>, Christer Holmberg <christer.holmberg@ericsson.com>
Content-Type: multipart/alternative; boundary="00000000000077efcf05cbe15713"
Archived-At: <https://mailarchive.ietf.org/arch/msg/wish/bu3onvedQQGZtjWpjsNI1xJ8jao>
Subject: [Wish] Trickle ICE and ICE restart
X-BeenThere: wish@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: WebRTC Ingest Signaling over HTTPS <wish.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/wish>, <mailto:wish-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/wish/>
List-Post: <mailto:wish@ietf.org>
List-Help: <mailto:wish-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/wish>, <mailto:wish-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 13 Sep 2021 14:33:09 -0000

Hi all,

I have added both trickle ice and ice restart to the js whip client, and
here are my findings while doing so:

1) The trickle-ice-sdpfrag payload seems a bit weird when following
the rfc8840 procedures for generating it:

a=ice-ufrag:v2kP
a=ice-pwd:OyaIFlRkSjK4dnx1KfasyJk1
m=audio RTP/AVP 0
a=mid:0
a=candidate:1387637174 1 udp 2122260223 192.168.0.39 52508 typ host
generation 0 ufrag v2kP network-id 1
a=candidate:3471623853 1 udp 2122194687 192.168.64.1 52509 typ host
generation 0 ufrag v2kP network-id 2


As we are using bundle only, we only send the candidates for the first line
and the procedures in rfc8840 seem to mandate the use "m=audio RTP/AVP 0"
which is quite awkward (not sure what I would need to put if doing a video
only session).

If we could just extend the ABNF grammar, we could just send the candidates
at session level, and maybe even omit the ice-pwd attribute:

a=ice-ufrag:v2kP
a=ice-pwd:OyaIFlRkSjK4dnx1KfasyJk1
a=candidate:1387637174 1 udp 2122260223 192.168.0.39 52508 typ host
generation 0 ufrag v2kP network-id 1
a=candidate:3471623853 1 udp 2122194687 192.168.64.1 52509 typ host
generation 0 ufrag v2kP network-id 2


@Christer Holmberg <christer.holmberg@ericsson.com>om>, as the author of the
rfc8840, what do you think?

Surprisingly, the end-of-candidates flag is supported at session level, so
this is valid according to the spec:

a=ice-ufrag:v2kP
a=ice-pwd:OyaIFlRkSjK4dnx1KfasyJk1

a=end-of-candidates

2) There is a potential race condition between 2 PATCH requests, one for
updating candidates and another one for ice restart.

If you send a patch request for adding new remote candidates with ice user
fragment "A", and then you send an ice restart with user fragment "B", it
could be possible that they are processed in reverse order by the media
server, first doing an ice restart to "B" and then, when receiving the
candidates request, doing another request to "A".

We have 3 different ways of solving this:
- Force the client to send the PATCH request sequentially and not allow it
to have 2 in-flight requests (which can cause problems if the first request
is sent while there was poor connectivity and the ice restart is sent just
after the connectivity is restored).
- Force the server to remember past usernames for the client and discard
requests with past usernames. (This is the one I am going to implement)
- Remove the ice-pwd field from the sdp fragment so the server can
differentiate between both.

3) We have not defined the response code/bodies of the patch requests. I
would propose the following:

- For ice candidates, the server must return 204 (no content) status code
and no body
- For ice restarts, the server must return a 200 OK status code with a body
trickle-ice-sdpfrag containing the new username and fragment and
optionally the server candidates.

4) There is a bug in chrome that returns a different value for the ice
username on the ice transport api than the one set on the local description.

Thoughts?

Best regards
Sergio