[ENet-discuss] Enet and NAT hole punching

Daniel Aquino mr.danielaquino at gmail.com
Wed Jan 7 00:11:34 PST 2009


You might be better off just sending udp packets on your own for the dummy
packets to open ports...


On Mon, Jan 5, 2009 at 10:24 AM, M. Rijks <enet at forge.dds.nl> wrote:

> Hi everyone,
>
> I'm happy to have found Enet as it provides the perfect mix of advantages
> between UDP and
> TCP. I'm currently in planning stages of developing a client-server
> multiplayer library
> on top of it. Now, in most smaller-scale multiplayer games one of the
> clients is usually
> also the server. The problem with hosting the game these days however are
> firewall/NAT
> routers - you need to fiddle with port forwarding to host a game.
> Connecting usually
> isn't a problem as outgoing connections usually get a port forwarded
> automatically.
>
> A popular technique to circumvent these is NAT hole punching. The server
> first connects
> to a publically available session server. This outgoing message makes a
> firewall/NAT
> router open up an external port for the game server. Other clients connect
> to the session
> server, which then passes the external IP and port of the game server, so
> that the
> clients can then connect directly to the game server. It is a nice
> technique that usually
> solves much of the hosting issues for people behind a NAT router, as they
> don't even need
> to know their public IP and port. There is little stress on the session
> server as it only
> acts as a helper.
>
> Let's assume that I will create my own public session server, preferably
> using Enet as
> well (I'd like to keep track of a number of session statistics that might
> be of interest
> to clients before joining). How would I go about setting this up?
> Naturally, it's no
> problem for a client to have two outgoing connections (one to the session
> server and one
> to the game server) but for the game server it's different - as far as I
> can see you're
> either connecting as a client or waiting for connections as a server, but I
> need to do
> both - if I set up two hosts it's going to use more than one port, making
> the connection
> fail.
>
>
> Any suggestions welcome, thanks in advance,
>
> - Martin
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20090107/c1f667ab/attachment.htm>


More information about the ENet-discuss mailing list