TURN load balancing question

121 views
Skip to first unread message

Robin C

unread,
Oct 2, 2015, 3:07:13 PM10/2/15
to TURN Server (Open-Source project)
Hello,

I am a bit confused about the load balancing. In the TURN performance and Load Balance wiki, the first two load balancing options are:
  1. Set a networking load-balancing equipment that redirects the requests to a member of the TURN servers group. In general case, it must take care about redirecting the requests to the same server from the same client IP - because some TURN sessions from the same client must share the information. There are two cases when different TURN sessions must interact: RTP/RTCP connection pairs (from RFC 5766) and TCP relay (from RFC 6062). If you are not using those features then a simple network load balancing is enough. If you do use those features, then you have to map the whole client IP (with all its network ports) o the same TURN server. Also, if you are using the mobile TURN (from the new MICE draft) then you cannot use the network load balancer option because client sessions from different IP addresses must interact - so you have to use the next option (see below).
  2. Set a less complex scheme with round-robin DNS. The client must send all its requests to the same DNS-discovered TURN server. That scheme supports all use cases.
I am trying to understand the difference between the two. I would like to clarify two things:

1) For option 2, does this mean that requests from a given client IP must hit the same TURN server every time? If that's the case then aside from the round-robin scheme, how is this different from the first option:

2) Or, for option 2, does the client send requests to the same TURN server only for the duration of the session/allocation? If that's the case, how is it that this will work if you're using RTP/RTCP connection pairs (from RFC 5766) and/or TCP relay (from RFC 6062) that require sessions from the same client to share information?


Please bear with me if these questions seem obvious or dumb. I am still very new to these things.

Thanks!

Oleg Moskalenko

unread,
Oct 2, 2015, 3:12:15 PM10/2/15
to Robin C, TURN Server (Open-Source project)
On Fri, Oct 2, 2015 at 12:07 PM, Robin C <robyd...@gmail.com> wrote:
> Hello,
>
> I am a bit confused about the load balancing. In the TURN performance and
> Load Balance wiki, the first two load balancing options are:
>
> Set a networking load-balancing equipment that redirects the requests to a
> member of the TURN servers group. In general case, it must take care about
> redirecting the requests to the same server from the same client IP -
> because some TURN sessions from the same client must share the information.
> There are two cases when different TURN sessions must interact: RTP/RTCP
> connection pairs (from RFC 5766) and TCP relay (from RFC 6062). If you are
> not using those features then a simple network load balancing is enough. If
> you do use those features, then you have to map the whole client IP (with
> all its network ports) o the same TURN server. Also, if you are using the
> mobile TURN (from the new MICE draft) then you cannot use the network load
> balancer option because client sessions from different IP addresses must
> interact - so you have to use the next option (see below).
> Set a less complex scheme with round-robin DNS. The client must send all its
> requests to the same DNS-discovered TURN server. That scheme supports all
> use cases.
>
> I am trying to understand the difference between the two. I would like to
> clarify two things:
>
> 1) For option 2, does this mean that requests from a given client IP must
> hit the same TURN server every time?

Yes, for the whole duration of session the TURN client packets must go
to the same server destination.

> If that's the case then aside from the
> round-robin scheme, how is this different from the first option:

This is different because the same goal is achieving thru different means.

>
> 2) Or, for option 2, does the client send requests to the same TURN server
> only for the duration of the session/allocation? If that's the case, how is
> it that this will work if you're using RTP/RTCP connection pairs (from RFC
> 5766) and/or TCP relay (from RFC 6062) that require sessions from the same
> client to share information?
>
>
> Please bear with me if these questions seem obvious or dumb. I am still very
> new to these things.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "TURN Server (Open-Source project)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> turn-server-project-rfc57...@googlegroups.com.
> To post to this group, send email to
> turn-server-project...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/turn-server-project-rfc5766-turn-server.
> For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Robin C

unread,
Oct 2, 2015, 3:26:54 PM10/2/15
to TURN Server (Open-Source project), robyd...@gmail.com
Hi Oleg, Thanks for the quick response! So, instead of round-robin, suppose I used a least-outstanding-request algorithm and made sure to route requests from a given client IP to the same discovered TURN server for the duration of a session. Would this scheme work for all use cases?

- robin
> To post to this group, send email to

Oleg Moskalenko

unread,
Oct 2, 2015, 4:20:05 PM10/2/15
to Robin C, TURN Server (Open-Source project)
Yes. As long as all packets from a given client are delivered to the
same server IP, it must work.

The term "the same client" is somewhat tricky. If you are using two
related clients (RTP + RTCP over different ports) then they have to be
considered as "the same client" although their ports are different -
in the case if you are using "even port" feature of the TURN server.



On Fri, Oct 2, 2015 at 12:25 PM, Robin C <robyd...@gmail.com> wrote:
> Hi Oleg, Thanks for the quick response! So, instead of round-robin, suppose
> I used a least-outstanding-request algorithm and made sure to route requests
> from a given client IP to the same discovered TURN server for the duration
> of a session. Would this scheme work for all use cases?
>
> - robin
>
> On Friday, October 2, 2015 at 12:12:15 PM UTC-7, Oleg Moskalenko wrote:
>>

Robin C

unread,
Oct 2, 2015, 4:45:37 PM10/2/15
to TURN Server (Open-Source project), robyd...@gmail.com
Wonderful! Thanks Oleg! I will look into this further.

- robin
>> > To post to this group, send email to
>> > Visit this group at
>> > http://groups.google.com/group/turn-server-project-rfc5766-turn-server.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TURN Server (Open-Source project)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
> To post to this group, send email to
Reply all
Reply to author
Forward
0 new messages