Skip to content
Tutorials Center
My learning

Topics

Lesson 25 of 36 ยท Servers: STUN, TURN and SFU

Mesh, MCU and SFU: Choosing a Multi-Party Topology

Compare mesh, MCU and SFU architectures for group video calls. Calculate bandwidth per participant, understand server cost and latency, and pick the right topology for your app.

A one-to-one call is simple: two peers, one connection. The moment a third person joins, you must decide how media flows between everyone. WebRTC does not decide this for you. Three architectures dominate: mesh, MCU and SFU. The right choice affects bandwidth, server cost, latency, features such as recording, and how many people can join.

This lesson explains each topology, does the math so you can predict the load, and gives a clear rule of thumb for choosing.

Mesh: everyone connects to everyone

In a mesh, each participant keeps a separate RTCPeerConnection to every other participant. There is no media server (only signalling).

flowchart TD
  A((A)) --- B((B))
  A --- C((C))
  A --- D((D))
  B --- C
  B --- D
  C --- D

Four people need six connections; each person sends their video three times.

For n participants:

  • Each peer maintains n - 1 connections.
  • Each peer uploads its video n - 1 times (once per other peer, each encoded separately).
  • Total connections in the room: n * (n - 1) / 2.

Mesh is free to run and has the lowest latency, since media goes directly. But upload bandwidth and CPU (encoding the same camera several times) grow quickly. In practice mesh works for up to about 4 participants, rarely more.

MCU: a server mixes everything

A Multipoint Control Unit receives every participant's stream, decodes all of them, mixes them into one composite picture (and one audio mix), re-encodes it, and sends each participant a single stream.

  • Each client uploads once and downloads once, no matter how many people are in the room.
  • Great for weak clients, SIP/phone bridges, and recording a single composite.
  • Very expensive for the server: decoding and encoding is CPU-heavy, and the layout is fixed by the server, not chosen by each viewer. Adds latency.

MCUs are less common today because SFUs are cheaper and more flexible.

SFU: a server forwards, without decoding

A Selective Forwarding Unit receives each participant's stream once and forwards it (as is, without transcoding) to the other participants who want it.

flowchart LR
  A["A uploads 1 stream"] --> S(("SFU"))
  B["B uploads 1 stream"] --> S
  C["C uploads 1 stream"] --> S
  S -- "forwards B and C" --> A
  S -- "forwards A and C" --> B
  S -- "forwards A and B" --> C

Each client uploads one stream and downloads up to n - 1 streams.

  • Upload is constant: one stream per sender.
  • Download grows with n - 1, but an SFU can send each viewer a lower quality layer or only the active speakers (see SFU in Practice: Simulcast).
  • Server CPU is low (no decoding), mainly network bandwidth.
  • Rooms of 50 to hundreds of people are feasible with smart forwarding.

Mesh

Peer to peer No media server
Upload grows n - 1 copies of your video
Up to about 4 Small calls only

Cheapest and lowest latency, but does not scale.

1 / 3

Do the math

Suppose each video stream is 1 Mbit/s. Here is what a participant handles in each topology. The code below turns the formulas into numbers so you can try your own room sizes.

JS Bandwidth per participant

Press Run (or Ctrl + Enter) to see the console output here.

No output.

At 8 people a mesh participant uploads 7 Mbit/s, which most home upload links cannot sustain. An SFU participant uploads 1 Mbit/s, and the SFU can also reduce the 7 Mbit/s download by sending thumbnails of the people you are not looking at.

Choosing: a decision guide

JS Which topology fits?

Press Run (or Ctrl + Enter) to see the console output here.

No output.

This is a deliberately simple rule set. Real decisions also consider cost per minute, regions, E2E encryption needs, and operations skill. But "SFU unless you have a clear reason not to" is a sound default.

Common mistakes

  • Building a mesh for "maybe 10 people". It looks fine in a 3-person test and collapses at 6.
  • Treating an SFU as free. Server egress bandwidth is the main bill.
  • Choosing an MCU for flexibility. The server fixes the layout; an SFU lets each client decide.
  • Forgetting TURN. All three topologies still need relays for some users.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In a mesh of 6 participants, how many connections does each peer keep?

    Each peer connects to the other n - 1 = 5 participants. The room as a whole has 15 connections.
  2. 2. What is the main cost of an MCU?

    An MCU decodes every stream and encodes a composite, which is CPU-intensive.
  3. 3. How many streams does a participant upload in an SFU call?

    The SFU receives one upload per sender and forwards it to everyone else.
  4. 4. Which topology is the usual default for modern group video apps?

    SFUs scale to large rooms with low server CPU and let each viewer receive a suitable quality.

Summary

  • Mesh: no server, n - 1 uploads per peer; fine up to about 4 people.
  • MCU: server mixes into one stream; easy for clients, expensive for the server.
  • SFU: server forwards streams unchanged; constant upload, flexible download, the modern default.
  • Estimate bandwidth before choosing; plan TURN for all topologies.

Next: SFU in Practice: Simulcast and Layers