seems as easy as typing a URL into the address bar.
When you hit enter, your request is sent through a series of special computers
called routers
to the website's numerical address on the Internet,
also known as its IP address.
There, a computer sends the website back to you to display it on your screen.
But with over a billion websites out there,
how does your computer find the right address almost instantaneously?
Many computers on the Internet, including your own device,
store a routing table of internet addresses,
as well as the best-known paths through the Internet's routers
to these addresses.
Your computer's routing table may store
the paths for up to a few thousand websites you've accessed recently.
If you request a website that isn't in your computer's routing table,
your computer asks a designated router to find a path.
If that router doesn't know either,
it will ask yet another router, and so on.
Once the path is finally determined,
your computer will likely store this path into its routing table for a while.
That way, if you request the same website again,
it'll know exactly how to reach it, saving lots of time.
But finding the right route within your device's routing table
isn't so simple.
A linear search looking through the entries from start to finish
until the requested website's route is found
could be quite slow,
longer than a minute in certain cases.
Other common search techniques are faster, but still not fast enough.
So instead, computers usually use a method that can be 1000 times faster
than a linear search.
They store internet addresses in a special order called a hash table.
The computers then use a calculation called a hash function
to convert the requested website's address and some related information
into a number indicating its place in the table.
Then when they need to find the website again,
they can go straight to the right place in the table,
not spending even an instant looking at any irrelevant entries.
How does this work?
A simple hash function for our routing table with 256 entries
would be to look at the first three digits of the requested internet address,
which range from 000 to 255.
If it's 000, store the address in the first row of the table.
If it's 001, use the second row, and so on,
up to 255 in the last row.
But what if the addresses of the last several websites you requested
all start with the same three digits?
If you stored that whole list into the same row of the routing table
and later requested one of those websites,
you'd then have to search through many irrelevant addresses
to find the one you want.
So to spread internet addresses more evenly across a routing table,
more sophisticated hash functions are used.
One example is to hash the last six digits of addresses,
which are more likely to vary than the first three
in a much larger routing table.
There are many different types of hash tables.
They all have the same basic technique in common though.
Each does a calculation to place different addresses into different buckets
which are easy to look up later.
The speed these hash tables lend your web surfing
isn't the same as your connection speed.
Connection speed determines how quickly the content on the websites you visit
will load and display.
Instead, well-designed hash functions make it so you don't have a long delay
waiting to find the right website,
keeping the information super highway from becoming a traffic jam.