Hardware Reference
In-Depth Information
Figure 3-5
The path from a website to your
browser. Although the physical
computers are in many different
locations, that doesn't matter as
long as you know the websites'
addresses.
Website's
server
Website's
network
provider
Internet
Website's
network
provider
Your
Network
provider
Your cable
or DSL
modem
Your
Computer
Your router
Website's
server
The server computer shares its IP address with every
server program running on it by assigning each program
a port number . For example, every connection request
for port 80 is passed to the web server program. Every
request for port 25 is passed to the email server program.
Any program can take control of an unused port, but only
one program at a time can control a given port. In this way,
network ports work much like serial ports. Many of the
lower port numbers are assigned to common applications,
such as mail, file transfer, telnet, and web browsing. Higher
port numbers are either disabled or left open for custom
applications (you'll write one of those soon). A specific
request goes like this:
4. The browser program asks for a specific file name,
index.html.
5. The server program looks up that file on its local file
system, and prints the file out via the connection to the
browser. Then, it closes the connection.
6. The browser reads the file, looks up any other files it
needs (like images, movies, style sheets, and so forth),
and repeats the connection request process, getting all
the files it needs to display the page. When it has all the
files, it strips out any header information and displays
the page.
All the requests from browser to server, and all the
responses from server to browser (except the images and
movie files), are just strings of text. To see this process
in action, you can duplicate the request process in the
terminal window. Open up your terminal program again,
just as you did for the ping example shown earlier (on
Windows 7, use PuTTY).
1. Type http://www.makezine.com/index.html into your
browser.
2. The browser program contacts www.makezine.com on
port 80.
3. The server program accepts the connection.
 
Search WWH ::




Custom Search