Skip to content

Advertising / Reading ICE trickle support #2898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
delthas opened this issue Sep 5, 2024 · 6 comments · May be fixed by #3097
Open

Advertising / Reading ICE trickle support #2898

delthas opened this issue Sep 5, 2024 · 6 comments · May be fixed by #3097

Comments

@delthas
Copy link

delthas commented Sep 5, 2024

TL;DR, this is the issue for tracking the TODO at https://github.com/pion/sdp/blob/master/jsep.go#L91

ICE trickling helps speed up the connection establishment. For it to work though, the receiving side should support it. If we send ICE candidates after the SDP payload for clients who do not support ICE trickling, these candidates would be ignored; we could even send an offer without any candidates and the call would fail entirely.

To know whether the other side supports ICE trickling:

  • The support can be advertised through the signaling channel (which will work without this ticket)
  • The support can be advertised through an SDP ICE option, a=ice-options:trickle

https://datatracker.ietf.org/doc/html/rfc8840#section-4 specifically mentions:

Trickle ICE Agents MUST indicate support for Trickle ICE by including the ice-option "trickle" within all SDP Offers and Answers in accordance to [RFC8838].


To do this, we probably need to add an "ICETricklingSupported" bool option to webrtc.OfferAnswerOptions that the user can set. If set, the a=ice-options:trickle attribute is added to the generated SDP payload.

In addition, we would need to be able to know if the remote side sent the attribute, corresponding to https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/canTrickleIceCandidates in the Web spec. This would probably be a method on SessionDescription?


As for the actual use case, I'd like to half ICE trickling optimistically to speed up connection establishment in an environment where I do not control the remote client so I do not know whether trickling is supported.

@Sean-Der
Copy link
Member

Sean-Der commented Oct 7, 2024

Hey @delthas, Sorry for the delay.

It would be trivial adding a=ice-options:trickle to the Offer/Answer (from Pion). Are you interested in doing that? We shouldn't just uncomment the line in jsep.go, but instead have pion/webrtc pass it in somehow.

We don't care if the remote trickles or not! I don't believe any logic needs to be added as a receiver.

If you aren't interested in contributing tell me and I can have this fixed in 30 minutes :)

@Sean-Der Sean-Der added this to the V4.1.0 milestone Feb 13, 2025
@ValorZard
Copy link

ValorZard commented Apr 13, 2025

Looking at the latest RFC, why is it called ice2?
https://datatracker.ietf.org/doc/html/rfc9725#section-4.3.3

Image

@JoeTurki
Copy link
Member

@ValorZard This is the ice version.

While this specification formally relies on [RFC8445], at the time of
its publication, the majority of WebRTC implementations support the
version of ICE described in [RFC5245]. The "ice2" attribute defined
in [RFC8445] can be used to detect the version in use by a remote
endpoint and to provide a smooth transition from the older
specification to the newer one. Implementations MUST be able to
accept remote descriptions that do not have the "ice2" attribute.

@ValorZard ValorZard linked a pull request Apr 13, 2025 that will close this issue
2 tasks
@ValorZard
Copy link

gotcha, thanks!

@ValorZard
Copy link

https://datatracker.ietf.org/doc/html/rfc9429#section-5.2.1 seems like adding ice2 at the end is mandatory

@nils-ohlmeier
Copy link

https://datatracker.ietf.org/doc/html/rfc9429#section-5.2.1 seems like adding ice2 at the end is mandatory

Warning do not just put ice2 into the SDP. You should do that only if the implementation support RFC 8845. So far none of the browsers support 8845.
I guess it is an area which Pion could spearhead. But implementing ice2 support is a big project. Especially since you need to keep full backward compatibility to ice1, which everyone else is using so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

5 participants