Skip to content

Commit 4d1bc54

Browse files
authored
Certain enhancements, from my experience I wish I knew sooner (#760)
* Remove unused ErrTurnCredentials as it is no longer used. It was used when CredentialType was an option, but it is now deprecated. Ref: https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#credentialtype * Enhance WebRTC documentation with reliability and tests Added details on configurable reliability and interoperability tests. * Enhance clarity on WebRTC signaling process Clarify the roles of codecs, media, and data channels in WebRTC signaling. Specify that TURN may be used for peers behind restrictive NAT, not always P2P. * Add SFU and MCU explanations to WebRTC document Added sections on Selective Forwarding Unit (SFU) and Multipoint Control Unit (MCU) to explain their roles in WebRTC. If someone develops a multi-user videoconferencing app, sooner or later they need to know this.
1 parent db7f1c1 commit 4d1bc54

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

webrtc-explained.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ Protocol used by WebRTC Data Channels.
6464

6565
Provides:
6666
- multiple streams
67-
- partial reliability
67+
- configurable reliability
6868
- no head-of-line blocking
6969

70-
Runs inside DTLS.
70+
Runs inside DTLS. Can be configured to be TCP-like or UDP-like or anything in between.
7171

7272
## DTLS (Datagram TLS)
7373
TLS over UDP.
@@ -78,6 +78,8 @@ Used for:
7878
- securing SCTP
7979
- securing SRTP
8080

81+
DTLS does not typically go through CA Root Verification in WebRTC; it is verified in the signalling phase using the key fingerprint.
82+
8183
## mDNS
8284
Masks local LAN IP addresses for privacy (e.g. *.local hostnames).
8385

@@ -126,3 +128,13 @@ Commonly includes:
126128
- timers
127129
- UUID helpers
128130

131+
132+
## Interoperability
133+
Check [WebRTC interoperability tests](https://github.com/sipsorcery/webrtc-interop) for samples in other WebRTC libraries like libwebrtc, pion, SipSorcery and whether they can interoperate with each other.
134+
135+
## Extras
136+
### Selective Forwarding Unit (SFU)
137+
This is not peer-to-peer WebRTC; a central server manages the media streams. This is how certain "mute" functions or noise detection is implemented in multiuser video conferencing. Used to restrict audio/video flow from users, due to administrative controls or due to being "idle" in a video/audio call.
138+
139+
### Multipoint Control Unit (MCU)
140+
This is an alternate architecture to the above, still not peer to peer but the central server itself takes the responsibility to mix/re-encode the streams.

webrtc-signaling-explained.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This includes exchanging:
1616
WebRTC peers cannot discover each other on their own.
1717

1818
They need to:
19-
- agree on codecs and media setup
19+
- agree on codecs, media and datachannel setup
2020
- share network information
2121
- exchange security fingerprints
2222

@@ -75,7 +75,7 @@ Contain:
7575
6. Peer B sends Answer back via signaling channel
7676
7. Both sides exchange ICE Candidates
7777
8. ICE finds a working route
78-
9. Peers connect directly
78+
9. Peers connect directly (or through a TURN relay, but still end-to-end encrypted)
7979

8080

8181
## Signaling Server Responsibilities
@@ -95,7 +95,7 @@ It does *not*:
9595

9696
Once the WebRTC connection is established:
9797
- the signaling server is no longer required
98-
- peers communicate directly (unless TURN is used)
98+
- peers communicate directly (unless TURN is used when the peers are behind restrictive NAT)
9999

100100

101101
## Simplified Diagram

0 commit comments

Comments
 (0)