How Does Your Browser Know Where to Go? from the September 2001 Actrix Newsletter
by Rob Zorn
The Internet can be a mind-boggling thing. When you type
a web address into your browser you soon find yourself connected to another computer that
could be anywhere. It's quite amazing to consider that the page you are reading is hosted
somewhere in The United States, Denmark, Swaziland, or Brazil. Have you ever wondered how
your browser is able to find web sites hosted in far off corners of the world?
What follows is a brief and simplified explanation. The processes can get complex, and
there are lots of different ways to achieve the same result, so I'll keep it simple and
general.
Step One occurs when you dial in to Actrix. The Actrix modem and yours squeal at each
other for a few seconds in order to make sure they understand each other, and can agree on
how to communicate. At the point where they go silent, the Actrix modem is instructing
your computer as to where various pathways to information are. Your dial up networking
program is given this information each time you connect and remembers it for the duration
of your online session.
We need to pause for a second or two here in order to be sure we understand what IP
addresses are. Humans like names and words. If we want a site, we like to type in an
address we can relate to such as www.actrix.co.nz or www.yahoo.com. Computers don't like words. They would rather deal
with numbers. So, every web address has an IP (Internet Protocol) address behind it. For
example, the IP address for Actrix is 203.96.22.1. The IP address for Yahoo is
204.71.200.67. Try typing these numbers into your browser (without the full-stops at the
end) and they will bring up the required pages just as easily as the web addresses do. An
IP address consists of a set of four numbers, each separated by a "dot" or
full-stop. Each time you connect to the Internet, Actrix assigns your machine with an IP
address too. Every machine connected to the Internet has to have one. If you'd like to
learn a little more about how IP addresses work, you could try this article written by
Dean Moor for the September 2000 newsletter: http://editor.actrix.gen.nz/byarticle/hacking01.htm.
Step Two: One of the most important things your computer is told when you connect is where
to find the Actrix name server. Every ISP has two or more name servers that hold lists of
web addresses (such as www.yahoo.com) and their corresponding
IP addresses (such as 204.71.200.67). When you type www.yahoo.com
into your browser and hit enter, your computer immediately connects to the Actrix name
server and asks it for the IP address that corresponds to www.yahoo.com.
If the Actrix name server knows, it gives you back "204.71.200.67" right away.
If it doesn't know, it asks another server for the answer. If that server doesn't know, it
asks another one until one name server pops up that knows the answer. The answer is then
passed back down the line and given to your computer. All this usually takes just
milliseconds. Servers are smart enough so that they usually don't have to ask another
server at random. The server will examine your request for a clue as to what would be the
best server to ask next. If the web address you wanted ended in ".com.au" for
example, the name server would at least recognise that as an Australian address, and
therefore it would ask for help from an Australian name server it knows.
Step Three: Okay, so you've typed an address into your browser. Your computer has asked
the Actrix name server for the IP address of that site and the Actrix name server has
given it to you (possibly needing to ask a series of name servers around the world first).
Probably not much more than a few seconds have gone by. Another important thing that
happens while you are connecting to Actrix, is that your computer is connected to the
Actrix terminal server. The terminal server is the one that knows the pathways to sites
around the world, or who can find them out for you. Your computer gives the terminal
server the IP address it wants. If you typed www.yahoo.com
into your browser, then you'll be giving the Actrix terminal server the IP address
204.71.200.67.
Two things could happen here. If the Terminal server knows the pathway to the site with
the IP address you have requested, it will simply set off and download the page so that it
can "serve" it to your computer for browser display. This may involve hops
through up to a dozen or more computers or servers around the world between you and the
server which hosts the page you want. If the site is reasonably local, the terminal server
will almost certainly know where to find it. However, if the site is far away, or if for
any other reason the Actrix terminal server does not know the path to the site you have
requested, then it will pass you through its "default gateway" to a router which
it hopes will know the way. This router will look through its enormous "routing
table" to try and find the path to the requested site. If it finds the right path, it
will pass you on to the next computer in line. If it can't find the site anywhere in its
routing tables, it will pass you on to another router. This process will go on until one
of the routers, somewhere in the world, finds the needed site in its routing table. That
router will then send your request off along the right path. Again, this seems like it
should take ages, but it all occurs within milliseconds.
As your request travels ("hops") from computer to computer across the Internet,
a record is kept along the way of who you are (your IP address) and where you came from.
When your request finally reaches the destination site, the web server there will
"serve you" the page by sending it back to you across pretty much the same path
you took to get there. Knowing this helps one understand just how much the Internet is a
co-operative system. Public and private Servers all around the world, even from rival
companies within the same country, are working together to make it all possible.
So that's it in a very simple nutshell. Of course I missed out or glossed over a whole lot
of complicated stuff, but this should be enough to give you a rough idea of what is
happening behind the scenes when you're surfing the net. If you'd like to find out more,
you may be interested in another "layman's terms" article from the May 2000 Newsletter
entitled "What
Happens When I Click Connect?"