Configuring TURN server to give srflx candidates ??

1,575 views
Skip to first unread message

balaji sunku

unread,
Apr 14, 2014, 12:45:17 PM4/14/14
to turn-server-project...@googlegroups.com
Hello,

I am getting a doubt whether TURN server can give "srflx" addresses and ports instead of "relay"

But i am aware that "relay" indicates TURN address, but somehow i am a little curious whether i can configure the TURN server to get srflx address

I am thinking it because i want to send the packets to Symetric NAT, and i have one working solution (Without TURN server setup)  in which i am fallowing srflx addresses and ports.

But surprisingly in my working solution i am getting "srflx" candidates only on call initiating side. So i am thinking it is automatically resolving the Symmetric NAT and sending me the correct ip addresses and ports where i can listen.

This is the reason why i am trying to configure TURN server to give "srflx" candidates

I might be completely wrong also in thinking to get "srflx" candidates from TURN server, but just curious to get a confirmation on this

Please clarify me on this.

Regards,
Balaji.

Oleg Moskalenko

unread,
Apr 14, 2014, 1:00:01 PM4/14/14
to balaji sunku, turn-server-project...@googlegroups.com
The TURN server returns the reflexive address in the ALLOCATE response, together with the relay address (as a different response attribute).

Also, you can learn your reflexive address by sending the STUN BINDING request to the TURN server.

Oleg



--
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.

Oleg Moskalenko

unread,
Apr 14, 2014, 1:01:59 PM4/14/14
to balaji sunku, turn-server-project...@googlegroups.com
In the ALLOCATE response, the relay address is returned as XOR-RELAYED-ADDRESS and the reflexive address is returned as XOR-MAPPED-ADDRESS. Check the wireshark output.


balaji sunku

unread,
Apr 15, 2014, 1:59:46 AM4/15/14
to Oleg Moskalenko, turn-server-project...@googlegroups.com
Please eloborate.. 

what do you exactly meant by XOR-RELAYED-ADDRESS and XOR-MAPPED-ADDRESS ??

That means i have to do an XOR operation on the relayed address to get the actual address ??

I am understanding what you are trying to explain, i think i am somewhere around the correct solution but couldn't find it

Oleg Moskalenko

unread,
Apr 15, 2014, 2:10:08 AM4/15/14
to balaji sunku, turn-server-project...@googlegroups.com
The server reply to the ALLOCATE request contains the XOR-attributes. Run the wireshark and you will see them (decode as STUN).

The formatting is somewhat complex, that's not just about XOR operation. Read how the attributes are encoded in STUN RFC 5389.

If you are handling the message protocol "manually" (not using a third party library) then you do have to deal with that formatting. In the supplied client library, there is a procedure to read such address attributes from the buffer. See the functions stun_addr_decode(..) and stun_addr_encode(...). The same functions you can find in the source code.

But if you are using a third-party library for the TURN operations, then it must handle everything for you, then you do not have to decode the addresses yourself.

Oleg


balaji sunku

unread,
Apr 15, 2014, 2:15:57 AM4/15/14
to Oleg Moskalenko, turn-server-project...@googlegroups.com
Ok. I am actually using Google TURN server and WebRTC framework, and i am manually handling the ICE candidates i am getting from my TURN server, I think as per ur explaination i have to deal with the decoding of those addresses. 

i will work on it. 

But better if i can get any library which will do that decoding for me, i will search my best for that. 
Reply all
Reply to author
Forward
0 new messages