Trickle ICE
lastmod 2023-04-12created 2020-07-225 edits
Trickle ICE is an optimization of the ICE specification for NAT traversal.
The main bottleneck in ICE is the time it takes to start initiating connectivity checks – it requires collecting all ICE candidates in advance, which in turn means interacting with external servers (STUN and TURN servers). This takes several round trips.
Trickle ICE makes the whole process parallel by having the ability to send single or multiple ICE candidates when they become available without waiting for the collection of all candidates.
About
Normally, each peer collects ICE candidates, completes the list, and then exchanges it all at once. However, combined with SDP's offer/answer model, this approach becomes a drawback. Collecting candidates takes a long time, and the process can be delayed depending on the network environment. Also, it is said to be inefficient because the other peer can only collect ICE candidates after one peer has finished collecting its own. Trickle ICE is what makes this inefficient candidate exchange run as a parallel process. It can be described as a technique that turns the process of two peers collecting and exchanging ICE candidates from a synchronous process into an asynchronous one.
In other words, an ICE framework with the Trickle option enabled starts exchanging ICE candidates as soon as each peer finds them. So it can find a mutually connectable ICE sooner. Thanks to this option, the ICE framework can check the connection state between peers while optimizing the time it takes to connect. In conclusion, it is said that the Trickle option should be enabled whenever possible.
APIs
- RTCPeerConnection.canTrickleIceCandidates
Online Tools
- Trickle ICE
- https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/
- Local download - Trickle-ice-f40401d.zip
See also
Favorite site
- [Recommended] Trickle ICE - WebRTC Glossary - video
- [Recommended] WebRTC samples Trickle ICE (Trickle ICE connection test)
- RTCPeerConnection.canTrickleIceCandidates - Web API | MDN
- draft-ietf-mmusic-trickle-ice-02 - Trickle ICE: Incremental Provisioning of Candidates for the Interactive Connectivity Establishment (ICE) Protocol