A port refers to a logical connection point that allows a computer or device to send and receive data across a network.
Different types of activities on your computer, like web browsing, email or file transfer
use different ports to send and receive data. Ports help organize and manage the flow of information between devices on a network. They ensure messages and data reach the right destination on a computer.
Common port numbers
Port Number | Protocol Name | Description |
80 | HTTP (Hypertext Transfer Protocol) | Regular web browsing |
443 | HTTPS (Hypertext Transfer Protocol Secure) | encrypted web browsing |
25 | SMTP (Simple Mail Transfer Protocol) | send emails |
110 | POP3 (Post Office Protocol v3) | retrieve emails from mail server |
21 | FTP (File Transfer Protocol) | transfer files between computers |
22 | SSH (Secure Shell protocol) | Secure remote access and control of a computer |
53 | DNS (Domain name system protocol) | Translate domain names to IP addresses |
Types of ports
A. System Ports aka Well known ports
System ports are port numbers in the range from
0 to 1023
.System ports are associated with essential network services and are used by system-level processes and privileged applications.
B. Registered ports aka user ports
Registered ports are in the range from
1024 to 49151
.These ports are also managed by the IANA.
They are available for use by user-level applications and services.
C. Dynamic aka private ports
Dynamic ports are in the range from
49152 to 65535
.This is used by the system itself and allows multiple client applications on the same system to establish connections to different servers simultaneously without port conflicts.
Role of IP address
Combination of IP and port number ensures that data packets are delivered to the correct application running on the destination device.
IP addresses get the data to the right device, and port numbers get the data to the right application on that device.
Netstat
A command-line tool that gives you information about your computer's network connections.
It answers the following questions
What connections your computer has with other computers?
Which programs on your computer are using the network?
Which route should the data packets take to reach their destination?
Firewalls and ports
Firewalls often use port numbers as criteria for filtering network traffic. They can be configured to allow or block traffic based on the ports being used.
Firewalls can restrict access to specific ports based on security policies.
But firewalls can also perform deep packet inspection and application layer filtering, allowing them to inspect the contents of network packets and not just check the port numbers.
Overall, ports play a fundamental role in enabling the exchange of data and services across networks. They basically act like entry points, letting different types of data in and out of devices.