Network Bytes · Episode 15 · CCNA 1.5

Ports and common port numbers

An IP address gets data to the right device; a port number gets it to the right app. Here are the four port numbers to learn first.

Posted · About a 1 minute watch, 2 minute read · Take the quiz

One device, many apps

Your laptop might be loading a web page, syncing email and streaming music all at once. Every piece of data that arrives carries your laptop's IP address, so how does it know which app it's for?

That's the job of the port number, a number from 0 to 65535 that rides along in the TCP or UDP header. Think of an apartment building: the IP address is the building's street address, and the port is the apartment door. The address gets the data to the building; the door number gets it to the right apartment.

Standard numbers, so servers know where to listen

For a server to be reachable, everyone has to agree which door each service sits behind. These well-known ports (0 to 1023) are assigned by IANA. The four to learn first:

  • 22 SSH: secure remote logins to a device's command line
  • 53 DNS: looking up names like example.com to find their IP address
  • 80 HTTP: plain, unencrypted web traffic
  • 443 HTTPS: secure, encrypted web traffic (the padlock in your browser)

A web server "listens" on port 443. When your browser connects to 203.0.113.7 on port 443, the server's operating system hands that traffic to the web server software.

Your side picks a random high port

Your own device needs a door too, so replies can find their way back. For each new connection it picks a temporary ephemeral port, usually a high number like 51234. Two browser tabs talking to the same website each get a different one, so the replies land in the right tab.

A connection is identified by both ends: your IP and port, plus the server's IP and port.

Try it yourself

On Windows, open Command Prompt and run netstat -an; on a Mac, open Terminal and run netstat -an | grep ESTABLISHED. Look at the remote addresses: many end in .443, which is HTTPS. Your own side shows high, random-looking port numbers.

Good to know

  • Port numbers are assigned by IANA. Well-known ports are 0-1023, registered ports 1024-49151, and dynamic or private ports 49152-65535 (RFC 6335).
  • Client (ephemeral) ports are usually 49152-65535, but the exact range varies by operating system.
  • DNS uses port 53 over both UDP and TCP.

For CCNA learners

This lines up with CCNA 200-301 exam topic 1.5, compare TCP to UDP: know that TCP and UDP use port numbers to reach the right application, and memorize the common well-known ports such as 22, 53, 80 and 443.

Test your knowledge

Quick quiz: Ports and common port numbers

4 multiple-choice questions. Pick one answer for each, then check how you did.

1What does a port number identify?
2Which port does secure web traffic (HTTPS) use by default?
3In the apartment building example, what is the port number like?
4Why does your device pick a random high port for each connection?

Sources

Video transcript

22, 53, 80, 443. Learn these four first.

An IP address gets data to the right device. A port number gets it to the right app. If the IP address is the building, the port is the apartment door.

Some numbers are standard, so every server knows where to listen. Port 22 is SSH, for remote logins. 53 is DNS. 80 is plain web traffic, HTTP. And 443 is secure web traffic, HTTPS.

Your side picks a random high number for each connection, so replies find their way back to the right browser tab.

Address finds the device. Port finds the app.

That's your bite. Next: why some cables carry light.

More from Network Bytes

All Network Bytes lessons