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:
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-49151. For 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.
Comments
Post a Comment