ICE/STUN/TURN implementation?

7,532 views
Skip to first unread message

RCC

unread,
Mar 13, 2012, 5:23:13 PM3/13/12
to discuss-webrtc
Other than jingle what's a good open-source ICE/STUN/TURN
implementation (preferably C++ and conforming to later RFCs)
available?

Thx
RCC

Gustavo García

unread,
Mar 13, 2012, 5:33:10 PM3/13/12
to discuss...@googlegroups.com

Rich Jones

unread,
Mar 14, 2012, 1:23:42 PM3/14/12
to discuss-webrtc
I've played a little bit with this one, which I found on SF and am
mirroring on GitHub:

https://github.com/Miserlou/stund

RCC

unread,
Mar 14, 2012, 1:51:58 PM3/14/12
to discuss-webrtc
Thx. Yeah - pjnath has support for later RFCs and drafts.

On Mar 13, 2:33 pm, Gustavo García <gustav...@gmail.com> wrote:

RCC

unread,
Mar 14, 2012, 1:52:40 PM3/14/12
to discuss-webrtc
Thx. Only issue is it's till RFC3489.

Luc Tribolet

unread,
Mar 19, 2012, 10:33:21 AM3/19/12
to discuss...@googlegroups.com
Hi,

I am a bit confused about the use of STUN or TURN server. The RFC says that STUN is a tool for other protocols. And having the choice between STUN and TURN is not clear for me. 

If you let the choice between TURN or STUN I guess that this both projects are in some ways equals because they will do approximately the same job. And in some articles I've been reading they deploy on one server the two protocols. Meaning they have a server which runs and supports STUN and TURN protocols. So they don't do the same job ?

So how come you can choose between a TURN server or a STUN server ? If you have some articles that could help me to understand  a little bit more I really appreciate that !

Harald Alvestrand

unread,
Mar 19, 2012, 11:17:38 AM3/19/12
to discuss...@googlegroups.com
The TURN protocol builds on top of the STUN protocol in order to build
a relay service.
STUN by itself only gives you a view of your external addresses seen
from the TURN server + some help with getting by NAT boxes.

Any compliant TURN server will also function as a STUN server, so
there's no need to have both a TURN and a STUN server.

Luc Tribolet

unread,
Mar 19, 2012, 11:50:52 AM3/19/12
to discuss...@googlegroups.com
Thank you for your reply.

Still I don't understand how do I choose STUN or TURN protocol. What are the limitations of STUN implementation ? I read some documentation but I don't feel comfortable with networking concepts. I understand that STUN helps you to discover your public data but by itself can't provide you a NAT traversal solution. So STUN is used by other protocol. That's why I don't understand why it can works here by itself.

For example, on the demo http://apprtc.appspot.com why did you choose a STUN server rather than a TURN server ?

Regards,

Luc

Caragea Silviu

unread,
Mar 19, 2012, 12:42:07 PM3/19/12
to discuss...@googlegroups.com
libjingle turn implementation is not compatible with rfc5766, so the
library cannot be used with any other open source relay server (or
maybe I'm wrong) . Personally I think is working only with the relay
server from his sources. The main problem is that, that server from
libjingle it's very unstable (crashes often and also it's freezing
time to time).

Robert Wolff (GoCast)

unread,
Mar 19, 2012, 12:50:04 PM3/19/12
to discuss...@googlegroups.com
Luc,

For many people's purposes, the differences aren't likely to matter. But I think the explanation or "missing piece" you're looking for is the following...

STUN/TURN/ICE are acronyms which are largely used interchangeably in part due to history and in part because their differences are subtle from the "users" point of view.

STUN is used to effectively punch a hole in a firewall so that two peers can talk to each other without requiring the use of an intermediate server once the connection is made. It's pretty cool how this occurs and kinda sneaky at the same time. But the end result is that these two peers can have a socket(s) with which to converse.

TURN was developed in large part due to the fact that STUN cannot always punch those holes. There are special kinds of firewalls/NATs which when "paired" together make it impossible for STUN to do its sneaky job. So, TURN instead allows each of the peers to talk to the TURN server and the TURN server will forward all the communications between the peers so that they are effectively talking directly to each other.

Here's the CATCH -- if you have high volume traffic like HD video...this means the TURN server is having to marshal each and every byte of your traffic. This is costly to the TURN server in terms of resource and it is also yet another set of hops in the connection between peers. So, if your data-path is small, then you really don't care STUN or TURN. If you are sending video, then your high preference is to avoid TURN for these reasons. However, note that when you have no way to make a connection other than TURN...TURN looks pretty attractive. :-)  So...this is largely negotiated in the background such that application developers don't need to care.

In the case of WebRTC, I believe it to be true that TURN is not quite supported yet...someone can correct me on this please if I'm not right here. And so the examples currently show STUN connections.

Have a great day!

Bob Wolff

Punyabrata Ray

unread,
Mar 19, 2012, 12:55:41 PM3/19/12
to discuss...@googlegroups.com
Correct, TURN is not supported yet.
Luc - here are some graphics to what Bob explained so well.

-pr

Luc Tribolet

unread,
Mar 19, 2012, 1:57:17 PM3/19/12
to discuss...@googlegroups.com
Thank you a lot both of you it's very helpful !

Best regards,

Luc

Serge Lachapelle

unread,
Mar 20, 2012, 3:03:20 AM3/20/12
to discuss...@googlegroups.com
On Mon, Mar 19, 2012 at 17:42, Caragea Silviu <silvi...@gmail.com> wrote:
libjingle turn implementation is not compatible with rfc5766, so the
library cannot be used with any other open source relay server (or
maybe I'm wrong) .

Correct, this is something we are working to fix.
 
/Serge

Caragea Silviu

unread,
Mar 21, 2012, 5:30:11 PM3/21/12
to discuss...@googlegroups.com
There is any deadline estimation for this? From what I saw on
libjingle project there is a big leak of interest for the bugs
reported about the relay server, and also
in the source code there was no update on this are for a lot of time.

I'm working with libjingle day by day for about 1 year and is a great
project. The only big problem is the missing of a stable relay
server.

Luc Tribolet

unread,
Mar 22, 2012, 10:12:55 AM3/22/12
to discuss...@googlegroups.com
Hi,

I'm trying to find a STUN/TURN server but it seems PJNATH which was quoted before is a little bit complex and big to deploy for one feature (STUN). Plus the documentation isn't very clear for me...

Does anybody know a different STUN server with documentation because all project I find are too old or without any documentation ?

Thanks in advance

Regards,

Luc

Le lundi 19 mars 2012 17:50:04 UTC+1, Robert Wolff (GoCast) a écrit :

Serge Lachapelle

unread,
Mar 22, 2012, 10:25:18 AM3/22/12
to discuss...@googlegroups.com
Hard to put a deadline in a fast moving projects, but we are talking weeks, not months.

/S

Google Sweden AB | Kungsbron 2, SE-111 22 Stockholm | Org. nr. 556656-6880 

Apparently, this footer is required in Europe. Apologies. This email may be confidential or privileged.  If you received this communication by mistake, please don't forward it to anyone else,please erase all copies and attachments, and please let me know that it went to the wrong person.  Thanks.

Caragea Silviu

unread,
Mar 22, 2012, 10:27:28 AM3/22/12
to discuss...@googlegroups.com
Only for STUN you can use the one from libjingle sources it's very
straightforward to compile and run.

Umesh Chandak

unread,
Mar 22, 2012, 10:35:38 AM3/22/12
to discuss...@googlegroups.com
Hi ,
I am using the relayserver which comes with libjingle. This is pretty good and easy to deploy.
It's working like a charm for me. Even I use it for TCP not only for UDP.
I know it has some issues like craches etc. But best way to deal with it is fix it.

I have fixed 3 issues. 
1. There is a issue of data indications padding which relay server should not do ideally.
2. There is a crash while finding the entry not present in map. 
3. Using relay server for TCP/SSLTCP.

All of above are simple and none more than 2-3 lines of code but require some time to debug.
 
I will mail the patch of these 3 issues if someone is interested. 

Thanks.
Regards,
Umesh.

Caragea Silviu

unread,
Mar 22, 2012, 10:59:15 AM3/22/12
to discuss...@googlegroups.com
If you are doing this I will give you a beer ! I promises ! I have the
same Issues as you have listed, but is very hard to debug because I
cannot reproduce all the time.

Justin Uberti

unread,
Mar 22, 2012, 1:22:40 PM3/22/12
to discuss...@googlegroups.com
Please file an issue in the libjingle bug tracker and attach your patch.

Umesh Chandak

unread,
Mar 23, 2012, 3:09:46 AM3/23/12
to discuss...@googlegroups.com
Hi ,
I do not drink but dinner will work :).
Just kidding.

I have filed the issue and attached my patches on the issue.

Issue link is :

Please let me know if these are helpful to you.

Thanks.
Regards,
Umesh.

Caragea Silviu

unread,
Mar 23, 2012, 3:37:26 AM3/23/12
to discuss...@googlegroups.com
Hi Umesh,

I will integrate the patches and I will test them . Can you also
provide what version of libjingle have you used?

Kind regards,
Silviu

mick

unread,
Mar 23, 2013, 2:25:39 AM3/23/13
to discuss...@googlegroups.com
Umesh,
 
could you provide me this patch? Thanks!

Oleg Moskalenko

unread,
Mar 24, 2013, 4:38:55 AM3/24/13
to discuss...@googlegroups.com
We have BSD-licensed open source TURN/STUN server (in C language) with all the latest RFCs here:

http://code.google.com/p/rfc5766-turn-server/

It is well documented and supports PostgreSQL as users repository.

Oleg

Md. Naseef-Ur-Rahman Chowdhury

unread,
Jun 20, 2013, 5:21:19 AM6/20/13
to discuss...@googlegroups.com
Hi, I want to know can I use any of open source ICE/STUN/TURN implementation? I mean can I use my own ICE library? If it is possible, I know how I can do this. Please help me on this, I am badly stucked.

Yanjun

unread,
Aug 15, 2013, 1:32:28 PM8/15/13
to discuss...@googlegroups.com
It seems that there are multiple layers to get the actual relay server information. Pcp first issues jingleinfo query to get "relay server" address. Then it talk to port 443 of this "relay server" to get the real relay server address. After that it will start port allocation with the real relay server. Those extra steps are google extensions and probably need to be disabled to use your own relay server. 

On Thursday, January 10, 2013 9:37:57 PM UTC-8, Hou Seaman wrote:
hello,relayserver not work for me,it listen on internal:5000 external:5001
but pcp connect relayserver:443.
why?
Reply all
Reply to author
Forward
0 new messages