How Port Numbers WorkPort numbers are associated with network addresses. For example, in TCP/IP networking, both TCP and UDP utilize their own set of ports that work together with IP addresses.
Port numbers work like telephone extensions. Just as a business telephone switchboard can use a main phone number and assign each employee an extension number (like x100, x101, etc.), so a computer has a main address and a set of port numbers to handle incoming and outgoing connections.
When You May Need to Take Action with Port NumbersPort numbers are typically processed by network hardware and software automatically. Normally you will not see them while casually using a network nor need to take any action involving them. However, in these special cases you can work with network port numbers:
- network administrators may need to set up port forwarding to allow the port numbers of specific applications to pass through a firewall. On home networks, broadband routers support port forwarding on their configuration screens.
- network programmers sometimes need to specify port numbers in their code, such as in socket programming.
- sometimes, a Web site URL will require a specific TCP port number be included. For example, http://localhost:8080/ uses TCP port 8080. Again, this is more usually seen in software development environments than on the Internet.