Sign in to follow this  

Commerical Games no port forward required?

This topic is 3869 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
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
Quote:
Original post by myrdos
Quote:
Original post by Hodgman
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.


Yeah, my comment was a bit muddled there. NAT is what makes you need to forward ports, but as I said, if you're the client then you don't have to forward the ports manually (when you connect to the external server, NAT will take care of it and you will have no worries).

BTW you can delete double-posts with the edit button ;)

Share this post


Link to post
Share on other sites
Quote:
All routers have NAT, it's what makes them routers and not bridges or switches.


That's not true at all. Routers work on layer 3 or above. The definition of what makes something a router is somewhat loose, but most definitions typically include one of "being the default gateway for at least one subnet," or "bridging at least two separate subnets" (which boil down to the same thing, more or less). You can do this without any NAT, and in fact, in many cases NAT is not involved at all.

A switch is something that connects different entities at the Ethernet layer, where it forwards packets based on the Ethernet (MAC) address. A bridge is something that creates one larger logical subnet out of two smaller physical subnets (and thus isn't typically the gateway for that subnet). And a "hub" (if you remember those) is like a switch that is always in broadcast mode (i e, forwards all packets to all connections).

NAT is a higher-level functionality, where one of the subnets happens to be in the private space, and IP packets happen to need re-writing. NAT is more a characteristic function of a firewall than of a router, because it will act as a first-layer firewall where connections from the outside can't get in unless they have help from the inside.

Share this post


Link to post
Share on other sites
These manufacturers are relying on the fact that most firewalls are set up to allow any outbound traffic. Most firewalls are also stateful, which means that if you send an outbound packet on port x, it will allow incoming traffic on that port for a specified amount of time.

As for NAT... See posts above.

Share this post


Link to post
Share on other sites

This topic is 3869 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this