Jump to content
  • Advertisement
Sign in to follow this  
dpadam450

Commerical Games no port forward required?

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm just wondering how commercial games make it so that you dont have to go to your router and manually port forward on that connection. Do they temporarily set it up in code and disable it when exiting? If so, any tutorials?

Share this post


Link to post
Share on other sites
Advertisement
If your router supports NAT then you don't have to manually port forward anything (unless you are the server). Your router is performing the magic here, not the games.

However, if you have two people connecting to each other who are both behind routers, then you will either need to port forward, or use NAT punch through.

Share this post


Link to post
Share on other sites
I'm sure someone will reply with a better answer, but I'd guess at one of two ways to do it.

1) Just use TCP and have a central server. Like WoW does - and as it is wont to do with TCP, the NAT figures it all out for you.

2) Simultaneous connect punchthrough (or something) for when you want players to connect together directly. I've only heard this referred to, but with a name like that I'd guess it uses an introducer service and goes something like:

A = player 1
B = player 2
S = central server

* A asks S for a connection to B
* S tells B to connect to A's external address (B's connection fails, but this
adds a NAT entry to B's routing table pointing to A)
* S tells A to connect to B's external address
* A is now connected to B.

Of course, I just made that up, but I bet it works something like that in principle. ;) Oh, and this is my first GD.net post for like three years... welcome back, me! ^^

Share this post


Link to post
Share on other sites
Quote:
Original post by dpadam450
I'm just wondering how commercial games make it so that you dont have to go to your router and manually port forward on that connection. Do they temporarily set it up in code and disable it when exiting?

If so, any tutorials?


For games with central game server, you don't need to forward anything. NAT does that for outgoing connecitons.

For peer-to-peer, there's nat punchthrough.

Quote:
1) Just use TCP and have a central server. Like WoW does - and as it is wont to do with TCP, the NAT figures it all out for you.


WoW uses UDP, but to a central server.

Share this post


Link to post
Share on other sites
WoW uses TCP port 3724 See here for confirmation.

Quote:
If your router supports NAT then you don't have to manually port forward anything.
Erm, no. NAT = Network Address Translation, and is the reason you need port forwarding in the first place. It means your router has an IP address, and all the computers behind that router share the address. So from outside of the network, how do you send a packet to a specific machine? With port forwarding. You can configure the router to send all receieved packets on port X to machine Y.

However, you're still somewhat right. There are many protocols these days that work with newer routers to traverse the NAT automatically. However, none is guaranteed to work for all routers. The wikipedia has a good page on this.

Share this post


Link to post
Share on other sites
The Forum FAQ has information on the topic of NAT/firewalls/punch-through.

Btw: Last I checked, it looked like WoW uses UDP for its distributed patch management, but TCP for gameplay. That was a while back, though.

Share this post


Link to post
Share on other sites
WoW uses TCP port 3724 See here for confirmation. [EDIT] Switched link to Blizzard's site.

Quote:
If your router supports NAT then you don't have to manually port forward anything.
Erm, no. NAT = Network Address Translation, and is the reason you need port forwarding in the first place. It means your router has an IP address, and all the computers behind that router share the address. So from outside of the network, how do you send a packet to a specific machine? With port forwarding. You can configure the router to send all receieved packets on port X to machine Y.

However, you're still somewhat right. There are many protocols these days that work with newer routers to traverse the NAT automatically. However, none is guaranteed to work for all routers. The wikipedia has a good page on this.

Share this post


Link to post
Share on other sites
Quote:
Original post by myrdos
WoW uses TCP port 3724 See here for confirmation.


My bad, had something mixed up.

Quote:

Quote:
If your router supports NAT then you don't have to manually port forward anything.
Erm, no. NAT = Network Address Translation, and is the reason you need port forwarding in the first place. It means your router has an IP address, and all the computers behind that router share the address. So from outside of the network, how do you send a packet to a specific machine? With port forwarding. You can configure the router to send all receieved packets on port X to machine Y.

[/quote]

Yea, quoting half of the sentence will of course let out the important bit about "outgoing connections".

Share this post


Link to post
Share on other sites
OK, here's the whole sentence and the next one as well.
Quote:
If your router supports NAT then you don't have to manually port forward anything (unless you are the server). Your router is performing the magic here, not the games.
It still makes no sense to me, NAT is causing the problems here, not solving them. All routers have NAT, it's what makes them routers and not bridges or switches. I agree that there are ways to traverse NAT automatically. But just because there's NAT in your router doesn't mean you have no worries.

Please forgive my double-post, I got some database error when I edited, re-tried, got an error about no password, re-typed password and re-tried, and somehow double-posted.

Share this post


Link to post
Share on other sites
A lot of games don't require port forwarding because you don't need a port open to accept connections. So when the game isn't acting as a server there is no need, but if your hosting/creating a game you will need that port opened so that you can receive those incoming connections, there typically aren't any restrictions on outgoing connectings.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!