Sitemap

How the networks of your clients affect their user experience and your server infrastructure costs in a WebRTC platform

10 min readMay 12, 2026

--

Press enter or click to view image in full size
WebRTC connectivity paths

TLDR 1: WebRTC prefers UDP over TCP because a UDP packet loss produces brief, barely-perceptible glitches. TCP packet loss produces freezing, stuttering, and audio-video desynchronization.

TLDR 2: The optimal WebRTC connection will always be a direct UDP connection between the client and the media server, over a dedicated random port. This usually means opening a wide range of UDP ports (50000–60000) on the media server’s and client’s firewalls.

In our scenario where clients connect to a known media server, STUN can help keeping the client’s port open to allow direct connections (UDP hole punching).

In our scenario where clients connect to a known media server, TURN is still necessary to support the most restrictive client networks (TURN relay over TLS).

--

--

OpenVidu
OpenVidu

Written by OpenVidu

Easy videoconference in your web or mobile app