Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Assignment 03

Title: World Wide Web(WWW) Message Format

Step 1: Parsing the URL


 A URL is typed into the address bar of a web browser.

 Url is a human readable alias for an IP [Internet Protocol]address. Its matching IP address is a
unique number sequence identifying a target server called Host.

 The browser checks for the IP in its browser cache. If not found, it send a request to DNS.

 DNS [Domain Name System/Service/ Servers]: It is a comprehensive directory network


translating domain names into its unique IP sequence.

 The browser parses the URL to find: the •protocol type, •host, •port, and •request-URI path.

 The browser forms a HTTP request:

 e.g. • "GET /URI HTTP/1.1" • Host: www.google.com


 GET: A token indicating the method to perform on the resource identified from the Request-
URI.
 Host header: it is included with the request incase the server is hosting multiple sites, that
way it will identify which one to serve back.

Step 2: Sending the request


 A socket connection is opened from our user’s computer to the IP address.

 HTTP request is sent to the host & the machine waits to get a response back.

 Web server receives the request.

Step 3: The server response


 Host checks for more information to process the request: • headers, • GET, POST, PUT,... methods.

 For static requests:


 The server locates the html filename & sends that file back over the internet.
 for dynamic requests:
 .php, .asp, .aspx, .jsp files, are processed by a separate engine. These will be partially
complete, containing changeable sections depending on variable values given to the page
on the server end. The dynamic data & the requested file will be combined into a long
string of text ( HTML, txt, XML) before its output is sent back over the internet.
 If successful, the server returns a 200 status code (as the resource was found), response headers, and
the requested data back to the browser. 

 If the server fails to process or complete the request, it returns an 404 error message instead.

Step 4: Browser rendering:


 The browser receives the response with a html document to parse into a DOM [Document Object
Model]. For this, it translates html elements & attributes into nodes with the "Document Object" set as the
root of the tree.

 When external script, image, style sheets are parsed, new requests are made to the server.

 When style sheets are parsed, each applicable styles gets attached to the matching node in the DOM
tree.

 JavaScript files are parsed & executed.

 HTML5 adds an option to mark the script as asynchronous so these will be parsed &
executed by a different thread.
 This way the page rendering is not halted.
 DOM nodes are updated.
 Note: Firefox innately blocks scripts rendering while stylesheets remain un-loaded.

 In parallel to the DOM tree being constructed, the browser constructs a "render tree" of "frames" or
"render objects". This is the visual representation of the node elements.

 The browser renders the page. The page is viewable & interact-able.

Step 5. HTTP persistent connection


 'Connection: Keep-Alive' header.

 This initiates a single TCP [Transmission Control Protocol] connection for sending &


receiving multiple HTTP requests / responses, instead of opening a new connection for every
single request / response pair.
 It is set from the initial browser request header, and informs the server to not drop this
connection. When the client sends another request, it uses the same connection. This will
continue until either the client or the server decides to drop the connection.

You might also like