In a computer science or network a port can be defined as both physical and logical. A port acts like a door through which data can flow in and out from a computer or network system. These doors have their specific purpose and role when dealing with the data.
Ports are like doors connecting these rooms, allowing data to flow in and out. Each door has a specific job—some are for web browsing, others for secure communication. The doors can be open or closed, controlling the access of data. Ports act as traffic controllers, ensuring smooth communication between applications. They're like the pathways that maintain order, making sure the right data reaches the right place.
A computer hardware or a communication port is a physically connected point used as an interface between the computer and the devices like keyboard, mouse, monitor, speakers, etc. to transmit data. Example : usb, vga, hdmi, ethernet etc.
While, in computer networking a port is a virtual point where network connection and communication starts and ends. These logical ports are software-based and managed by a computer’s operating system. Each port is associated with a specific service.
Basically, a port is a number used to uniquely identify a transaction over a network by specifying both the host and the service. These port numbers are necessary to differentiate between many different IP services such as mail service(HTTP), mail service(SMTP), file transfer(FTP), SSH, SNMP, Telnet etc.
The IANA(Internet Assigned Number Authority) is a department of ICANN(Internet Corporation of Assigned Numbers and Names) owned by the US Department of Commerce. They have the responsibility of managing the registries of the internet's unique identifier- ip addresses pool, protocol parameter, domain names, services and port numbers. There are 65,535 ports available for communication over the network.
Virtual port numbers are classified as :
Well-known Ports : Port numbers from 0 to 1023 are reserved for common TCP/IP applications. Ports 1011-1023 are reserved for future use. Example : http, smtp, ssh, https etc.
Registered Ports : Port numbers from 1024 to 49151 are not assigned or controlled but can be registered to prevent duplication. Unlike well-known ports, anyone can use these port numbers for their servers or on clients temporarily. Example : socks5, kerberos, docker, oracle database etc.
Dynamic Ports : Ports ranging from 49152 to 65535 can be used by any computer application program to communicate with any other application program running on TCP or UDP. These are also known as ephemeral or private ports.
Common Port Numbers :
Helpful Resources :