| |
|
How Web Servers Work
|
The
Internet | Clients and Servers | IP
Addresses | Name Servers | The
whois Command
The Basic Process
Let's say that you are sitting at your computer, surfing the Web, and
you get a call from a friend who says, "I just read a great
article! Type in this URL and check it out! It's at http://www.Sitewarehouse.com/how.html." So
you type that URL (Unique Resource Locator) into your browser and
press return. And magically, no matter where in the world that
URL lives, the page pops up on your screen!
At the most basic level possible, the following diagram shows the steps
that brought that page to your screen:
|
|
|
|
Your browser formed a connection to a Web server,
requested a page and received it. If you want to
get into a bit more detail, here are the basic
steps that occurred behind the scenes:
The browser broke the URL into three parts:
The protocol ("http")
The server name ("www.Sitewarehouse.com")
The file name ("/how.html")
The browser communicated with a name server to
translate the server name "www.Sitewarehouse.com" into
an IP Address, which it uses to connect to
the server machine.
The browser then formed a connection to the server
at that IP address on port 80. The number 80 represents
the path that is open on the server to accept requests
from other computers that are limited to the http
protocol.
Following the HTTP protocol, the browser sent
a GET request to the server, asking for the
file "http://www.Sitewarehouse.com/how.html." (Note
that cookies may be sent from browser to server
with the GET request -- see How Internet Cookies
Work for details.)
The server then sent the HTML text for the Web
page to the browser. (Cookies may also be sent
from server to browser in the header for the page.)
The browser read the HTML tags and formatted the
page onto your screen.
If you've never explored this process before, that's a lot of new vocabulary.
To understand this whole process in detail, you need to learn about
IP addresses, ports, protocols... The following sections will lead
you through a complete explanation.
|
The Internet
So what is "the Internet"? The Internet
is a gigantic collection of millions of computers,
all linked together on a computer network.
The network allows all of the computers to communicate with one another.
A home computer may be linked to the Internet using a phone-line
modem, DSL or cable modem that talks to an Internet
service provider (ISP).
A computer in a business or university will usually have a network
interface card (NIC) that directly connects it to a local area network
(LAN) inside the business. The business can then connect its LAN
to an ISP using a high-speed phone line like a
T1 line. A T1 line can
handle approximately 1.5 million bits per second, while a normal
phone line using a modem can typically handle 30,000
to 50,000 bits per second.
ISPs then connect to larger ISPs, and the largest ISPs
maintain fiber-optic "backbones" for
an entire nation or region. Backbones around the world are connected
through fiber-optic lines, undersea cables or satellite links (see
this page for a nice backbone and connection diagram). In this way,
every computer on the Internet is connected to every other computer
on the Internet.
|
|
|
| Clients and Servers
In general, all of the machines on the Internet can be categorized
as two types: servers and clients. Those machines that provide services
(like Web servers or FTP servers) to other machines are servers.
And the machines that are used to connect to those services are clients.
When you connect to Yahoo! at www.yahoo.com to read a page, Yahoo!
is providing a machine (probably a cluster of very large machines),
for use on the Internet, to service your request. Yahoo! is providing
a server. Your machine, on the other hand, is probably providing
no services to anyone else on the Internet. Therefore, it is a user
machine, also known as a client. It is possible and common for a
machine to be both a server and a client, but for our purposes here
you can think of most machines as one or the other.
A server machine may provide one or more services on the Internet.
For example, a server machine might have software running on it that
allows it to act as a Web server, an e-mail server and an FTP server.
Clients that come to a server machine do so with a specific intent,
so clients direct their requests to a specific software server running
on the overall server machine. For example, if you are running a Web
browser on your machine, it will most likely want to talk to the Web
server on the server machine. Your Telnet application will want to
talk to the Telnet server, your e-mail application will talk to the
e-mail server, and so on...
|
IP Addresses
To keep all of these machines straight, each machine
on the Internet is assigned a unique address
called an IP address. IP stands for
Internet protocol, and these addresses are 32-bit numbers, normally
expressed as four "octets" in a "dotted decimal number." A
typical IP address looks like this:
216.27.61.137
The four numbers in an IP address are called octets
because they can have values between 0 and 255,
which is 28 possibilities per octet.
Every machine on the Internet has a unique IP
address. A server has a static IP address that
does not change very often. A home machine that
is dialing up through a modem often has an IP address
that is assigned by the ISP when the machine dials
in. That IP address is unique for that session
-- it may be different the next time the machine
dials in. This way, an ISP only needs one IP address
for each modem it supports, rather than for each
customer.
As far as the Internet's machines are concerned,
an IP address is all you need to talk to a server.
For example, in your browser, you can type the
URL http://209.116.69.66 and arrive at the same
machine that contains the Web server fora site.
On some servers, the IP address alone is not sufficient,
but on most large servers it is -- keep reading
for details.
|
Name Servers
Because most people have trouble remembering the strings of numbers
that make up IP addresses, and because IP addresses sometimes need
to change, all servers on the Internet also have human-readable names,
called domain names. For example, www.Sitewarehouseing.com is a permanent,
human-readable name. It is easier for most of us to remember www.Sitewarehouse.com
than it is to remember 209.116.69.66.
The name www.Sitewarehouse.com actually has three parts:
The host name ("www")
The domain name ("Sitewarehouse")
The top-level domain name ("com")
Domain names are managed by a company called ICANN/InterNic.
ICANN creates the top-level domain names and guarantees
that all names within
a top-level domain are unique. NSI Inc. maintains contact information
for each site and runs the "whois" database on behalf of
ICANN/InterNic. The host name is created by the company hosting the
domain. "www" is a very common host name, but many places
now either omit it or replace it with a different host name that indicates
a specific area of the site. For example, in encarta.msn.com, the domain
name for Microsoft's Encarta encyclopedia, "encarta" is designated
as the host name instead of "www."
The whois Command
On a UNIX machine, you can use the whois command to look up information
about a domain name. You can do the same thing using the whois form
at www.internic.com. If you type in a domain name, like "Sitewarehouse.com," it
will return to you the registration information for that domain,
including its IP address.
A set of servers called domain name servers (DNS) maps the human-readable
names to the IP addresses. These servers are simple databases that
map names to IP addresses, and they are distributed all over the Internet.
Most individual companies, ISPs and universities maintain small name
servers to map host names to IP addresses. There are also central name
servers that use data supplied by ICANN to map domain names to IP addresses.
If you type the URL "http://www.Sitewarehouse.com/how.html" into
your browser, your browser extracts the name "www.Sitewarehouse.com," passes
it to a domain name server, and the domain name
server returns the correct IP address for www.Sitewarehouse.com.
A number of name servers may be involved to get
the right IP address. For example, in the case
of www.Sitewarehouse.com, the name server for the "com" top-level
domain will know the IP address for the name
server that knows host names, and a separate
query to
that name server, operated by the ISP, may deliver
the actual IP address for the Sitewarehouse server
machine.
So here it is: The Internet is made up of millions
of machines, each with a unique IP address. Many
of these machines are server machines, meaning
that they provide services to other machines on
the Internet. You have heard of many of these servers:
e-mail servers, Web servers, FTP servers, Gopher
servers and Telnet servers, to name a few. All
of these are provided by server machines.
|
| |
|
|
|
|