0

I would like to create an audio (mic) and video (camera) chat room with 12 people using webRTC. I understand signalling and the need for external services like ICE & STUN to help peers connect with each other.

But I don't want to use a full mesh architecture where everyone connects to everyone else because it is less efficient. I don't want to use expensive TURN relay services. I want the swarm to propagate the streams automatically so that if a direct connection isn't possible, the network routes the stream packets via peers automatically using encapsulation.

I don't want to use star architecture because I don't want a bottleneck peer.

I would like a peer to connect to maybe 2 or 3 other peers (max) and broadcast their media across the network without worrying about the relaying between peers. The routing would obviously need to be controlled by some service but I can't see that it's possible to do the stream encapsulation with RTCPeerConnection. Since WebRTC only allows for a RTCPeerConnection object (1 peer to 1 peer) and a peer would need to distinguish where the incoming stream is coming from and whether it needs to be relayed to another peer.

Is there a technology that extends WebRTC to allow for this more bandwidth efficient architecture?

Phil
  • 1,996
  • 1
  • 19
  • 26
  • if there was, do you think people would bother with servers? – Philipp Hancke May 25 '20 at 15:36
  • You still need a public orchestration server to control how the swarm network routes data packets. That would probably be based on heuristics like available bandwidth, best route from peer A to peer B. etc. Is that an AdHoc network? I am just struggling with the terminology. I just wanna know what it's called so I can google it :D – Phil May 25 '20 at 19:06
  • What do you mean "stream encapsulation"? Architecture seems up to you. I don't see any limitation here. [Relay sample](https://webrtc.github.io/samples/src/content/peerconnection/multiple-relay/). – jib May 25 '20 at 21:23
  • Mesh does not scale well, but you don't need every possible connection for a p2p network to function. If peer A sends their video stream to peer B, how does peer B route the stream of peer A on to peers C, D & E? And how would peer C know that peer B is forwarding peer A stream? Or is this all done under the hood transparently? – Phil May 25 '20 at 23:48
  • webrtc only defines a connection between two ends. What you build on top of that is up to you. – Philipp Hancke May 28 '20 at 17:12

0 Answers0