can somebody tell me what all happens behind the scenes from the time I type in a URL in the browser to the time when I get to se the page on the browser? A detailed account of the process would be of great help
Look up the specification of HTTP. Or to get started, try http://www.jmarshall.com/easy/http/
First the computer looks up the destination host. If it exists in local DNS cache, it uses that information. Otherwise, DNS querying is performed until the IP address is found.
Then, your browser opens a TCP connection to the destination host and sends the request according to HTTP 1.1 (or might use HTTP 1.0, but normal browsers don't do it any more).
The server looks up the required resource (if it exists) and responds using HTTP protocol, sends the data to the client (=your browser)
The browser then uses HTML parser to re-create document structure which is later presented to you on screen. If it finds references to external resources, such as pictures, css files, javascript files, these are is delivered the same way as the HTML document itself.
In an extremely rough and simplified sketch, assuming HTTP:
- browser checks cache; if requested object is in cache and is fresh, skip to #9
- browser asks OS for server IP address
- OS makes a DNS lookup and replies to browser
- browser opens a TCP connection to server (this step is much more complex with HTTPS)
- browser sends the HTTP request through connection
- browser receives HTTP response and may close the TCP connection, or reuse it for another request
- browser checks if the response is a redirect, authorization request, etc.; this is handled differently from normal responses
- if cacheable, response is stored in cache
- browser decodes response (e.g. if it's gzipped)
- browser determines what to do with response (e.g. is it a HTML page, is it an image, is it a sound clip?)
- browser renders response, or offers a download dialog for unrecognized types
Again, discussion of each of these points have filled countless pages; take this as a starting point. Also, there are many other things happening in parallel to this (processing typed-in address, adding page to browser history, displaying progress to user, notifying plugins and extensions, rendering the page while it's downloading, etc.).