WebRTC Debugging and Diagnostics Language
5 exercises — 5 exercises practising WebRTC connection states, getStats API, chrome://webrtc-internals, and diagnostic vocabulary.
0 / 5 completed
1 / 5
A user reports their call "dropped". You check the WebRTC logs and see the iceConnectionState transitioned to disconnected and then to failed. What is the difference between these two states?
Disconnected is recoverable — failed is not. Handling both states correctly prevents a brief network blip from destroying a call.
ICE connection state lifecycle: new → checking → connected (→ completed) → disconnected → failed (or back to connected if recovery). Disconnected typically happens during brief network changes: switching Wi-Fi networks, going through a tunnel (mobile), or temporary packet loss. WebRTC's ICE agent continues sending keepalives and connectivity checks during disconnected state. If connectivity resumes within ~5 seconds (browser-configurable), the state transitions back to connected — seamless to the user. If not, it transitions to failed. Application strategy: on disconnected, show "Connection unstable — trying to reconnect..."; start a timer; on failed, attempt ICE restart (pc.restartIce()); on timeout, end the call and prompt the user to rejoin.
Key vocabulary:
• disconnected state — transient; ICE lost connectivity but still attempting recovery; may return to connected
• failed state — terminal; all ICE candidates exhausted; requires ICE restart or call teardown
• ICE restart — pc.restartIce(); generates new ICE credentials and triggers fresh candidate gathering to recover from failed state
ICE connection state lifecycle: new → checking → connected (→ completed) → disconnected → failed (or back to connected if recovery). Disconnected typically happens during brief network changes: switching Wi-Fi networks, going through a tunnel (mobile), or temporary packet loss. WebRTC's ICE agent continues sending keepalives and connectivity checks during disconnected state. If connectivity resumes within ~5 seconds (browser-configurable), the state transitions back to connected — seamless to the user. If not, it transitions to failed. Application strategy: on disconnected, show "Connection unstable — trying to reconnect..."; start a timer; on failed, attempt ICE restart (pc.restartIce()); on timeout, end the call and prompt the user to rejoin.
Key vocabulary:
• disconnected state — transient; ICE lost connectivity but still attempting recovery; may return to connected
• failed state — terminal; all ICE candidates exhausted; requires ICE restart or call teardown
• ICE restart — pc.restartIce(); generates new ICE credentials and triggers fresh candidate gathering to recover from failed state