30 Jul, 2009, Lobotomy wrote in the 1st comment:
Votes: 0
I'm trying to determine what the "safe" or otherwise acceptable range of ports would be for when someone is using my program to set up a new server (I've never had cause to look this up before, as I've normally used mud hosts which have an allowable port range set up ahead of time). At the moment, I'm looking at this page regarding TCP/UDP port numbers, and I'm supposing by what it says that the range I would be looking at is either 1024/1025 to 65535, or 49152 to 65535.

I suppose I can just make it so that the user can merely specify any port they want to regardless (assuming the protocol will allow it), but I figured it would be good to at least include a guideline of some sort.

Would someone please clarify this for me?
30 Jul, 2009, Kline wrote in the 2nd comment:
Votes: 0
http://www.iana.org/assignments/port-num...

Quote
The Well Known Ports are those from 0 through 1023.

DCCP Well Known ports SHOULD NOT be used without IANA registration.
The registration procedure is defined in [RFC4340], Section 19.9.

The Registered Ports are those from 1024 through 49151

DCCP Registered ports SHOULD NOT be used without IANA registration.
The registration procedure is defined in [RFC4340], Section 19.9.

The Dynamic and/or Private Ports are those from 49152 through 65535


So if you truly want to be a stickler, 49152 - 65535 are your choices. In practice, though, most people (and OS'es) will run anything > 1023.
30 Jul, 2009, Lobotomy wrote in the 3rd comment:
Votes: 0
I see. Thanks.
30 Jul, 2009, Erok wrote in the 4th comment:
Votes: 0
Also, I think most flavors of UNIX only allow programs running with superuser privileges (i.e., root) to access ports below 1024.

I agree with Kline, I don't think I've ever seen restrictions on ports between 1024 and 49152. Start up a few networking apps and run "netstat". You'll likely see connections over that range.
30 Jul, 2009, quixadhal wrote in the 5th comment:
Votes: 0
From a practical standpoint, you may wish to research popular uses for ports and avoid this.

I'm assuming you only care about TCP ports, so here's a few examples…

VPN typically uses 1723 tcp
Ventrilo uses 3784 tcp by default
battle.net uses 4000 and 6112..6119
emule uses 4661 up to about 4711.
VNC likes 5800 I think.
World of Warcraft uses 8086, 8087, 9081, 9090, 9091, and 9100.
Many web servers or proxies run on 8080 or 8088.

Of course, nothing prevents you from using any of those ports… it's just that some organizations (universities, workplaces, etc) may restrict access to them assuming they're being used for their more common use.

I always figured you should keep it simple… 1111, 3000, etc.

If you choose port 23, it's the default telnet port… but the mud will have to run with root privs to bind there… and not be already running a telnet server (which it shouldn't be!).
30 Jul, 2009, Banner wrote in the 6th comment:
Votes: 0
I generally assign/use anything between 1024-9000.
30 Jul, 2009, Lobotomy wrote in the 7th comment:
Votes: 0
Ah. Well, I'm thinking that I'll probably end up setting a default range of values at the top end of the range (49152 - 65535; perhaps rounded to 50000-65000 to have even numbers) and then include a sort of security override option for the user to select which will display a warning message but allow them to then set a lower value (or any value?) if they choose to do so. So long as the person knows what they're doing, it doesn't really matter to me what port they use, I suppose.
30 Jul, 2009, David Haley wrote in the 8th comment:
Votes: 0
I really don't think you need to go into 5-digit port numbers here… nobody else (AFAIK at least) does it.

EDIT: and if some user of your code has an issue with a 4-digit port number, they can always change it with your override…
30 Jul, 2009, Lobotomy wrote in the 9th comment:
Votes: 0
Well, I suppose I can just ditch the override idea then and throw in a label or tooltip by the port entry with the aforementioned warning about the various port ranges, and just let them enter the port number they want. That, or a popup entry box with the label near that and whatnot. Whatever works.
12 Aug, 2009, exeter wrote in the 10th comment:
Votes: 0
I'd just allow the user to specify any port. If there's an error binding to the port number, just crash. If the port number is below 1024, maybe raise a warning or log a message to a log file. Most of the time, you're best off assuming that anyone setting up a MUD server to run on a particular port knows what he or she is doing.
0.0/10