seegongsik
Saved words
Networks

How a packet finds its way: routing

Remember how a letter passed through middle post offices to be delivered? But at each fork, how does a post office decide where to send it next? No one in the center gives orders one by one. Each station picks the way on its own. That is routing.

01

Choosing at a fork

A letter went through middle stations.
But when it arrives at one station,
there isn't just a single road out.
Often there are several neighbor stations.
So which station do you hand it to next?
Choosing that is where routing begins.
On the internet this station is called a router.
Below, pick the next station yourself.

SABCD
here now: Sdestination: D
Tap a blinking neighbor to hand the packet on

Tap one of the neighbor stations to hand the packet on. (Station = router · tap = pick the next station)

One handoff and the packet went to a neighbor.
At that station another fork shows up.
Handing it on station by station like this,
it reaches the destination in time.
But if you pick just any neighbor,
it can loop around to the wrong place.
So each station needs a basis.
What it looks at to choose, we see next.

02

Reading the routing table

Each station holds one small table.
It is a routing table.
Each row in the table says this:
"To reach that destination, hand it to this neighbor."
So when a packet arrives,
the station looks at the destination address,
finds that row in the table,
and hands it to the next station as written.

Station R's routing table
DestinationNext
Tap a destination row to look up the next station

Tap a destination row to look up who to hand it to next. (Table = routing table)

With the table, the station never wanders.
Wherever the destination is,
finding that row settles the next single step.
The key is that a station does not need
to know the whole path.
It only needs "to whom, right next."
The rest the next station continues with its own table.
Small tables chained together make a long road.

03

Picking the fastest way

There isn't only one way to a destination.
There is the long way and the shortcut too.
So which way does the table write down?
The fastest way, of course.
We have seen this before.
Finding the shortest distance over dots and lines,
that very fastest-way search
is used right here in routing.

67324STUVD
Tap both ways to compare total distance

Tap both ways to compare distances. The shorter one is what the table records. (shortest path again)

Pick the short way and write it in the table,
and from then on packets to that destination
flow down the fast way on their own.
So routing does two jobs.
One is finding the fastest way to build the table,
the other is handing packets on by the table when they come.
The former is the shortest path you learned in algorithms,
the latter is choosing at a fork.

04

There is no central tower

Here comes the most surprising part.
There is no central tower directing all of this.
Nowhere is there "someone holding the whole map."
Each station looks only at its own table
and decides its next single step on its own.
This is called being distributed.
Not one center deciding everything,
but countless stations judging, share by share.

SMND
Tap station M to fail it

Tap a station to make it fail. Under central control the way breaks, but distributed the others find a detour.

Even with one station down, the way didn't break.
The neighbor stations fixed their own tables
and detoured by another road.
If a single central tower
had been deciding everything,
the moment that tower stopped, all would stop.
Being distributed, even if one place dies
the whole keeps living and moving.

05

Wrap-up

Let's gather routing into one line.
A packet finds its way handed station to station.
Each station reads a routing table
and picks who to hand it to next.
The table records the fastest way.
There is no central tower.
It is a distributed system where each station decides on its own,
so even if one station stops, the letter keeps going by a detour.

Click the key points of routing in order to wrap up

Tap the key points in order to wrap up. (choose at a fork → routing table → fastest way → distributed, no center)

Here lies the secret to why the internet rarely breaks.
It didn't entrust everything to one center.
Countless stations each read their routing table
and hand packets on by the fast way.
When somewhere is blocked, another station finds a detour.
Small decisions gather
into a vast road linking the whole world.
That is how a packet finds its way.

In one lineRouting is finding the way by handing a packet from station to station all the way to its destination. Each station (router) reads a routing table. For each destination it says who to hand the packet to next. If there are several ways, it picks the fastest one. The most important thing is that there is no central control tower. Each station decides on its own. So even if one station goes down, the others find a detour and the letter keeps going. Thanks to this being distributed, the internet rarely breaks.
Networks
Was this helpful? Support seegongsik