RE: [GD-General] Basic questions regarding networking games...
Brought to you by:
vexxed72
From: Brian H. <bri...@py...> - 2002-09-23 23:32:31
|
> [A] For *Internet* games I assume service WWW sites like > GameSpot, etc, advertise the IP's and ports of game servers > -- or you can indicate the IP and port number of your server > through any other means (phone call, e-mail, chat, etc). > > QA1: Is this the dominant way to discover *Internet* games? I think so, but I'm not sure. That would seem to make the most sense though. Alternatively, if you have a dedicated lobby service then there would be som existing protocol to negotiate that information. > of broadcasting to all 64000 ports in a brute-force search. Why not just pick an unused port and go with it? Then also allow the ability to override at the command line, e.g. the server can specify the port. > QB2: Might a server on a LAN advertise itself > periodically, like once per second? Sure, no reason not to, but then your clients will have to be listening on a port as well as broadcasting. > QC1: Sorry for my ignorance, but do you think it's okay > to have all clients send UDP to the same server port > for processing? (So each UDP packet has a "Client ID" > to demultiplex the packets.) Yes. You can demultiplex on source IP if you're an internet server, but having a separate client ID that is some function of the low 16-bits of their (local) IP address helps to disambiguate between two clients if the source port gets remapped from underneath you. I know Quake had to do this because some older routers would just reassign the ports somewhat randomly (I'm not sure if UDP specifies a lifetime for a source port mapping). > QC2: Even if all UDP traffic can go to a single server > port, do you think there might be some benefit to having > a seperate port that is strictly for joining the game? Not that I can think of. > (The "real" game might be some RANDOM port, but the > service for joining the game might be on the "well-known > port range".) Okay...so why the random port instead of just choosing one? > QC3: To your knowledge, do many first-person shooter > deathmatch games just feature a single UDP port for all > game-related traffic? Don't know, but I think it's easy enough to find out -- in fact, many NAT box/routers include specific instructions for each game. I personally think everything should be done with as few ports as possible because this simplifies things for those people that rely on port forward (forwarding one port is often easier than forwarding a range). For my stuff, I have two server ports, a game port and a control port. The control port is strictly used for server management, stat queries, etc. by remote admins. The game port is for all game play. I have a hardcoded port # that can be altered if necessary, which seems to be the norm. Brian |