Lets learn "About different types of ports in Linux"

 


In this tutorial, we will learn about the different types of ports in Linux. A port is basically a communication endpoint in computer networking. A port can be hardware port like USB port, HDMI port etc. And a port can be logical. But the basic purpose of port is data transfer between two different hardwares or application software. In this tutorial, we'll be discussing logical ports.

Classification of ports

In computer, logical ports are numbers in the range of 0-65535.

The port is classified into three types

1. Well known or system ports

Well known or system ports are special ports in the system which are assigned to special processes. Range of well-known ports is 0-1023. It is recommended to not make non system apps listen on ports that are part of Well known or system ports.

Some special ports in this category are as follows:

Port No.

Transport Protocol

Service Name

20, 21

TCP

File Transfer Protocol (FTP)

23

TCP

Telnet

25

TCP

Simple Mail Transfer Protocol (SMTP)

53

TCP & UDP

Domain Name System (DNS)

110

TCP

Post Office Protocol (POP3)

123

UDP

Network Time Protocol (NTP)


2. Registered Ports

Registered ports are used by the user's (non-system) applications open for the clients to connect to. Registered Ports are in the range of 1024-49151For e.g, you wrote an app that starts an HTTP server registering some endpoints. The port on which your app will be listening should be in range of Registered ports. 

3. Dynamic Ports

The ports from the global ports range 0-65535 which are not part of well-known ports or registered ports are part of Dynamic port. The range of dynamic port is 49152-65535. The reason they are called dynamic is that applications dynamically use this port temporarily, do the work and then release the port. For e.g if we have two applications APP1 and APP2. APP1 is listening on one of the registered port ( say 1100 ) and APP2 is listening on another registered port ( say 1200 ). Now if APP1 wants to connect to APP2's 1200 port, APP1 will opens a port from Dynamic port for the connection.



Diagram describing registered and dynamic ports


HOPE YOU LIKE THIS TUTORIAL. FEEL FREE TO COMMENT BELOW IF YOU HAVE ANY DOUBTS. AND STAY TUNED FOR MORE TUTORIALS :)
 

Comments

Popular posts from this blog

Lets learn "About kube proxy in iptables mode"

Lets learn "System design for paste bin (or any text sharing website)"

Lets learn "Factory design pattern"