Port numbers are used to keep a log of the different conversations transferred across the network at the same time. When a computer connects to a network, it must take into account the protocol that is going to be used in order to correctly emit and receive data packets.
There are various types of protocols, but in 1978 the International Standards Organization (ISO) created a standard for all network communications called The reference model of Open Systems Interconnection, commonly known as the OSI model. Its philosophy is based on dividing the functions of the transmission chain into modules, whose interface with adjacent modules is standardized. This philosophy offers a double advantage:
With this model, communication is established between devices layer by layer.
The transport layer is layer 4 of the OSI model. This layer guarantees service reliability and describes the quality and nature of data transmission. This layer defines when and how retransmission should be used to assure delivery.
There are various protocols in this layer, including TCP and UDP. These protocols support the different application layer protocols. For example, TCP supports HTTP, FTP, TELNET, SMTP and DNS, whereas, UDP supports DNS, TFTP, SNMP and RIP.
Both TCP and UDP use port numbers (sockets) to send information to higher layers.
Programmers of application software, the layer immediately above the transport layer, have agreed to use the known port numbers released by the Internet Assigned Numbers Authority (IANA). For example, any conversation aimed at the FTP application uses the standard port numbers 20 and 21. Port 20 is used for the data and port 20 is used for control.
Conversations that do not involve any applications with a known port number are assigned random port numbers selected from a specific range above 1023. The following ranges are assigned to the port numbers:
Numbers below 1024 correspond to well-known port numbers.
Numbers over 1023 are port numbers assigned dynamically.
Registered port numbers are those numbers that are registered for the applications of specific providers. The majority of these numbers are over 1024.
End-systems use port numbers to select the correct application. The source host dynamically assigns the source port numbers. The majority of these numbers are over 1023.
Other well-known port numbers include:
| TELNET ||23|
|RIP|| 520 |
A firewall can close or hide ports in the devices to prevent intruders or attacks.
For more information about widely used communication ports, click here to go to the IANA page.