Skip to content
BENIBIX Learn

Network Port

Infrastructure🌐 NetworkingNetwork Addresses

Also known as Port, Port Number, TCP Port

A number that says which app should get the data. Each app has its own.

Think of it like

Think of it like a flat number in a big block. The street address finds the building, and the flat number finds the door.

Example

Jack runs an app on a laptop on port 3000. Jack opens localhost:3000 in the browser to see it.

Why it matters

Every server program needs a port. Closing the ones you do not use is a basic safety step.

Definition

A port is a number that says which program on a computer should get some data. The IP address finds the computer, and the port finds the program on it. Ports run from 0 to 65535. Some have fixed jobs: web pages use 80, secure web pages use 443 and SSH uses 22. A program listens on a port and answers whatever arrives there.

Example code

url
http://localhost:3000/
The number after the colon is the port the app listens on.

Common mistake

Starting two programs on the same port. The second one fails with an address in use error.

Key takeaways

  1. 1
    Picks the program. The IP picks the computer.
  2. 2
    0 to 65535. Some numbers have fixed jobs.
  3. 3
    Programs listen. And answer what arrives.

Learn it properly