Example uses
- A backend webserver that is called by the world-visible webserver.
- A static NAT table for the public to use a port number to specify which server they are connecting to.
- A software that is developed by the company that will not be published, but used in-house.
I was just wondering if there was a standard section of port numbers that should be used. For example when it comes to DNS testing, or non-world-readable domains, there are items in RFC 2606 such as example.com
, *.test
, etc.
UDP and TCP ports are assigned by IANA. The ones below 1024 are considered "the well-known ports" and shouldn't be used for anything other than their stated purpose (without good reason). The rest are pretty well fair game: Just let your users know what port to connect to, and keep some documentation for your site.
There is a range that is "unregisterable" (49152–65535) - This is the pool applications are supposed to grab from when they need to open a connection, but it's also available for you to use for whatever purposes you 'd like.
Wikipedia has a page with a prettified version of the port listing. You can also find it in
/etc/services
on most Unix machines.As far as listening ports on services are concerned, there are the IANA-registered well-known ports, most of which lie below 1024.
Apart from those, you're free to use whatever ports suit you.
A comprehensive list is here: http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
In case you want to know, quick-and-dirty, what to use, go to 50000 and over.
Plenty of ports for everybody to go around, after all.