<P> Ports were unnecessary on direct point - to - point links when the computers at each end could only run one program at a time . Ports became necessary after computers became capable of executing more than one program at a time and were connected to modern networks . </P> <P> Transport layer protocols, such as the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP), specify a source and destination port number in their headers . A port number is a 16 - bit unsigned integer, thus ranging from 0 to 65535 . A process associates its input or output channels, via an Internet socket (a type of file descriptor), with a transport protocol, a port number, and an IP address . This process is known as binding, and enables sending and receiving data via the network . The operating system's networking software has the task of transmitting outgoing data from all application ports onto the network, and forwarding arriving network packets to processes by matching the packet's IP address and port number . Only one process may bind to a specific IP address and port combination using the same transport protocol . Common application failures, sometimes called port conflicts, occur when multiple programs attempt to bind to the same port numbers on the same IP address using the same protocol . </P> <P> Applications implementing common services often use specifically reserved well - known port numbers for receiving service requests from clients . This process is known as listening, and involves the receipt of a request on the well - known port and establishing a one - to - one server - client dialog, using the same local port number . Other clients may continue to connect to the listening port; this works because a TCP connection is identified by a tuple consisting of the local address, the local port, the remote address, and the remote port . The well - known ports are defined by convention overseen by the Internet Assigned Numbers Authority (IANA). The core network services, such as the World - Wide Web, typically use well - known port numbers . In many operating systems special privileges are required for applications to bind to these ports, because these are often deemed critical to the operation of IP networks . Conversely, the client end of a connection typically uses a high port number allocated for short term use, therefore called an ephemeral port . </P> <P> The port numbers are encoded in the transport protocol packet header, and they can be readily interpreted not only by the sending and receiving computers, but also by other components of the networking infrastructure . In particular, firewalls are commonly configured to differentiate between packets based on their source or destination port numbers . Port forwarding is an example application of this . </P>

What are ports on a computer used for