On Mon, 24 Sep 2018 at 16:55, Krishna Isola <
apv.k...@gmail.com> wrote:
>
> Greetings!
>
> I’m looking for clarification and to improve my knowledge on the below topic of discussion.
>
> Topic of discussion: In what scenarios STUN/TURN (say CoTurn) server is required along with MediaSoup Server?
>
> My understanding of STUN/TURN is as follows:
> * During signaling negotiation, each user shares their ICE candidates which includes STUN & TURN candidates
Not entirely true since mediasoup server is Ice Lite, meaning that it
does not require ICE candidates from clients but, instead, will wait
for RTP in its open ports to know the client's remote IP, port and
transport protocol (UDP or TCP).
> a) User-A & User-B are accessible within the network (or subnet): I believe no STUN/TURN is required
mediasoup must run (unless local deployment just for local networks)
in a server with public IP (or with mapped public IP). There is no
peer to peer media flows when using mediasoup.
> MediaSoup Deployment Scenarios:
>
> Note: For the discussion sake, “CoTurn” STUN/TURN server deployed along with MediaSoup
>
> 1. On-Prem MediaSoup Server module
>
> * On-Prem means deployed within a LAN network (organization)
>
> 1.1) MediaSoup being SFU, does it really need STUN/TURN server?
It may need a TURN server (see bottom of the email).
> 1.2) If so, when and how it is useful
>
> 2. Cloud Deployment of MediaSoup Server module
> * Let’s say deployed on AWS EC2 instance: Mediasoup Server Application + CoTurn
>
> 1.1) MediaSoup being SFU, does it really need STUN/TURN server?
Same, see bottom.
> 1.2) If so, when and how it is useful
If you run mediasoup in a local network, it will be hard to connect to
it clients outside that local network (unless you have a VPN and all
the clients use that VPN, or unless you open and map a public IP and
all the RTP port range to the private IP and ports).
Now, let's assume normal deployments, this is: mediasoup running a
server with public IP reachable from any one in the world) or within
AWS or similar (in that case, you need to map the public IP to the
private one in the server and let mediasoup Server to know about such
a public IP, there is a setting for that in the
mediasoup.Server(settings) API).
In these scenarios, when is TURN required?
In case a client is behind a firewall that blocks outgoing UDP or
"uncommon" TCP (this is, anything but 443 nowadays unfortunately). In
that case, you need to setup a TURN server with TLS enabled on port
443 and configure your clients (mediasoup-client inside) with the TURN
address + credentials). So, the client will send and receive
audio/video to/from the IP and port 443 of the TURN server, which will
relay it to/from the corresponding UDP port open by mediasoup server.
--
Iñaki Baz Castillo
<
i...@aliax.net>