Wednesday, October 12, 2016

How web works - simplified



Internet, is network of computers, from outside it looks very complex but internally it works on few simple principles. Here principles I mean standards/protocols like HTTP, TCP/IP, html and also laws of electromagnetism (in simple, its law of light. it’s very important for internet, because all of the data will be travelling near to speed of light otherwise internet will be very slow. Trick here is whatever web request or response will be converted into binaries and send them via wave pattern inside optic cables)

Before I explain components of web. I just like to mention how standards or protocols helps to develop such complex systems. Standards like HTTP is nothing but a few set of rules on which two system will interact seamlessly because both the system know what is the rules/standard/language. For ex: when traffic signal light is red we stop, green go. Same way web browser and web server both have knowledge about HTTP and its language.

So basically when you click on a link on web browser, it talks to a remote web server and gets back the data what you have asked for and displays it on browser.

Following are the key components of the web, together they make internet work. Each one of them is big enough to accommodate a book or more. So I will try to explain each one briefly and hope easy to understand. Actually there are lot more components like DNS, OSI models, Firewall, and others involved in to make internet work but for us to understand how web works below items are good enough.

HTTP, Transport Layer (TCP/IP), Web Server, ISP, Browser, HTML5 (structure),
CSS3 (presentation), JavaScript (interactivity)

Browser: First thing first, browser is a software/window to internet through which user browse the web. How can it talk to remote server, get data like text, picture, video, and display? Answer is HTTP, html … Browser is a software/program built on standards/protocols like http, html, css, javascript.  For ex: when browser sees content like make me bold it render/display like “make me bold”, so it’s nothing rocket science. All the standards or rules of http, html… are already coded inside software to how to display text, make calls remote server, etc.

HTML, CSS, JavaScript: these are language of web. HTML is for structuring the data, CSS to present the data and JavaScript for interaction or behavior. Just html is enough for to display data but it will very dull and boring. To give life to web CSS, JS came to existence. When Tim (legend) invented the web he just thought to link the documents and access it over network (I am simplifying itJ). He had no idea one day web will explode so big like what we see today.

HTTP: hypertext transport protocol, is an application protocol. Web browser/client sends http request to web server and web server returns http response and content as html. HTTP has specified different way to request and response. Here are the http methods : HEAD, GET, POST, PUT, DELETE, TRACE … don’t worry if you don’t get it, these are verbs or actions clients request to server for ex: HEAD means header of http request/response, GET means get a resource from web server, POST means get or create a list of resource in the server. So this is how server know how to respond if any request comes from client.

TCP/IP: Transporting of http bundle to web server involves lot of behind the scene actors like OSI models ( its seven layer of network,  it defines how data will travel from your computer to Ethernet to cable to computer next to you or other side of the world). But in that layer TCP/IP is important for us to understand how http request will be get pocketed, addressed, transported and received.  This layer is very important because activities like 3 way handshake and other connection establishment all this will happen less then fraction of second. (Thanks to speed of lightJ)

ISP: is network of thousands of miles fiber optic cable, spread across intercontinental or via satellite. Its organization provides internet access. Through which all your web request and response will travel.

Web Server: As name says its serve the web request. The server is just a software not the computer. Like web browser, server is also a program coded to understand HTTP methods and respond accordingly to http request. Basically server will respond with documents, images, videos, etc. Web server may be right next door or across ocean.


Summary: Web/internet is very exciting place. Its part and parcel of our life now. Its topic of worth many books, but I just thought briefly dot the maps and present brief idea about web to users. I might have missed to explain few points or explain in more detail, it’s just because to simplify. Thanks!