Network ports cheat sheet: everything from the video on one page

The quick-reference version of "Network Ports Explained... Like I'm Five." Open, closed and blocked ports, listeners, TCP vs UDP, and how to ask for a firewall rule.

Just watched Network Ports Explained... Like I'm Five? Here's the whole thing on one page.

The big idea

Picture a server as a street full of houses. Each house is a network port, and each one has its own number. Your computer is Henry, a pizza-delivery hedgehog. To deliver to a server, Henry needs the street and the house number.

Henry has three pizzas to deliver on Oak Street. Each delivery shows something you'll run into with ports:

Delivery What Henry found What happened on the network
443 Oak Street William the website opened the door and said thanks for the pizza Port 443 is open. The web server is listening on it, so your computer connects.
53 Oak Street A sign on the door: "No one lives here" Port 53 is closed. Nothing on this server is listening there, so it turns your computer away.
22 Oak Street A gate that nobody opened, so Henry eventually gave up Port 22 is blocked by a firewall. Your computer usually gets no answer at all, waits, and gives up.

Port 53 is for DNS (the internet's Contacts app from our DNS cheat sheet). This server runs a website, not DNS, so nobody's home at number 53.

What's a listener?

When an application runs on a server, it can listen on a specific port, waiting for other computers to talk to it there. That's who answers the door.

Only one application can listen on a given port and protocol on a server at a time. For example, you couldn't run two different database applications on port 3306 at once. You'd pick one, or set the other one up to listen on a different port.

Ports you'll see a lot

Port Used for Protocol
22 SSH: how Linux server admins log in to manage a server. Often blocked for everyone else. TCP
53 DNS: turning names into IP addresses Mostly UDP
443 HTTPS: secure websites Mostly TCP
3306 MySQL databases TCP

Ports are mostly standardized. If you're not sure which port or protocol an app uses, a quick search or the app's documentation will usually tell you.

TCP vs UDP

These are the two most common transport protocols: the rules for how the pizza actually gets carried.

  • TCP is running into your friend Rachel at a quiet coffee shop. You say hi, she says hi back, and you have a real conversation until you say goodbye. Each side checks that the other heard them.
  • UDP is shouting something to Rachel across a noisy parking lot. You don't check that she heard you, and if she missed it, you don't repeat it.

Most of the time you'll be dealing with TCP. SSH and MySQL use it, for example. UDP is used when speed matters more than every single piece arriving, like video calls, online games and quick lookups like DNS.

Asking for a firewall rule

Say you've just built a new server that needs to talk to a database server. If you want happy network admins, put these four details in your firewall request:

  1. Source: the server starting the conversation, by hostname and/or IP address. Example: new-app-server.example
  2. Destination: the server it needs to reach. Example: db-server.example
  3. Port: where the destination is listening. Example: 3306 (MySQL)
  4. Protocol: TCP or UDP. Example: TCP

(Those hostnames end in .example, a name set aside for examples, so they never point at a real server.)

Two more things to know:

  • Connections are one-way. The rule opens the conversation from the source to the destination, and the replies come back automatically on that same connection.
  • The source doesn't listen on 3306. Your new server just borrows a random, temporary port on its own side for the length of the connection.

There are more details to network ports, protocols and firewalls; this is just the basics. What other tech topics should we explain like you're five? Let us know in the YouTube comments!