Multiple TURN servers for WebRTC

184 views
Skip to first unread message

Remya Das

unread,
Aug 11, 2015, 8:16:46 AM8/11/15
to TURN Server (Open-Source project)
Hi,

I have configured two TURN servers (rfc5766-turn-server) with 6 ports open in each to make an application which is based on WebRTC. The clients can be Chrome or Firefox.

The testing of WebRTC calls across different versions of Firefox leads me to the following findings.
(Lets name the TURN servers TurnA and TurnB)

1. For a single WebRTC call, both TURN servers are allocating ports on it. i.e., TurnA allocating 2 ports and TurnB allocating 2 ports. Even if the call is happening though TurnA, the TurnB reserving the ports already allocated and which will release only when the call terminates.

2. The number of ports allocating in different versions of Firefox is different.

Browser     |     No of sessions/ports used on one TURN server

===================================================
Firefox 31  |                                  6
------------------------------------------------------------------------------------------
Firefox 37  |                                  3
------------------------------------------------------------------------------------------
Firefox 38  |                                  3
------------------------------------------------------------------------------------------
Firefox 39  |                                  1
------------------------------------------------------------------------------------------
Chrome     |                                  1
------------------------------------------------------------------------------------------

Why this is happening?
How can I prevent the wastage of ports since its allocating ports which is not using for the actual call.
How can I increase the number of concurrent calls?

Thanks
Remya

Warren McDonald

unread,
Aug 11, 2015, 7:20:52 PM8/11/15
to TURN Server (Open-Source project)
This behaviour is due to browser collecting ICE candidates from every server/protocol combination. If you include UDP TCP TLS and alternate ports for any of these, then your port count will be higher.

The issue of not deallocating these unused ports until a call is finished can be annoying. It creates a lot of noise in logging and status and makes it harder to debug real issues. My understanding is that keeping the validity of theses other TURN sessions allows the browser to switch over to another path without repeating initial auth.

Reply all
Reply to author
Forward
0 new messages