Ports and their use.

Ports and their use.

Ports can be a confusing subject at first, and in this post I hope to clarify what ports are and how they are used.

First, let's look at what a port is. A port is a logical connection point. In the networking sense, it is used to identify a specific process or service on a computer. Ports are identified by numbers, ranging from 0 to 65535.

There are three categories of ports:

  • Well-known ports (0-1023): These are assigned to commonly used services like HTTP, FTP, and SMTP
  • Registered ports (1024-49151): These can be registered for specific applications
  • Dynamic/Private ports (49152-65535): These are used for temporary connections

When a computer wants to communicate with a service on another computer, it needs to know not only the IP address of the destination computer, but also the port number of the specific service it wants to access.

For example, when you browse to a website, your browser connects to port 80 (HTTP) or port 443 (HTTPS) on the web server. When you send an email, your email client connects to port 25 (SMTP) on the mail server.

Here are some commonly used port numbers:

  • 21 - FTP (File Transfer Protocol)
  • 22 - SSH (Secure Shell)
  • 23 - Telnet
  • 25 - SMTP (Simple Mail Transfer Protocol)
  • 53 - DNS (Domain Name System)
  • 80 - HTTP (Hypertext Transfer Protocol)
  • 110 - POP3 (Post Office Protocol version 3)
  • 143 - IMAP (Internet Message Access Protocol)
  • 443 - HTTPS (HTTP Secure)
  • 993 - IMAPS (IMAP over SSL)
  • 995 - POP3S (POP3 over SSL)

Understanding ports is crucial for network troubleshooting and security. Firewalls use port numbers to control which traffic is allowed through, and network administrators need to understand which ports their applications use to configure networks properly.

In summary, ports are the mechanism that allows multiple services to run on a single computer while keeping their communications separate and organized.