How you surf the Internet
Have you ever wondered how the Internet works? It's not that hard, but it is still interesting.
All starts with a computer. You turn your computer on and connect it to the Internet; and what your computer does is to 'negotiate' or request an IP address for itself. An IP address is a unique number the computer uses to identify itself, and to be identified over a network.
Once the computer has received an IP address, you are connected, and you can use a web browser to surf the Internet. To see this site, for example, you type //heptagrama.com, and wait for a few seconds. Although modern browsers know most web addresses start with a call for what it is known as the HTTP protocol, and will complete that first part for you.
After pressing enter or clicking to go, your browser will use a signal to request the web page you are trying to see. It's something like this:
First, the browser talks to the operating system:
Browser: —Hey! I am being asked to display Heptagrama.com.
Operating System: —OK; then use the Internet connection to go.
Once online, the request will travel through the connection until meeting a first centre of requests. This is called a router, and will be provided by your ISP. Once there, your request will ask the same question:
Request: —Hey! I am being asked to display Heptagrama.com.
Router: —OK, hold a nanosecond, please.
During that wait, the router will check its tables, and look for Heptagrama. If it knows where it is, it will send the request there directly; if not, it will have to go to a larger central.
Request: —Hey! I am being asked to display Heptagrama.com. Do you know where is it?
Central: —mm... Yes, the domain name is assigned to the IP address 200.123.456.789 (it's a fictitious number, don't try it), you need to go there.
Request: —Thank you!
Once at the indicated address, the request will ask the following:
Request: —Hello. I am being asked to display Heptagrama.com. Is it there?
If no, the server will reply with an error message.
Server: —No, I can't find it. Take the default error page of this server, and display that.
That is called a 404, not found, error page.
If yes, the server will read the file and have, with the request, the following conversation:
Server: —So you were asked to display Heptagrama.com. Here I have it. Are you ready to go?
Request: —Yes, I am.
Server: —First question, then. Does your browser support Gzip compression?
(Almost all browsers support and use Gzip compression these days.)
Request: —Yes, it does.
Server: —OK, then I'm sending you the file compressed. Take it.
Request: —Great, thank you... but this file is asking me to request a few other things.
Server: —Which things?
Request: —A couple of photos, and some scripts too.
Server: —Do you have them already?
Request: —Let me see in the browser cache... mm... I have the logo only. Has it changed since the last time I was here?
Server: —When was that?
Server: —No, it hasn't changed. You can use it again.
Request: —Are all the other files in this server?
Server: —Most are...
Request: —Then give me the files which are on this server.
Server: —I'll give them to you. For the other files, you will need to travel to the other servers to get them. Good luck, amigo!
Request: —Thank you!
Server: —You're welcome.
Needless to say, this conversation happens in fractions of a second. The browser will follow your command and look for the location of the web page you are asking it to display (with the help of central computers called routers, which have long tables stating where each website is). Once it has found the location, the request will travel there and ask the server if the file is still there. If the answer is yes, it will start downloading the file, and any additional file it needs to complete the user's request; if not, it will return the user an error page. Once it's finished with all the necessary downloads, it will show you the page, and wait until your next command.
Interesting, isn't it?
Computers + Online