In WebRTC, what is the role of a signaling server?
WebRTC media flows peer-to-peer, but the two peers first need to discover and agree on how to connect. The signaling server is the out-of-band channel (often WebSocket) that relays this setup metadata: the SDP offer and answer describing media capabilities, plus ICE candidates describing network paths. Crucially, WebRTC does not specify the signaling protocol — you build it. Once signaling completes the handshake, media flows directly between peers and the signaling server is no longer in the media path.
2 / 5
What is the difference between a STUN server and a TURN server?
Both address NAT traversal. STUN (Session Traversal Utilities for NAT) lets a peer find out its public-facing IP and port so it can advertise a reachable address — cheap and enables a direct peer-to-peer path in most cases. But some restrictive NATs/firewalls block direct connections entirely. TURN (Traversal Using Relays around NAT) is the fallback: it relays media through a server, guaranteeing connectivity at the cost of bandwidth and latency. ICE tries the cheapest option first (direct/STUN) and falls back to TURN only when necessary.
3 / 5
What is the ICE framework in WebRTC?
ICE (Interactive Connectivity Establishment) is the process of finding a working network path between peers that may be behind NATs and firewalls. Each peer gathers candidates — possible addresses: its local IP (host candidate), its public IP via STUN (server-reflexive), and a relay address via TURN. The peers exchange candidates through signaling, then systematically test pairs to find the best connectable path, preferring direct routes over relayed ones. This negotiation is why WebRTC can connect peers in difficult network conditions where a naive direct connection would fail.
4 / 5
In the WebRTC handshake, what are the SDP offer and SDP answer?
SDP (Session Description Protocol) messages negotiate the session. The initiating peer creates an offer — codecs it supports, media tracks, encryption parameters, network info — and sends it via signaling. The remote peer responds with an answer selecting compatible options. This offer/answer exchange establishes the agreed media format and parameters before media flows. SDP is a text format; manipulating it directly ("SDP munging") is sometimes done to force codec choices, though it is fragile and discouraged in favor of the proper API.
5 / 5
Why is WebRTC media described as peer-to-peer, and what is the implication for scaling group calls?
In a 1:1 call, direct peer-to-peer media is ideal: low latency, no server media cost. But in a group call, a full mesh means each participant sends their stream to every other participant — uplink bandwidth and CPU grow with the number of peers (an N-squared problem) and quickly become infeasible. The standard solution is an SFU (Selective Forwarding Unit): each peer sends one upstream to the SFU, which selectively forwards streams to others. This trades pure peer-to-peer for scalability and is how most production video platforms handle multi-party calls.