Vol. I · No. 46The protocol sectionSat, 10 Oct 2026
Layer 7 · Media · a call over a direct or relayed path

WebRTC

Real-time communication in the browser

WebRTC is a whole calling stack built into the browser. It finds a path between two peers through their NATs, encrypts the media without asking, and sends audio, video and data directly between them — with no plugin, using a direct path when possible or a TURN relay when necessary.

WebRTC gets two browsers communicating across NAT with ICE, with encryption that cannot be turned off.

Operates at
Layer 7
a browser API
Ports
Dynamic UDP
chosen by ICE
Encryption
Mandatory
DTLS-SRTP
Signalling
Yours
the spec leaves it out

How it works

Two peers, three problems: find, agree, secure
1 · Signalling — the part you build yourself
The spec deliberately omits it: use WebSocket, HTTP, SIP, anything. It carries the SDP offer and answer between the two peers.
2 · ICE — find a path that actually works
STUN asks a public server “what does my address look like from outside?” to discover the NAT mapping.
Candidates are gathered and tested in pairs; if nothing direct works, TURN relays the media as a last resort.
3 · DTLS-SRTP — secure before a single frame
A DTLS handshake over the chosen path derives the SRTP keys. There is no unencrypted WebRTC — media and data channels are both protected.

Once ICE settles, media and data use the selected candidate pair. A direct path is preferred, but when connectivity checks cannot establish one, traffic goes through a TURN relay — which costs bandwidth someone has to pay for.

The main points

What WebRTC does, step by step

1
Exchange an offer

One peer creates an SDP offer; your own signalling channel carries it to the other, which answers.

2
Gather candidates

ICE collects host, STUN-discovered and TURN-relayed addresses and trades them with the peer.

3
Find a working pair

Candidate pairs are probed until one succeeds — direct if possible, relayed if not.

4
Secure and stream

DTLS derives SRTP keys over that path; audio, video and data channels then flow between the peers.

The pieces it is made of
ICE — the path-finding framework
STUN — discover your public address
TURN — relay when nothing else works
SDP — offer and answer
SRTP — the encrypted media
Data channels — SCTP over DTLS

In cybersecurity

WebRTC is encrypted by mandate rather than by option — its real risks are about what a peer-to-peer connection reveals, and what your signalling lets through.

IP address leakage

ICE candidates expose local and public addresses to the peer — the classic “WebRTC leak” past a VPN.

Signalling is your problem

The spec secures the media and leaves authentication of the offer entirely to you.

Consent and permissions

Camera and microphone need explicit user permission, and browsers show an indicator throughout.

TURN credentials

An open relay is bandwidth theft; issue short-lived, per-session credentials.

Media is end to end

A relay forwards packets it cannot read — but an SFU that re-encrypts them can.

Fingerprint the DTLS

The SDP carries a certificate fingerprint; verifying it is what binds the media to the signalling.

Rides in the stack

IPUDPDTLS / SRTPWebRTC

Not one protocol but an assembled stack — ICE to find the path, DTLS to secure it, SRTP and SCTP to fill it.

Works with

RTPDTLSSIP

Paths & channels

Candidate types
Hosta local address
Server reflexivevia STUN
Relayedvia TURN
Peer reflexivefound in probing
What flows
Audio / videoSRTP
DataSCTP / DTLS
ReportsRTCP
KeysDTLS handshake