audio conference with WebRTC - webrtc

i would like build an only-audio conference system based on webrtc for a game, but i must avoid lag.
for example i can use https://github.com/muaz-khan/WebRTC-Experiment/tree/master/RTCMultiConnection
How many clients can be connected in the same time?and about bandwidth?
I think that the upload will be a limit increasing the amount of connected client.
Could i make a Tree of clients, so each client have only 2 or 3 connections?
The server can be in any language because i will use vert.x
regards

There are two scenarios:
1: Peer-to-Peer
In this model; maximum peer connections limit per page on chromium is 256.
2: Peer-to-Server
In this model; you can use media server to relay stream over unlimited peers.
In 1st model; you can face bandwidth/cpu usage issue.
In 2nd model; all such things are handled by the media server.
If you're planning to setup peer-to-peer video-conferencing; you'll use mesh model. It is suggested to limit conferencing to 5 users only. Otherwise, you'll face issues like audio-lost, echo and obviously bandwidth/cpu huge usage!
In broadcasting p2p scenarios; you can relay i.e. forward remote streams to overcome burden from single peer.

Related

Does TURN Server (WebRTC) eliminate redundant uploads (like SFU)?

The problem with p2p apps is the amount of Uploads, since most connections are asymmetrical (weak upload, strong upload).
If you're connected to 10 Peers you have to upload your own video stream 10 times, which quickly falls apart.
SFU (selecting forwarding units) solve this by routing your single upload to all peers.
Does a TURN server do the same? Technically it could, since it's already acting as a relay, but my fear is that it tries to emulate the underlying p2p protocol to closely and hence Uploads are still redundant?
No. TURN servers do not decrypt, SFUs need to do that (and a couple of things that require more logic). They're different components, solving different problems.
No, by default TURN server doesn't do it.
You can take some more complicated webrtc servers like flussonic for example (maybe wowza) and get star topology with them.

Does google meet use WebRTC

I am new to webrtc development, I would like to create a conference room with multiples connections. I have read about webrtc and peer communication. I would like to know if google meet used one peer connection for every participants one another. If so, how can they handle 250 participants without draining the browser resources?
For group calls, Google Meets does not use peer-to-peer, if that was the case, it would drain one's bandwidth very quickly and browser resources quickly.
Although I am not exactly sure about Meets' infrastructure, they most likely use a Selective Forwarding Unit (SFU) to be able to handle lots of connections, since it's common practice for this sort of application.
The SFU works as a webrtc client server-side, and it basically just forwards the stream to clients that are requesting it browser-side.

Will WebRTC clients work with TURN servers which support only Channels and Not Data/Send mechanisms?

I was reading TURN server RFCs. All related RFCs ( 5766 and the more recent 8656) support Channel mechanism to avoid the 36 bytes overheads of STUN headers (Section 2.5 of RFC 5766) required for the send/data approach:
For some applications (e.g., Voice over IP), the 36 bytes of overhead
that a Send indication or Data indication adds to the application
data can substantially increase the bandwidth required between the
client and the server. To remedy this, TURN offers a second way for
the client and server to associate data with a specific peer.
For WebRTC, clearly there is no point in using the send/data mechanism. How do browsers choose between the two mechanisms for relaying? Is send/data a fallback? Will support for Channels alone in a TURN server be sufficient for WebRTC use-case?
They will usually do SendIndications while waiting for the Channel to be created.
SendIndications also are important if you get something on the relay before the Channel is created. Some clients only create the Channel when they send and not right when the permission is created.
Firefox doesn't support TURN channels: https://bugzilla.mozilla.org/show_bug.cgi?id=857736
Chrome also uses send/binding indications until ICE is done (presumably to avoid the overhead of creating channels which are not used later)
Don't rely on partial implementations of a spec, that won't work.

WebRTC - Video conferencing with only one emitter

I am new to WebRTC technology.
I want to create a video chat / video conferencing with a transmitter and many followers (more 1000).
Example:
I read a lot of documentations :
https://medium.com/linagora-engineering/scalability-in-video-conferencing-part-1-276f52b4acac
https://webrtcglossary.com/sfu/
But I still don't know what is the best solution (in my case) between Selective Forwarding Unit (SFU) and Multiploint Control Unit (MCU).
Can you help me to understand?
I think the best way is MCU but I am not sure.
Second question:
Can you suggest some sources and links that can help me to set up such an architecture. Currently my project works perfectly in Peer To Peer (Mesh) but it is not the right solution. I have absolutely no idea how to set this up.
Thank you so much
It is possible to implement this using an SFU. The more peers are connected, the more you would need processing power to handle those new peers. This could be done by using more threads and/or forwarding requests to another machine.
With mediasoup it is possible have control over this. With this tool you have routers where peers can connect to to get the stream. A router works on a worker which has a limited amount of receiving peers (depending on cpu capacity). Now to allow more peers you can forward the stream to other routers which can expand the total capacity.
useful links:
https://mediasoup.org/documentation/v3/scalability/#one-to-many-broadcasting
https://mediasoup.org/documentation/v3/mediasoup/design/#architecture
https://mediasoup.discourse.group/t/scalability-in-mediasoup-example/793/2?u=dirvann

UDP Broadcast, Multicast, or Unicast for a "Toy Application"

I'm looking to write a toy application for my own personal use (and possibly to share with friends) for peer-to-peer shared status on a local network. For instance, let's say I wanted to implement it for the name of the current building you're in (let's pretend the network topology is weird, and multiple buildings occupy the same LAN). The idea is if you run the application, you can set what building you're in, and you can see the buildings of every other user running the application on the local network.
The question is, what's the best transport/network layer technology to use to implement this?
My initial inclination was to use UDP Multicast, but the more research I do about it, the more I'm scared off by it: while the technology is great and seems easy to use, if the application is not tailored for a particular site deployment, it also seems most likely to get you a visit from an angry network admin.
I'm wondering, therefore, since this is a relatively low bandwidth application — probably max one update every 4–5 minutes or so from each client, with likely no more than 25–50 clients — whether it might be "cheaper" in many ways to use another strategy:
Multicast: find a way to pick a well-known multicast address from 239.255/16 and have interested applications join the group when they start up.
Broadcast: send out a single UDP Broadcast message every time someone's status changes (and one "refresh" broadcast when the app launches, after which every client replies directly to the requesting user with their current status).
Unicast: send a UDP Broadcast at application start to announce interest, and when a client's status changes, it sends a UDP packet directly to every client who has announced. This results in the highest traffic, but might be less likely to annoy other systems with needless broadcast packets. It also introduces potential complications when apps crash (in terms of generating unnecessary traffic).
Multicast is most certainly the best technology for the job, but I'm wondering if the associated hassles are worth avoiding since this is just a "toy application," not a business-critical service intended for professional network admin deployment and configuration.