[libnice] Using TURN to enable UDP P2P Communication

Scott Richmond s.t.richmond at gmail.com
Thu Aug 14 21:05:58 PDT 2014


My scenario is as follows: We are creating a multiplayer video game in the
Unity3D engine (C# language). I have successfully setup UPnP Port Mapped
NAT Traversal, which works for most users (60-75%).
I would like to see if we can achieve 100% successful NAT Traversal for our
P2P multiplayer component with the additional use of STUN/TURN.

I believe I have a pretty good handle on how UDP-based STUN/TURN works
however I feel a little vague on the exact implementation details as well
as some finer details.

1. If I used UDP STUN to bash open some ports between two peers, what will
typically keep the NAT port map in place on the users routers? Do they
typically wait for a FIN or RST to flow over the open port before closing
2. Would this work: I use libnice to open UDP ports between two peers with
the use of a rendezvous server. I then kill the libnice process/instance
and for the peer that is running the multiplayer server I tell it to listen
on that port for incoming connections. Presumably the remote peer should be
able to connect through to the listening game server instance with the
previously opened ports from libnice. Would this be correct?
3. Anyone know of any active C# wrappers for libnice? We can do it
ourselves, but just curious.

Scott Richmond.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20140815/d0c73505/attachment.html>

More information about the nice mailing list