Port/Ports TCP/IP

The use of ports

Many TCP/IP programs can be executed simultaneously over the Internet (you can for example open several browsers simultaneously or browse HTML pages while downloading a file via FTP). Each of these programs works with a protocol, sometimes the computer must be able to distinguish the different data sources.

So, to facilitate this process, each of these applications can allocate a unique address to the machine, coded in 16 bits: a port (the combination of IP address + port is therefore a unique address in the world and is called a socket).

The IP address therefore serves to uniquely identify a computer on the network while the port number specifies the application for which data is intended. In this way, when the computer receives information intended for a port, the data is sent to the related application. If it is a request sent to the application, the application is called a server application. If it is a response, we then talk about a client application.

The multiplexing function

The process which consists of being able to send information from various applications over a connection is called multiplexing. In the same way the matter of managing to compare (thus share among the various applications) the data flow is called demultiplexing.

These operations are carried out thanks to the port, i.e. a number linked to an application type which, when combined with an IP address, makes it possible to uniquely determine an application which is running on a given machine.

Default allocations

There are thousands of ports (these are coded over 16 bits, therefore there are 65536 possibilities) that is why a standard application has been developed by IANA (Internet Assigned Numbers Authority), to help with network configurations.

  • Ports 0 to 1023 are the "well known ports" or reserved ports. Generally speaking, they are reserved for system processes (daemons) or programs executed by privileged users. A network administrator can nevertheless link services to the ports of his choice.
  • Ports 1024 to 49151 are the "registered ports".
  • Ports 49152 to 65535 are the "dynamic and/or private ports".

Here are some of the most commonly used well known ports:

Port Service or Application
21 FTP
23 Telnet
53 Domain Name System
63 Whois
70 Gopher
79 Finger
110 POP3
119 NNTP

So, a server (a computer that is contacted and which offers services such as FTP, Telnet, etc.) has fixed port numbers to which the network administrator links the services. So, server ports are generally between 0 and 1023 (value range linked to known services).

On the client side, the port is chosen randomly by the operating system from among those available. So, client ports will never include ports between 0 and 1023 because this value range represents the well known ports.

More information

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
This document, titled « Port/Ports TCP/IP », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).