Overview#

A protocol is a standard set of rules systems use to exchange data. It defines details such as formatting, addressing, flow control, and error detection. A port number identifies a communication endpoint on one host. Ports let several services use the same IP address at the same time.

This page collects the application protocols and ports that come up often in networking, along with the ranges IANA uses to organize port assignments. The OSI model covers the transport details underneath them, including TCP’s handshake and UDP’s connectionless delivery.

Port number ranges#

The Internet Assigned Numbers Authority (IANA) divides the 16-bit port space into three ranges:

RangeNameTypical use
0–1023Well-known portsLong-established system services, e.g. 80 (HTTP), 443 (HTTPS), 25 (SMTP)
1024–49151Registered portsVendor and application-specific services, e.g. 3389 (RDP), 3306 (MySQL)
49152–65535Dynamic/private portsShort-lived client-side ports chosen for the life of one connection

A server usually listens on a well-known or registered port. A client normally chooses an ephemeral port from the dynamic range for the connection. An administrator can still run a service on an unusual port; these ranges are a registration convention, not a technical restriction.

Common application protocols#

ProtocolPurposeTransport / port
FTPUnencrypted file transferTCP 20 (data), 21 (control)
SFTPFile transfer over SSHTCP 22
SSHEncrypted remote administrationTCP 22
TelnetUnencrypted remote administrationTCP 23
SMTPMail transfer between serversTCP 25 (relay), 587 (submission)
DNSName resolution queriesUDP 53
DNSZone transfers and oversized responsesTCP 53
DHCPAutomatic IP address assignmentUDP 67 (server), 68 (client)
TFTPMinimal, connectionless file transferUDP 69
HTTPUnencrypted web trafficTCP 80
NTPTime synchronizationUDP 123
SNMPDevice status, polling and trapsUDP 161 (poll), 162 (trap)
LDAPDirectory access, e.g. Active DirectoryTCP 389
HTTPSWeb traffic over TLSTCP 443
SMBWindows file and print sharingTCP 445
LDAPSDirectory access over TLSTCP 636
Microsoft SQL ServerDatabase queriesTCP 1433
RDPRemote desktop for Windows systemsTCP 3389
SIPSession setup for voice/video callsUDP/TCP 5060, TCP 5061 (TLS)

Some study-note shortcuts are easy to misread:

  • SMTP is not itself a “secure” protocol. Port 25 carries server-to-server relay traffic. Mail clients normally submit on port 587 with STARTTLS or port 465 with implicit TLS. The secure part is the transport wrapper, not SMTP by itself.
  • NTP runs over UDP, not TCP. Its request/response exchange does not need a connection-oriented transport.
  • Syslog traditionally uses UDP 514. TCP and TLS-protected versions also exist, but they are not the historical default.
  • TLS and SQL do not each have one port. TLS protects many protocols on different ports. Port 443 belongs to HTTPS, which uses TLS. SQL is a query language, not a network protocol: TCP 1433 is Microsoft SQL Server’s default, while MySQL defaults to 3306 and PostgreSQL to 5432.
  • Spanning Tree Protocol (STP) has no TCP port. It runs directly over Ethernet at Layer 2. The number 32768 is STP’s default bridge priority, not a port number.

Network-layer and tunneling protocols#

  • Internet Control Message Protocol (ICMP) carries diagnostic and error messages for IP rather than application data. ping and traceroute/tracepath use ICMP echo and time-exceeded messages.
  • Generic Routing Encapsulation (GRE) wraps one packet inside another to make a point-to-point tunnel. It can carry non-IP traffic or one IP version across another. GRE began as a Cisco protocol and is now an open standard. It provides no encryption or authentication by itself, so it is often paired with IPsec when confidentiality is needed.
  • IPsec secures IP traffic. The network functions page covers AH, ESP, and IKE.

The familiar 1500-byte figure is the Ethernet MTU, not a universal maximum packet size. Other link types and jumbo-frame configurations use different values. IPv6 requires a minimum link MTU of 1280 bytes.

Suggested practice: read ports off real traffic#

On a network you own or are authorized to inspect:

  1. Start a capture with tcpdump or Wireshark.
  2. Run a DNS lookup (dig or nslookup) and load an HTTPS page.
  3. For each exchange, find the server’s destination port and the client’s ephemeral source port.
  4. Check whether the server port is in the well-known or registered range and whether the client port is in the dynamic range.
  5. Find an ICMP message; an echo request or reply from ping is enough. Note that it has no port numbers because ICMP sits below the transport layer’s port addressing.
  • The OSI model — where TCP, UDP, and port-based addressing sit in the layered model.
  • Network functions — IPsec, IKE, and tunneling built on top of these protocols.
  • Network appliances — firewalls and load balancers that make decisions using this same port and protocol information.

Sources and further reading#

This page was edited from my own study notes, taken from Ian Neil’s CompTIA Network+ certification guide, and checked against the primary sources:

Port assignments can be changed on a real system. IANA’s registry and the RFCs describe the convention, not a technical guarantee.