How WebRTC works
WebRTC connects two browsers directly. They exchange offers through a signalling server, use STUN to discover their public addresses, punch through their NATs and then send encrypted audio and video straight to each other.
Layer: Application (OSI layer 7) · Port: dynamic · Transport: UDP (SRTP) · Format: SDP offer/answer + RTP media · Standard: RFC 8825
WebRTC packet flow
- STUN Client → STUN Server: Binding request - what's my public IP?
- STUN STUN Server → Client: Your address 203.0.113.7:61234
- SDP Client → Their Laptop: Offer (via signalling server) + ICE candidates
- SDP Their Laptop → Client: Answer + candidates
- SRTP Client → Their Laptop: Direct encrypted video (peer to peer)
Other protocols: HTTP · WebSocket · QUIC · SMTP · IMAP · POP3 · FTP · SMB · SIP · RTSP · RTMP · MQTT · Modbus · PPPoE