SAZRIKA LEARN
Learn / How a WebRTC call connects

How a WebRTC call actually connects

Every browser video call you have ever joined went through the same four stages before you heard a single word. None of it is visible, and most of it happens in under a second. Here is the whole sequence, tied together.

Stage 1: the two sides introduce themselves

Before anything else, both browsers need to describe what they are proposing: which codecs they support, what kind of media, how they want to secure it. That description is SDP, and one side sends an offer while the other replies with an answer. This exchange has to travel through some channel the app itself controls, often a plain websocket to a server, since WebRTC deliberately does not define how the two sides find each other in the first place.

Stage 2: both sides go looking for a path

At the same time, each browser starts gathering every address it might be reachable on: its private network address, its public address discovered through a STUN server, and a relay address from a TURN server as a fallback. Each one of these is called a candidate, and this whole gathering process is ICE.

The candidates get exchanged alongside the SDP, and then both sides start testing pairs of candidates against each other, trying combinations until they find one that actually works. This is the NAT traversal problem being solved live, and it decides whether your call ends up direct or relayed through a TURN server.

Stage 3: the two sides prove who they are

Once a working candidate pair is found, the browsers still cannot just start sending your voice. First they run a security handshake called DTLS over that exact path, using the certificate fingerprint that was included back in the original SDP. This step is what stops a stranger from being able to inject themselves into an established connection.

Try it yourself

Watch stages 1 and 2 happen on your own connection

The ICE Candidate Inspector shows your browser gathering candidates live, in real time, the same process described above.

Open the ICE Inspector →

Stage 4: your voice finally moves

Only now, after signaling, ICE, and the security handshake have all succeeded, does your actual audio and video start flowing, encrypted, over the winning path. This is the media stage we cover in how a call works, and it is the only stage most people ever notice, because it is the only one that produces sound.

Everything before it, the offer and answer, the candidate gathering, the security handshake, happens in the second or two of silence between clicking a link and hearing anyone talk.