Servers Listen for Incoming Connections
Most server-based IP applications use what are referred to as “well-known” port numbers. For example, an HTTP server will listen on TCP port 80 by default, which is the well-known port number for an HTTP server. This way, any HTTP client that connects to HTTP servers can use the default of TCP port 80. Otherwise, the client would have to specify the port number of the server that it wanted to connect with (you’ve seen this in some URLs that use http://www.somehost.com:8080/ or the like, where "8080 is the port number of the HTTP server on www.somehost.com).
Most application servers allow you to use any port number you want. However, if you were to run your web server on TCP port 8080 for example, then you would have to tell every Internet user that your web server was not accessible on TCP port 80. This would be an impossible task. By sticking with the default, all users can connect to your web server using the default of TCP port 80.
Tip
Some network administrators purposefully run application servers on non-standard ports, hoping to add an extra layer of security to their network. However, it is the author’s opinion that security through obscurity is no security at all, and this method should not be relied upon by itself.
There are a number of predefined port numbers that are registered with the Internet Assigned Numbers Authority (IANA). All of the port numbers below 1024 are reserved for use with well-known applications, although there are ...