Creating a Server WITHOUT port fowarding
How do I make it so that a person can download the server.jar file, run it, and have people connect to it (socket 11114) without having to configure their router to foward that port. I know its possible because in professional games, people can connect to each other and the user doesnt have to use port fowarding.
Thanks
[334 byte] By [
Nethera] at [2007-11-27 2:11:00]

# 1
One of the following:
1) The server has a public IP address
2) There is port forwarding.
3) The server is not connected to directly. Rather, the server connects to a real server that does have a public IP address, and that server acts as a broker between the game server and client.
# 2
Normally a client doesn't need to forward ports to connect to a server at all. A router usually prevents an arbitrary connection to a computer it's routing, since it may be routing many computers and the intended one may be impossible to identify unless pre-configured with the router. Connecting from the routed computer does not have this problem, so long as the server has its ports ready, except for the rare case where the router doubles as an anti-trojan firewall, in which case it needs to be configured accordingly, but that's really the client's problem(and fault, for enabling such a feature on the router in the first place, or actually picking out the extra-rare router that has such a feature on by default).
This simply requires that the client connects to the server, and never vice versa. This is okay for a connection-based protocol, like TCP.
For a datagram protocol like UDP, most modern routers tend to "remember" where routed computers sent a packet to, and use it to figure out where packets sent back should go, so as long as the client sends the first packet, and so long as the server sends replies within a certain timelimit(usually 60 seconds), it should work without any special port forwarding.
The few users using a router without that support would either have to configure their router, or use TCP only.
# 3
> Normally a client doesn't need to forward ports to
> connect to a server at all.
One might suppose though that when someone downloads something called a "server.jar" (in the OPs post) that the 'client' (the one that downloaded it) is going to end up acting as a 'server'.
And thus I suspect reply #1 would cover the available possibilities.
# 4
> One of the following:
>
> 1) The server has a public IP address
How do I run the server on a public IP address?
> 2) There is port forwarding.
Many users aren't experienced enough to do this.
> 3) The server is not connected to directly. Rather,
> the server connects to a real server that does have a
> public IP address, and that server acts as a broker
> between the game server and client.
Wouldn't this essentially double the time it takes for data to be sent? But I guess I would do this if option #1 doesn't work out.
# 5
> > One of the following:
> >
> > 1) The server has a public IP address
>
> How do I run the server on a public IP address?
You either have or do not have a public IP address. This depends on your ISP policies and your service contract with them.
If you don't have one then you can't set anything up to use it.
> Wouldn't this essentially double the time it takes
> for data to be sent? But I guess I would do this if
> option #1 doesn't work out.
The three possibilities are how it can be done. It has nothing to do with whether that it the best choice nor how individual companies do it.
# 6
> You either have or do not have a public IP address.
> This depends on your ISP policies and your service
> contract with them.
If this is the case, then wouldn't the professional games be very unreliable because some of the time the ISP wouldn't provide a public IP address?
# 7
> > You either have or do not have a public IP address.
> > This depends on your ISP policies and your service
> > contract with them.
>
> If this is the case, then wouldn't the professional
> games be very unreliable because some of the time the
> ISP wouldn't provide a public IP address?
Prehaps you missed the following statement? Or didn't understand part of it?
The three possibilities are how it can be done. It has nothing to do with whether that it the best choice nor how individual companies do it.
# 8
> Prehaps you missed the following statement? Or
> didn't understand part of it?
>
>
> The three possibilities are how it can be done. It
> has nothing to do with whether that it the best
> choice nor how individual companies do it.
>
Yes i see that, but perhaps I want to know how people think the companies do it.
# 9
> > Prehaps you missed the following statement? Or
> > didn't understand part of it?
> >
> >
> > The three possibilities are how it can be done. It
> > has nothing to do with whether that it the best
> > choice nor how individual companies do it.
> >
>
> Yes i see that, but perhaps I want to know how people
> think the companies do it.
Given that the above list is the ONLY possible way to do it, then it would suggest that companies do it using one of those methods.
Now if you want to determine what most companies do then I suspect you are not going to find that information because:
1. It would require a lot of work (and cost) to find and then survey companies.
2. Companies might consider such information proprietary or not worth their time to divulge.
Myself given that all three are possible I would suspect that all three are in use.
# 10
How many game server have you actually tried to host?
Taking first person shooters for example, from when they first gained internet support until this very day, setting up a server from behind an unforwarded router or firewall was and still is impossible.
This is of no consequence to most players, as the average end-user doesn't have the bandwidth required to act as a server anyway. ADSL just doesn't cut it. More commonly, dedicated servers are set up on high-bandwidth preofessionally configured hosts. Matchmaking services bring users to these servers, saving them the trouble of setting up their own.
Certain other types of games have central servers to begin with. The few that don't, such as Diablo, are simply forced to let the possibility of setting up a server be limited to those which have a properly opened or forwarded connection.
Your software would inevitably suffer the same problems. If server-starting for everyone is a must, you'll need relay servers, there's simply no other choise.
# 11
> This is of no consequence to most players, as the
> average end-user doesn't have the bandwidth required
> to act as a server anyway. ADSL just doesn't cut it.
> More commonly, dedicated servers are set up on
> high-bandwidth preofessionally configured hosts.
Interestingly enough to me, there is at least one hosting company that specifically targets gamers with ads to allow them to host game servers.