Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In webRTC if I am getting remote ice candidates with srflx does that mean that connection should work? (Edit: No that't not all)

I am trying to implement video calls into an existing ionic 3 project for one of our clients, I have used the google code lab as a boiler plate code for sending the offer and answer via Firebase real time data base. This you probably heard(read) before: "my webRTC doesn't work in external network" and the answer would be that:

  1. Use your own STUN server and don't rely on free stun servers like google.
  2. Use TURN server for backup on failed stun attempts.
  3. Understand webRTC before you implement it.

What I want to ask is the following:

  1. In my current setup (using a free google stun server) testing with two different networks , I am seeing remote candidates with typ srflx, I am also seeing typ host but since it is different networks so it holds no interest for me, and obviously no relay as there is no TURN server. I also see that I am providing local candidates with srflx, does this means that my setup should have been enough to establish a connection? I have spent some time trying to figure this one out and I have found a lot of info in this blogpost, but I wasn't able to fully debug the situation.

  2. Suppose we would like to implement our own TURN/STUN setup, our calls are going to be almost entirely in the same country so we won't need multiple servers. Would anyone have an estimation for the following: 1.How much data per minute would entail one video call (ballpark)? 2.Our client likes google cloud services for his project, How much would it cost to spin a TURN server for this project on google cloud platform (again just a ballpark)? is there any idea on the best setup (I was thinking coturn and was looking on this google coturn implementation)?

Thank you all.

Edit: After some more digging, I realized that one of the different networks I was testing was sitting behind a symmetric nat, a nice jsfiddle for testing what kind of nat you have I found in this blog post. In the case of a symmetric nat the iceCandidate received is not suitable for connection and you have to have a TURN server. So I guess that takes care of the 1st part. Any additional data on the 2nd part would be appreciated.

like image 317
nechemya ungar Avatar asked Oct 31 '25 11:10

nechemya ungar


1 Answers

OK so after all this digging I guess I can agree with the 3rd notation (and no I still don't fully get it not even close), if this might help anyone I will share my experience. I was brought into a project (ionic 3) and was told to find and implement a video chat. We chose webRTC. webRTC as far as I know is the only widespread opensource option. In our country a huge number of cellular users are behind symmetric nat so p2p with them won't work. I tested a twilio TURN service and immediately everything started to work. The rough numbers for a basic call would be around 1.5Mb per minute. Thank you for anyone who stumbled upon this and tried to figure out if he can help.

like image 103
nechemya ungar Avatar answered Nov 02 '25 01:11

nechemya ungar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!