Mon Apr 28, 2003 12:34 pm by bRydeR
I think some of the confusion is due to DirectPlay games, such as FreeLancer, using the same port numbers for both inbound and outbound traffic and people not being clear on the distinction between client and server traffic.
When you start a DirectPlay server it assigns itself a UDP port number between 2302-2400, defaulting to 2302 if it is available. Therefore MOST servers run on 2302 but occasionally use a different port, either because there are multiple DirectPlay servers running on the same IP address (either the same machine or the same NATed network) or the port is being used by something else. There's also another very good reason for a sysadmin deliberately moving it from 2302 and assigning a "fixed" port number, which I'll come on to later.
The opening of ports to run the CLIENT (play the game) is needed if you're running a behind a firewall/router which blocks all traffic by default, unless configured otherwise. Most company firewalls filter traffic in this way. DirectPlay servers can *potentially* be anywhere in the 2300-2400 range (although they usually run on 2302) and 2300 is used for the global server. It's unlikely anything else is likely to use this range so it's best to open (ie "allow through) the entire range if you only want to play the game, although 2300 and 2302 will allow you to play on most FreeLancer servers. HOWEVER, for most gamers playing from home this isn't needed as most domestic NAT routers will dynamically open inbound ports if the "dialogue" was started by a client from within the LAN and create a dynamic route back to the client, allowing packets to flow between the client and server hosts. If you only ever play from a single machine behind your router you might find a marginal improvement in network latency by forwarding the ports to the "internal" IP address as this will mean the route becomes "static" and may negate some processing overhead incurred by the router software but, in practice, most network firmware is designed specifically for efficient packet handling and can do so much quicker than any network so any difference in performance is, at best, likely to be negligable.
If you're running a SERVER and wish to allow Internet players to connect you will almost certainly have to open *and* forward the DirectPlay ports to your server machine, otherwise anyone trying to connect will get blocked by your router. Even with the port open the router will probably drop the inbound packets as it won't know what to do with them. Port-forwarding "tells" the router that it needs to accept packets on a given port (or range) and forward them to another machine within your network (your server). Again, it's likely your server will be running on port 2302 if you run with defaults so forwarding this port alone will often work, but the 2300-2400 range will cover all eventualities. Therefore if you run the client and server on the SAME MACHINE you'll want to configure the router to open and forward all traffic to these ports to the IP address of your game machine.
The real fun starts if you want to run a the client and server on DIFFERENT machines behind a NAT router, such as running a dedicated server while playing from another machine(s) within your LAN. If you forward the DirectPlay ports to your server your clients won't be able to play online because inbound packets from Internet servers, instead of coming back to the client machine on which you're playing, will be "intercepted" and forwarded to your own server. If the router is configured to forward 2300-2400 players on the Internet will be able to join your server but you'll only ever be able to play on your own LAN server. Instead you'd want to forward *only* the port on which your server is running. This brings us back to why you'd want to use a port other than 2302 - if you allow your server to run on the default port of 2302 and configure the router to forward it to your server, you won't be able to connect to other servers running on 2302 - ie MOST DirectPlay servers! Instead you'd probably want to use the /P parameter (read the documentation on the CD-ROM!!) to force the server to run on a different port, preferably one which is not used by the Internet servers you wish to play on, and configure the router to forward this port to your server machine. In theory you could choose any "valid" UDP port number but most other gamesplayers behind routers are likely to have configured them to allow DirectPlay traffic between 2300-2400 so it's best to confine your server to a port within that range.
--
>bRydeR<