DocumentationSecurity & Ports

What is a Port in Networking? TCP and UDP Explained

Understand the technical role of ports in network communication, the difference between TCP and UDP, and how firewalls manage traffic.

Key Takeaways

  • A port is a logical endpoint for communication in an operating system.
  • There are 65,535 available ports, divided into system, user, and dynamic blocks.
  • Firewalls secure networks by blocking inbound traffic to unauthorized ports.

Logical Endpoints

While an IP address identifies a specific machine on a network, a Port identifies a specific application or process running on that machine. Together, an IP address and a port number form a socket.

TCP vs. UDP Ports

Network ports operate primarily over two transport protocols:

  • TCP (Transmission Control Protocol): Connection-oriented, ensuring reliable delivery. Used for web traffic (Port 80/443), email, and SSH.
  • UDP (User Datagram Protocol): Connectionless, prioritizing speed over reliability. Used for DNS queries (Port 53), gaming, and video streaming.

Port States and Firewalls

In network security, a port can be in three primary states: Open (an application is actively listening), Closed (no application is listening), or Filtered/Stealth (a firewall is silently dropping packets sent to this port). Validating port states is critical for infrastructure security.

Frequently Asked Questions

What are 'Well-Known Ports'?

Ports 0 through 1023 are classified as well-known ports. They are strictly assigned to critical system services by IANA, such as Port 80 for HTTP, 443 for HTTPS, and 22 for SSH.

Supported By

Sponsor Banner