Networking / Beginners

The Power of Port Numbers

If you want to understand the power of TCP/IP, you have to get seriously into port numbers. If you want to pass the CompTIA Network, you need to know how TCP/IP uses port numbers and you have to memorize a substantial number of common port numbers. The port numbers make Network Address Translation (NAT) work. A number of places where knowledge of port numbers is critical to protect your network, to make routers work better, and to address a zillion other issues. There is no such thing as a network administrator who isn't deeply into the magic of port numbers and who cannot manipulate them for his or her network's needs.

You know that every TCP/IP application requires a server and a client. There are very clearly defined port numbers for every popular or well-known TCP/IP application. A port number is a 16-bit value between 0 and 65,535. Web servers, for example, use port number 80. Port numbers from 0 to 1023 are called well-known port numbers and are reserved for specific TCP/IP applications.

Tip TCP/IP port numbers between 0 and 1023 are the well-known port numbers. You'll find them at every party.

When a Web client (let's say your computer running Firefox) sends an HTTP ACK to a Web server to request the Web page.

As you can see, the destination port number is 80. The computer running the Web server reads the destination port number, telling it to send the incoming packet to the Web server program.

The Web client's source port number is generated pseudo-randomly by the Web client computer. This value varies by operating system, but generally falls between the values 1024-5000-the port numbers classically assigned as ephemeral port numbers- and 49152-65535-the dynamic or private port numbers. In the early days of the Internet, only ports 1024-5000 were used, but modern computers can use up all of those.

More port numbers were added later. The Internet Assigned Numbers Authority (IANA) today recommends using only ports 49152-65,535 as ephemeral port numbers.

When the serving system responds to the Web client, it uses the ephemeral port number as the destination port to get the information back to the Web client running on the client computer.

[Previous] [Contents] [Next]