[NTLUG:Discuss] Allocating Port addresses.
MadHat
madhat at unspecific.com
Sun Mar 21 15:44:04 CST 2004
On Mar 21, 2004, at 3:18 PM, Steve Baker wrote:
> I'm not much of a network expert - but the game I'm writing
> right now has to work in a client/server mode. I have a handy
> library that hides most of the nastiness - so I'm not concerned
> about that.
>
> One thing I'm puzzled about though. My TCP and UDP messages
> have to be addressed by hostname and port number as you'd expect.
>
> My question is - how the heck do I pick a valid port number?
>
> Clearly I'll want to avoid the ones in /etc/services but beyond
> that there seems to be no guidance.
>
> Are there acceptable ranges for games? Any that I should avoid
> because they're likely to be filtered by the intervening network?
$ head /etc/services
#
# Network services, Internet style
#
# Note that it is presently the policy of IANA to assign a single
well-known
# port number for both TCP and UDP; hence, most entries here have two
entries
# even if the protocol doesn't support UDP operations.
#
# The latest IANA port assignments can be gotten from
#
# http://www.iana.org/assignments/port-numbers
I would start there. Basically, all you can really do is pick one not
in use. But you will almost always find some app that already uses the
port you want to use.
More information about the Discuss
mailing list