2

As you might know, webrtc said to be peer-to-peer. But this true, when both sides can see each other and communicate inside of network, which is not achievable all the time (because of NATs and firewalls). So in these scenarios, STUN servers are not useful, and should use TURN servers instead. TURN servers used to be as a relay, connecting every peer to each other.

But as connection established, through the nature of TURN, the latency goes up. This can be a high value (for me 5-10 seconds) which ruins the UX of video calls.

I'm using coturn which is one of the most famous opensource TURN server out there.

The first question is that is there a way to reduce this latency caused by TURN server? For example, using a server that has lower ping time can be a better choice instead of a server with high value? is hardware is critical and improving the CPU power and RAM can decrease the latency?

The second question which is more important, what can I do in my client area, blurring this latency? I mean, is there any solution (UX based for example) to reduce impact of latency?

Thanks for any response.

Ali Bahrami
  • 910
  • 9
  • 21
  • How do you deploy your TURN Server and (more important) how do you measure the latency. Do you measure it as the round trip of the rtp-packets, or the time it takes to establish the connection? – Jeyhey Jul 12 '19 at 18:40
  • Correct me if I do it wrong, I do it by measuring time it takes to see the change between two peers. Usually I do it by two devices (one laptop and one phone) each one connected to different networks, and do the test. I do it by applying a change into one video, and see how much time it needs to change into another. – Ali Bahrami Jul 13 '19 at 11:16

1 Answers1

0

A TURN relay adding 5-10 seconds of latency is certainly unusual. This should usually be in the order of only 50ms-100ms more. This does however very much depend on the location of the TURN server. If you have two users in Australia using a TURN server in Ireland that is going to be a bad experience.

Most big TURN deployments use geodns based routing to select a TURN server close to the user which is the most impactful change that can be made.

Philipp Hancke
  • 15,855
  • 2
  • 23
  • 31
  • How do you handle the scenario where a user is in Australia and the other in USA, where should the turn server be, about 1/2 way between the two? – user2677034 Jun 21 '22 at 05:20