Friday, October 24, 2008

How the web works

Every computer that is connected to the Internet is given a unique address made up of a series of four
numbers between 0 and 256 separated by periods—for example, 192.168.0.123 or 197.122.135.127. Thesenumbers are known as IP addresses. IP (or Internet Protocol) is the standard for how data is passed
between machines on the Internet.
When you connect to the Internet using an ISP you will be allocated an IP address, and you will often be
allocated a new IP address each time you connect.
EveryWeb site, meanwhile, sits on a computer known as a Web server (often you will see this shortened to
server).When you register aWeb address, also known as a domain name, such as wrox.com you have to
specify the IP address of the computer that will host the site.
When you visit aWeb site, you are actually requesting pages from a machine at an IP address, but rather
than having to learn that computer’s 12-digit IP address, you use the site’s domain name, such as
google.com or wrox.com.When you enter something like http://www.google.com, the request
goes to one of many special computers on the Internet known as domain name servers (or name servers, for
short). These servers keep tables of machine names and their IP addresses, so when you type in
http://www.google.com, it gets translated into a number, which identi?es the computers that serve
the GoogleWeb site to you.
When you want to view any page on theWeb, you must initiate the activity by requesting a pagea defaultWeb page). The browser asks a domain name server to translate the domain name you
requested into an IP address. The browser then sends a request to that server for the page you want,
using a standard called Hypertext Transfer Protocol or HTTP (hence the http:// you see at the start of
manyWeb addresses).
The server should constantly be connected to the Internet—ready to serve pages to visitors.When it
receives a request, it looks for the requested document and returns it.When a request is made, the server
usually logs the client’s IP address, the document requested, and the date and time it was requested.
An averageWeb page actually requires theWeb browser to request more than one ?le from the
Web server—not just the XHTML page, but also any images, style sheets, and other resources in the
page. Each of these ?les, including the main page, needs a URL (a uniform resource locator)t o
identify it. A URL is a unique address on theWeb where that page, picture, or other resource can be
found and is made up of the domain name (for example, wrox.com), the name of the folder or
folders on theWeb server that the ?le lives in (also known as directories on a server), and the name
of the ?le itself. For example, theWrox logo on the home page of theWroxWeb site has the unique
address wrox.com/images/mainLogo.gif and the main page is wrox.com/default.html. After
the browser acquires the ?les it then inserts the images and other resources in the appropriate place to
display the page.using your browser (if you do not specify a speci?c page, theWeb server will usually send a defaultWeb page). The browser asks a domain name server to translate the domain name you
requested into an IP address. The browser then sends a request to that server for the page you want,
using a standard called Hypertext Transfer Protocol or HTTP (hence the http:// you see at the start of
manyWeb addresses).
The server should constantly be connected to the Internet—ready to serve pages to visitors.When it
receives a request, it looks for the requested document and returns it.When a request is made, the server
usually logs the client’s IP address, the document requested, and the date and time it was requested.
An averageWeb page actually requires theWeb browser to request more than one ?le from the
Web server—not just the XHTML page, but also any images, style sheets, and other resources in the
page. Each of these ?les, including the main page, needs a URL (a uniform resource locator)t o
identify it. A URL is a unique address on theWeb where that page, picture, or other resource can be
found and is made up of the domain name (for example, wrox.com), the name of the folder or
folders on theWeb server that the ?le lives in (also known as directories on a server), and the name
of the ?le itself. For example, theWrox logo on the home page of theWroxWeb site has the unique
address wrox.com/images/mainLogo.gif and the main page is wrox.com/default.html. After
the browser acquires the ?les it then inserts the images and other resources in the appropriate place to
display the page.

No comments: