Forum

> > Off Topic > Curious about your listen server
Forums overviewOff Topic overviewLog in to reply

English Curious about your listen server

5 replies
To the start Previous 1 Next To the start

old Curious about your listen server

Ace Howl
User Off Offline

Quote
Hello.
@user DC, how do you make CS2D's listen server (the 'Create Server' one) work without forwarding a port? This is because I wonder how do your game is the only effective that allows outside player to join my server while the other games don't (it need to be port forwarded).

old Re: Curious about your listen server

ohaz
User Off Offline

Quote
You usually need to forward the port, even if you're using a listen server.
The thing cs2d does is called NAT Hole Punching (in this case UDP hole punching). NAT hole punching practically tries to exchange information on another path and then using this information to "trick" the NAT into thinking that this is a valid request.

old Re: Curious about your listen server

DC
Admin Off Offline

Quote
Correct, that's NAT hole punching. It works this way in CS2D:

• You try to connect/ping a server behind a NAT router but the router of the server discards your message or doesn't forward it correctly, because nobody configured a proper forwarding. ×

• Now a message with your IP and port is sent to the U.S.G.N. masterserver to deal with this problem. The masterserver accepts all messages because it's not behind a NAT router.

• The masterserver simply forwards this message to the server you are trying to join. The server will accept the message from the masterserver because it communicated with the masterserver before (version check and serverlist entry).

• The server you are trying to join now sends a packet to you after receiving your IP and port from the masterserver. This leads to a NAT (network address translation) table entry in the server's router which basically means: "I've sent a message to that address! I'm now waiting for an answer and I'll accept all messages from that address and route them to the local address which sent the first message".

• When you now send another connection/ping request message to the server (this happens automatically after a short delay), the router of the server will handle and forward it correctly because there is a NAT entry for this address combination (consisting of your IP:Port and the local server IP:Port) √

This simple technique does not work with all routers though. In some cases you still have to forward manually. Also you have to have a central server which simply accepts the NAT punching messages from ALL addresses and forwards them.
edited 1×, last 27.04.14 11:25:57 am

old Re: Curious about your listen server

Ace Howl
User Off Offline

Quote
I see. No wonder I can't use PF method, just using website as solver. By the way, is there any software/website that does that thing? I need it for server purposes.

old Re: Curious about your listen server

sixpack
User Off Offline

Quote
Another implementation that other games use is called UPnP and for better or worse is enabled by default in most routers.. This pretty much means that an application can request from the router to be port forwarded and the router does this automatically temporarily.. Of course it does not work all the times since it may be disabled in some cases..

old Re: Curious about your listen server

_Yank
User Off Offline

Quote
In more colorful words, imagine that the listen server is the father, unreal software master server is his son and the player is a master server friend.

The son asks to his father, the listen server, if he can go outside to play with his friend, the player.
Then his father lets they play O.o

By the way, what @user sixpack: said is correct too and also much simpler:
user sixpack has written
Another implementation that other games use is called UPnP and for better or worse is enabled by default in most routers.. This pretty much means that an application can request from the router to be port forwarded and the router does this automatically temporarily.. Of course it does not work all the times since it may be disabled in some cases..

Programs like hamachi, utorrent and skype do that.
edited 2×, last 27.04.14 03:36:52 pm
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview