Ctrl + K
Network9 min read

Ports Explained: Common TCP and UDP Ports

Understand network ports, how TCP and UDP use them, common port numbers and why ports are essential for Internet communication.

Published: 2026-08-07

Network ports allow multiple applications and services to communicate over the same IP address simultaneously. Together with an IP address and a transport protocol such as TCP or UDP, a port identifies the specific service that should receive incoming network traffic. Without ports, devices would not know which application should process a received packet.

Whether you're browsing websites, sending email, connecting through SSH or playing online games, network ports are used behind the scenes to direct traffic to the appropriate service.

What Is a Network Port?

A network port is a logical communication endpoint identified by a number between 0 and 65535. Ports exist in software rather than hardware and are used by operating systems to route incoming and outgoing network traffic to the correct application.

IP Address vs Port Number

An IP address identifies a device on a network, while a port identifies a specific service or application running on that device. Together they form a socket endpoint that uniquely identifies a network connection.

ComponentPurpose
IP AddressIdentifies a device
Port NumberIdentifies a service or application

TCP vs UDP Ports

TCP and UDP each use the same port numbering range, but they are separate transport protocols. A service may use the same port number over TCP, UDP or both depending on its communication requirements.

ProtocolCharacteristics
TCPReliable, connection-oriented, ordered delivery
UDPConnectionless, faster, lower overhead

Port Number Ranges

Port numbers are divided into three standard ranges based on their intended usage.

RangeNameTypical Usage
0–1023Well-Known PortsStandard Internet services
1024–49151Registered PortsApplications and vendor software
49152–65535Dynamic/Ephemeral PortsTemporary client connections

Most Common TCP Ports

PortService
20/21FTP
22SSH
23Telnet
25SMTP
53DNS (TCP)
80HTTP
110POP3
143IMAP
443HTTPS
3306MySQL
5432PostgreSQL

Common UDP Ports

PortService
53DNS
67/68DHCP
69TFTP
123NTP
161SNMP
514Syslog

Why Services Use Different Ports

Different services listen on different ports so multiple applications can operate simultaneously on the same server. For example, a web server may accept HTTPS connections on port 443 while an SSH server listens on port 22, allowing secure administration without interfering with web traffic.

203.0.113.15:443
192.168.1.10:22
💡 When troubleshooting connectivity issues, verify both the destination IP address and the port number. A reachable server may still reject connections if the required port is closed or blocked by a firewall.
⚠️ Opening unnecessary ports increases a system's attack surface. Only expose the ports that are required for your applications and keep unused services disabled.

How Ports Work

When an application wants to communicate over a network, it opens a port and waits for incoming connections or sends data through an outgoing connection. The operating system uses the destination port number to determine which application should receive each incoming packet.

Client Ports and Server Ports

Servers typically listen on well-known or registered ports, while client devices use temporary ports known as ephemeral ports. When a client connects to a server, both the source and destination ports are included in every packet, allowing multiple simultaneous connections to be tracked independently.

RoleTypical Port Usage
ServerWell-known or registered port
ClientDynamic/ephemeral port

What Is a Socket?

A socket uniquely identifies one endpoint of a network connection. It combines an IP address, a transport protocol and a port number. Together, the source and destination socket information allow operating systems to distinguish one network connection from another.

Client: 192.168.1.25:53124
Server: 203.0.113.15:443

Well-Known Network Services

Many Internet protocols use standardized port numbers so that clients know where to connect. These port assignments are widely recognized and supported by networking software around the world.

PortProtocolPurpose
22SSHSecure remote login
53DNSDomain name resolution
80HTTPWeb traffic
443HTTPSEncrypted web traffic
3306MySQLDatabase connections
5432PostgreSQLDatabase connections

Open vs Closed Ports

An open port is actively listening for incoming connections because an application is using it. A closed port has no service listening, so connection attempts are rejected or ignored depending on the operating system and firewall configuration.

Port StateMeaning
OpenA service is accepting connections
ClosedNo application is listening
FilteredTraffic is blocked by a firewall or security device

Ports and Firewalls

Firewalls control which ports are allowed to receive or send network traffic. By permitting only required ports and blocking unnecessary ones, firewalls reduce the attack surface and help protect systems from unauthorized access.

Port Forwarding

Port forwarding allows traffic arriving on a router's public IP address and a specific port to be redirected to a device inside a private network. This technique is commonly used for self-hosted websites, game servers, remote desktop services and security cameras.

Port Scanning

Port scanning is the process of checking which ports on a device are open, closed or filtered. Network administrators use port scanning to verify configurations, while security professionals use it to identify exposed services that may require additional protection.

  • Verify running network services.
  • Identify unnecessary open ports.
  • Test firewall configurations.
  • Audit server security.
  • Troubleshoot connectivity issues.
💡 Keep only the ports that your applications actually require open. Closing unused ports improves security and reduces the likelihood of unauthorized access.
⚠️ Changing a service to a different port may reduce automated scanning, but it is not a substitute for proper authentication, encryption and firewall protection.

Common Mistakes

Network ports are simple in concept, but they are frequently misunderstood. Many connectivity problems occur because of incorrect assumptions about how ports, firewalls and network protocols interact. Understanding the role of ports helps diagnose communication issues more effectively.

  • Confusing port numbers with IP addresses.
  • Assuming TCP and UDP share the same connection state.
  • Opening more ports than necessary.
  • Ignoring firewall rules when troubleshooting.
  • Assuming a service is available simply because the server is online.
  • Believing that changing a port number provides strong security.

Best Practices

  • Open only the ports required by your applications.
  • Use encrypted protocols such as HTTPS and SSH whenever possible.
  • Regularly audit open ports on Internet-facing systems.
  • Restrict access using firewall rules and network segmentation.
  • Disable unused services to reduce the attack surface.
  • Document custom port assignments for easier maintenance.
💡 If an application cannot connect to a remote service, verify the destination IP address, port number, protocol (TCP or UDP) and firewall configuration before investigating more complex networking issues.
⚠️ An open port does not automatically mean a system is vulnerable, but every exposed service should be kept up to date, securely configured and protected by appropriate authentication mechanisms.

Frequently Asked Questions

How many network ports are available?

Both TCP and UDP use 16-bit port numbers, providing 65,536 possible ports ranging from 0 to 65535.

Can TCP and UDP use the same port number?

Yes. TCP and UDP maintain separate port spaces, so the same port number can be used simultaneously by different services using different transport protocols.

What is an ephemeral port?

An ephemeral port is a temporary port automatically assigned by the operating system to a client application when it establishes an outbound network connection.

Why is port 443 used for HTTPS?

Port 443 is the standardized port assigned to HTTPS, allowing web browsers and servers to establish encrypted TLS connections using a well-known endpoint.

Does changing a service to another port improve security?

Changing a port may reduce casual scanning, but it should not be considered a primary security measure. Strong authentication, encryption, firewalls and regular software updates provide far more effective protection.

Helpful Network Tools

A Port Number Lookup identifies the service commonly associated with a specific port, an HTTP Port Reference provides information about ports used by web technologies, an HTTP Status Codes Lookup explains server response codes encountered during web communication, a Ping Command Builder generates platform-specific ping commands for connectivity testing, and an SSH Config Generator helps create SSH client configuration files for secure remote access.

Conclusion

Network ports enable multiple applications to communicate over the same device by directing traffic to the appropriate service. Combined with IP addresses and transport protocols such as TCP and UDP, ports form the foundation of Internet communication. Understanding common port numbers, firewall behavior and the distinction between client and server ports makes it easier to configure services, troubleshoot connectivity problems and secure networked systems effectively.