Common Network Port Numbers

Using a port number, we can recognize the exact process by which an Internet or other network message will be forwarded when it arrives at a server. A host in a network can receive traffic from different hosts at the same time and send traffic to different hosts. So, how does the system recognize which data belongs to which application? TCP and UDP solve this problem using port numbers in their headers.

Port numbers range from 0 to 65535, but port numbers 0 to 1023 are reserved for privileged services and designated as well-known port numbers. TCP and UDP on the receiving host know which application to send the data to based on the port numbers received in the headers.

Each TCP or UDP session on the source host assigns a random port number above the range of 1024. So that returning traffic from the destination can be identified as belonging to the originating application. A combination of the IP address, Protocol (TCP or UDP) and the Port number forms a socket at both the sending and receiving hosts. Because each socket is unique, an application can send and receive data to and from multiple hosts.

port numbers

The figure above illustrates two hosts communicating with the third host using TCP. Hosts A and C send traffic to host B at the same time. Hosts A and C send traffic destined for Port 80 but from different source ports. Host B can handle both connections simultaneously because of the combination of IP address, port numbers, and Protocols that make each connection different.

Well-known Port Numbers