ICE restart
Also written restartIce, iceRestart
Throwing away the current ICE session and starting gathering and connectivity checks from scratch under a new ufrag and password.
An ICE restart is the specified way to recover when the current path dies, typically because the network changed underneath you. The agent picks a new ice-ufrag and ice-pwd, gathers candidates again, and runs a fresh set of connectivity checks. The old check list and the old valid pairs are discarded.
In the browser it is pc.restartIce(), or createOffer({ iceRestart: true }) if you want to drive it by hand.
The cost is the part people underestimate. A restart needs a full offer/answer round trip through your signalling server before a single check goes out, and then the checks themselves have to complete. On a phone that just moved from Wi-Fi to LTE, the server keeps sending media down the dead path for that entire window.
If you own both ends, there are cheaper ways to move to a new path that do not tear down the ICE session at all.
Read more
- Fast WebRTC reconnection without a full ICE restartWhen a phone moves from Wi-Fi to cellular, an ICE restart costs a full offer/answer. Against your own SFU there are faster ways to move the call.
- Faster WebRTC call setup with iceCandidatePoolSizeiceCandidatePoolSize gathers STUN and TURN candidates before the offer exists. In Chromium it cut gathering from 456ms to 2ms. It only works once.