Try it free

← BlogProtocols9 min read

What is a WebRTC server? SFU vs MCU vs mesh, explained with diagrams

WebRTC lets two browsers send video straight to each other. So why does every serious WebRTC product run servers? Because "straight to each other" stops working at about the fourth person.

Four kinds of "WebRTC server"

The phrase covers four different jobs, often done by different software:

Server Job Touches media?
Signalling Swaps session descriptions so peers can connect (WHIP/WHEP standardise this) No
STUN Tells a client its public address, to get through NAT No
TURN Relays media when no direct path exists (strict firewalls) Relays it
Media server (SFU / MCU) Receives streams and routes or mixes them to everyone else Yes

When people search for a "WebRTC server", they almost always need the last kind: a WebRTC media server.

Mesh, SFU and MCU

Three WebRTC topologies with five participants Mesh: every participant connects to every other, ten links, each sends four streams. SFU: each participant sends one stream to the server and receives four forwarded streams. MCU: each participant sends one stream and receives one mixed stream from the server, which decodes and re-encodes everything. Mesh SFU MCU SFU each sends 4, receives 4 no server, weak uplinks suffer each sends 1, receives 4 server forwards, never decodes each sends 1, receives 1 server decodes, mixes, encodes
Five people, three designs. The SFU is the default for modern WebRTC: light on the server, and each viewer still gets separate streams to lay out as it likes.

Mesh: no media server

Every participant sends a copy of their video to every other. It needs no server beyond signalling, but each person's upload grows with the group. With n people there are n(n−1)/2 connections, and each laptop encodes and uploads n−1 streams. Past three or four people, home connections give up.

Upload per participant at 1.5 Mbps per stream Upload needed per participant for 2, 4, 6, 8 and 10 people. Mesh: 1.5, 4.5, 7.5, 10.5 and 13.5 Mbps. SFU or MCU: 1.5 Mbps at every size. 0 4 8 12 16 Mbps Mesh: 13.5 Mbps SFU / MCU: 1.5 Mbps 2 4 6 8 10 people in the call
Arithmetic, not a benchmark: upload = (people − 1) × stream bitrate in a mesh, and one stream with a media server.

SFU: Selective Forwarding Unit

Each participant uploads once; the server forwards packets to whoever needs them without decoding. That keeps the server cheap per stream. With simulcast, the sender uploads two or three qualities at once and the SFU picks which to forward to each viewer, so a phone on a weak connection gets the low one. Nearly every modern video calling and WebRTC streaming platform is built on SFUs.

MCU: Multipoint Control Unit

The server decodes every stream, composes a single picture and encodes it again. Each participant receives one stream, which suits old room systems and very weak devices, but the server pays a full transcode per layout. MCUs are mostly found in legacy video conferencing today.

WebRTC for live streaming: one to many

Broadcasting is the SFU idea with one sender: a single stream comes in over WHIP and fans out to every viewer over WHEP, each one a separate encrypted session with sub-second delay. Because every viewer is a live session rather than a cached file, a WebRTC streaming server is usually paired with HLS: WebRTC for the people who interact, HLS through a CDN for the crowd.

STUN and TURN, briefly

Most devices sit behind NAT and do not know their own public address. A STUN server tells them. When firewalls block every direct path, as on many corporate and some mobile networks, a TURN server relays the media instead. A media server with a public address and an open UDP port (with a TCP fallback) avoids most TURN use, because clients connect to it directly.

Choosing a WebRTC media server

creekX is a self-hosted WebRTC streaming server: WHIP in from browsers, phones and OBS, WHEP out with sub-second delay, plus RTMP, SRT and RTSP in and low-latency HLS out from the same stream. Guests can join a live from a link (live with guests). Try it free.

Frequently asked questions

What is a WebRTC server?

A server that terminates WebRTC connections so media can be routed between many participants or viewers. It usually means a media server (an SFU or MCU), as opposed to the signalling server or the STUN and TURN servers that help connections get through networks.

What is the difference between an SFU and an MCU?

An SFU (Selective Forwarding Unit) forwards each incoming stream to the participants who need it without decoding it. An MCU (Multipoint Control Unit) decodes all streams, mixes them into one layout and re-encodes it. SFUs scale better; MCUs send each viewer a single stream.

Do I need a TURN server?

For reliable connections from strict corporate or mobile networks, yes. STUN lets a client learn its public address; TURN relays the media when no direct path works.

Can WebRTC be used for live streaming to many viewers?

Yes. A WebRTC media server receives one stream, for example over WHIP, and serves it to each viewer over WHEP with sub-second delay. For very large audiences it is often paired with HLS through a CDN.