seegongsik
Saved words
Networks

Many rooms in one building: ports

With an IP address you found which computer. But inside that computer many apps run at once: a web browser, mail, a game. Which app should an arriving packet go to? The thing that decides this is the port.

01

IP is the building, the port is the room

Last time we learned the IP address.
The IP address found which computer.
But that computer
is not a one-room house.
It is more like a big building with many rooms.
A different app lives in each room.
So finding the building alone is not enough.
You must also know which room inside,
to arrive exactly.
That room number is the port.

Tap the building to open the rooms inside

Tap the building (computer) to open the rooms inside. One building, many rooms, each room a port number.

Open the building and the rooms come out in a row.
From outside, the building is one.
The IP address points to that one building.
But step inside
and it is split into several rooms.
Same building, different rooms.
So the exact destination
is the building address plus the room number.
IP address plus port number.
This pair pinpoints one app.

02

One computer, many doors

Picture your own computer.
You search in a web browser,
receive mail at the same time,
and music is playing too.
These apps live together
inside the same computer.
Their IP address is all the same.
Yet nothing gets confused,
because each app has its own room,
its own port, kept apart.

IP address203.0.113.5
Tap an app to see the port it uses

Tap the apps inside one computer (same IP). Each app uses a different port number.

Tapping the apps,
their IP address was all the same.
They live in the same building.
But the port number differed per app.
The browser has the browser's room,
mail has mail's room.
By splitting up the rooms this way,
many apps on one computer
can work without mixing together.
So can these room numbers be just anything?

03

There are well-known numbers

A big building usually fixes
the numbers of the most-visited places,
like the front desk room or the mail room.
That way even a first-time visitor
can go straight there.
Ports are the same.
Much-used apps have
their well-known room numbers agreed in advance.
Web is number 80,
secure web (HTTPS) is number 443.

Tap a well-known port to see which app's room it is

Tap a well-known port to see which app's room it is. Web=80, secure web (HTTPS)=443, agreed in advance.

We tapped the well-known numbers one by one.
Tap 80 and it is web,
tap 443 and it is secure web.
From the number alone
you can tell which app's room it is.
Thanks to these agreed numbers,
you need not type a number in the address bar:
the browser goes to the web room on its own.
The doors you use often are always in the same spot,
no number to memorize.

04

Which app does it go to

Now suppose a packet has arrived.
Reading the IP address,
it found the building (the computer) just fine.
But inside are several rooms.
Which room should the packet enter?
No worry.
The packet also carries a port number.
Looking at that number,
it slips right into the room with the matching number,
that is, the right app.

To203.0.113.5:80
Read the packet's port number, then tap the matching room (app) to deliver

Read the arrived packet's port number, then tap the room (app) with that number to deliver.

Tap the room matching the port number,
and the packet lands right on the right app.
Tap a different room
and the number does not match, so it goes astray.
This is what the port does.
The IP address gets you to the building,
the port number to the room inside.
The two as a pair
are what bring the packet exactly
to that one app, its true destination.

05

Let's wrap up

Gathered on one line, it's this.
An IP address finds the building (the computer).
A port points to a room inside, that is, an app.
So the exact destination
is the IP address plus the port number.
There are well-known room numbers too,
like web 80, secure web 443.
An arriving packet reads the port number
and slips into the right app.
Find the building, then the room inside.

Tap the key points in order to review

Tap the key points in order to review. (IP is the building, port the room → many apps on one computer → well-known numbers → route by port)

Now you know how a packet finds its way
to a certain app on a certain computer.
The IP address finds the building,
the port number finds the room.
Addresses and numbers, routes and agreements.
Small pieces gather
into the big picture called the internet.
Next time, let's look at how those pieces
stack up in layers
and work together.

In one lineAn IP address finds the building (the computer). But one building has many rooms, that is, many apps. Each room's number is a port. So the full destination is "IP address plus port number": find the building, then the room inside. Common apps have well-known room numbers. Web is 80, secure web (HTTPS) is 443. An arriving packet reads the port number and enters that numbered room, that is, the right app.
Networks
Was this helpful? Support seegongsik