Network Ports Explained

Addressing Applications

Ports and Protocol Numbers Explained. How One IP Address Serves Many Applications Introduction

An IP address identifies a device on a network. But one device can run many applications at the same time. You might be browsing the web, listening to music, syncing files, running a local server and chatting on messaging apps. If all those applications shared the same IP without a way to distinguish them your computer would not know which incoming data belongs to which app.

Ports solve this problem. They allow multiple applications to send and receive data over one IP address. Ports are essential to how the internet operates.

What is a Port

A port is a logical number used by applications to send and receive data. Think of an IP address as an apartment building and ports as apartment numbers. The building is the device. The apartments are the individual applications.

Ports help identify which application should receive incoming packets.

Why do Ports exist

Ports allow:

Without ports every incoming packet would look identical. Your computer would not know whether a packet is meant for:

Ports bring order to network communication.

How ports work with TCP and UDP

Both TCP and UDP use ports. Every connection contains:

Protocol (TCP or UDP)

This combination ensures that data flows to the correct process.

Example:

This pairing uniquely identifies the connection.

Types of ports

Ports range from 0 to 65535. They fall into three categories.

Well known ports (0–1023)

Used by widely used protocols and reserved for standard services.

Common ones:

20 21: FTP

22: SSH

23: Telnet

25: SMTP

53: DNS

67 68: DHCP

80: HTTP

110: POP3

123: NTP

143: IMAP

443: HTTPS

636: LDAPS

Servers usually run on these ports. Clients connect using high ports.

Registered ports (1024–49151)

Used by applications, vendors and frameworks.

Examples:

1433: Microsoft SQL Server

3306: MySQL

3389: Remote Desktop (RDP)

5432: PostgreSQL

27017: MongoDB

Companies often reserve these ports for their software.

Dynamic or private ports (49152–65535)

Used temporarily by client applications.

When your browser opens a new page it picks a random port in this range. That port helps identify that specific connection. This allows a browser to open dozens of tabs without conflict.

What “listening on a port” means

When a server runs a service it waits for connections on a specific port.

Examples:

A web server listens on port 80 or 443

A DNS server listens on port 53

A game server might listen on port 5000

Listening means the server is ready to accept incoming data for that application.

How ports appear in URLs

Sometimes you see a port number in a URL.

Example: http://localhost:3000

This means the browser will connect using port 3000 instead of the default port 80. Developers use custom ports for local servers.

How firewalls use ports

Firewalls allow or block traffic using ports. For example:

Allow port 443 for secure web traffic

Block port 22 or 23 to prevent unauthorized access

Open port 5432 only to a database subnet

Ports help firewalls control what enters or leaves a system.

Why some ports feel “blocked”

On home networks:

ISPs often block port 25 to prevent spam

Routers block incoming ports for safety

NAT hides internal ports from the public internet

This protects users from unsolicited attacks.

How ports relate to NAT

In home networks multiple devices share one public IP. NAT uses port mapping to differentiate connections.

Example:

Laptop uses port 50500

Phone uses port 50501

TV uses port 50502

NAT ties each public port back to the correct device and application.

This is why port forwarding exists when hosting services from home.

Common misconceptions

Misconception 1

“Ports are physical.” No. They are software constructs.

Misconception 2

“Port 80 is always open.” It is only open if a web server is listening.

Misconception 3

“All ports are dangerous.” Only open ports exposed to the public pose risk.

Conclusion

Ports let multiple applications use the same IP. They help identify which program should receive which packets. They are essential for web browsing, servers, NAT, firewalls and almost every networked application. Understanding ports makes it easier to learn NAT, firewalls and application level protocols like HTTP or DNS.

Webmentions

If you liked this article and think others should read it, please share it.

👍 0 🔁 0 💬 0