When you enter something like www.gmail.com into our browser. The browser http request goes to the server(DNS). If the server accepted the clients request, it start to sending all related files to browser and browser renders that files to your computer.
In addition to the client and the server, we also need to understand below terms:
Your internet connection: Allows you to send and receive data on the web. It's basically like the street between your house and the shop.
• TCP/IP – Transmission Control Protocol and Internet Protocol
Transmission Control Protocol and Internet Protocol are communication protocols that define how data should travel across the web. This is like the transport mechanisms that let you place an order, go to the shop, and buy your goods. In our example, this is like a car or a bike (or however else you might get around).
• DNS: Domain Name Server
Domain Name Servers are like an address book for websites. When you type a web address in your browser, the browser looks at the DNS to find the website's real address before it can retrieve the website. The browser needs to find out which server the website lives on, so it can send HTTP messages to the right place. This is like looking up the address of the shop so you can access it.
• HTTP: Hypertext Transfer Protocol
Hypertext Transfer Protocol is an application protocol that defines a language for clients and servers to speak to each other. This is like the language you use to order your goods.
Step 1 : When you type a web address into your browser (for our analogy that's like walking to the shop).
Step 2 : The browser goes to the DNS server, and finds the real address of the server that the website lives on (you find the address of the shop).
Step 3 : The browser sends an HTTP request message to the server, asking it to send a copy of the web page to the client (you go to the shop and order your goods). This message, and all other data sent between the client and the server, is sent across your internet connection using TCP/IP.
Step 4 : If the server approves the client's request, the server sends the client a "200 OK" message, which means "Of course you can look at that website! Here it is", and then starts sending the website's files to the browser as a series of small chunks called data packets (the shop gives you your goods, and you bring them back to your house).
Step 5 : The browser assembles the small chunks into a complete website and displays it to you (the goods arrive at your door — new shiny stuff, awesome!).