Reputation: 155
I have considerably read about WebRTC, ICE, Stun and Turn.
Now, When it comes to SFU, I'm not sure, what connection is established between client(end user browser) & the SFU (is it a webrtc connection ??). Could someone elaborate the flow ?
My assumption: When it is SFU based architecture. SFU & Client establish webrtc connection & send data to each other. SFU knows all the people in the current room & sends the data accordingly. Initial signalling gets the ice candidates of the sfu server to the client & vice-versa.
Am I correct ?
Upvotes: 1
Views: 666
Reputation: 42450
Yes the connection between a client and an SFU is a WebRTC connection. The SFU is acting as a peer end-point.
There's no distinction made in the w3c specification between a peer and an SFU, except it leaves out defining reception of simulcast in browser-based clients, something you'll need an SFU (or MCU) for.
setRemoteDescription
it will be sending multiple encodings (layers) of a single video track:pc.getSenders()[0].getParameters().encodings.length // > 1 means simulcast
pc.addTransceiver(videoTrack, {sendEncodings: [
{rid: "hi"},
{rid: "mid", maxBitrate: 500000, scaleResolutionDownBy: 2},
{rid: "low", maxBitrate: 150000, scaleResolutionDownBy: 4},
]});
You don't have to use simulcast for video, but it's common. Sending of audio is simpler and typically negotiated as well, along with client reception of both.Each participant has an encrypted connection that terminates at the SFU middle-box, not with each other. This means that even though WebRTC is always encrypted, your connection to the other participants is not technically end-to-end encrypted. Therefore, make sure you trust or control your SFU. Standard solutions for e2ee over SFUs are in development.
Upvotes: 4