F
F
fir1st2014-04-07 01:43:02
System administration
fir1st, 2014-04-07 01:43:02

You typed the site address in the browser, pressed Enter. Tell us as much as possible about the technical processes taking place next?

The key word is maximum. The desire to know the depth. Thank you.

Answer the question

In order to leave comments, you need to log in

8 answer(s)
D
Deerenaros, 2014-04-07
@fir1st

Indeed, respected. That's too much. It is unlikely that I will touch on all the subtleties, but I will try to outline an approximate path:
0) The user drives the site address into the address bar of the browser (by pressing keys on the keyboard that close a certain track in the matrix, according to which the pressed key is determined, which is through the USB bus in some then the moment will be passed to the OS, where it will catch the HID driver and cause a certain interrupt, which the OS will pass as an event / or_else_how to the program, which will call the appropriate function from the window manager API, which will change the contents of the line and as a result, the UI element will sometime be redrawn , and if Enter was pressed, the next one will begin).
1) The browser will pull the query string from the input and see if it looks like an address. If so, it will add missing refinements (for example, http or file protocol, port, and similar pretty standard things). If not, it will most likely create a request to the default search engine (I will no longer go into such meaningless details as API calls, otherwise I will be typing this message for a VERY long time). In any case, we will essentially get the URL that we need to download at the output. We will not consider the file:// protocol, ftp is far from being everywhere, https:// is not enough for eternity, so let's stop at http, which is essentially tcp / ip by default on port 80 with a certain communication format.
2) Okay, there is a url. Now we need an address to contact. Since http is tcp/ip, we need an ip address. This is where dns servers help us. Usually, a normal provider installs dns cache servers that do not contact the responsible com-zone server a hundred times per vk.com. Let's not get distracted by how communication takes place there, if anything - here (the wiki is good because it often contains relevant links below). Let me just say that at the output we get the ip address (a).
3) Having an address, we can request a page. Actually, everything after the first slash is, as it were, parameters for the http server: which page to request, it is still not a telepath. Of course, one could cheat a little and send to read about tcp / ip , but there is alsoshared-hosting . We confine ourselves to mentioning it. Actually, a GET request is sent to the received address , which processes the server located at the received IP address.
4) The server, having received the address, starts parsing the string, slowly pulling the necessary data from the databases and settings, hundreds of scripts are executed, sometimes more than one hundred different requests are made to other servers (here, there are different types of metrics and different types of HADOOP , etc. .d.). After passing through scripts and templaters at the very end, we get an html page ready for use. The server will send it in the response (after the headers, of course).
5) This is where the fun begins. Having received the html page, the browser starts to terribly abuse the CPU, HDD and GPU, simultaneously devouring tons of RAM and garbage in swap. It's all because of the unrealistic to fully comply with the standards from the notorious w3c.org . To make it easier, many make crutches, like webkit , and some even slaughter it and cut their own standard with preference and gamblers(although it has gotten better lately). This is where hundreds of OS API calls, windows manager and other libraries like boost, qt or libpng start again. In the course of work, a layout is built in RAM, according to which something like a PDF (also strongly vectorial) is built, which, then, processed by fast shaders on the GPU, is displayed on the screen. Again, a lot is missing, but hardly anyone but the guy in the deer sweater is really interested in how GDI, DirectX, or OpenGL works.
6) Oh yes, we forgot about thousands of js scripts, millions of pictures and animations with cats, as well as such additional goodies as flash-player or java-weblets. In short, js, flash and java are virtual machines with a special architecture. They, virtual machines, are of course different (although flash and js are quite similar, still - ECMAScript is the same). JS is the most integrated inside the browser, it is also the slowest purely visually (because the last two have access to a fast GPU), although the fastest in parrots. The second is gradually dying out and is, like the third, a special shared library, which the browser somehow found out about and which feeds special content marked with a special html tag. The third has almost died and is found only occasionally or in some enterprise with a terrible legacy base.google . Because you can't even imagine how many there are. And in general, this topic is even more boring than GDI, DirectX and OpenGL, and a sweater with deer requires more glasses with thick glasses, giving a lot of patience and zadrostvo over matan. In short, in the case of JS, everything that was loaded into memory and does not think to be unloaded and forms a kind of tree - DOM, over which modifications take place using a special API. At the same time, before being executed, all JS code is compiled into native bytecode for the VM. The same is in general with the second and third, unless they have access to the DOM and organizing it is a matter of those crutches. Oh yes, I also forgot about Silverlight (or how it is written there), which died before it was born. Just like Java, it is alive in a serious enterprise, not stingy with not "cheap" MS support.
7) Well... And then the user clicks on the desired hyperlink and everything is new.
Behind the scenes were such crutches as ajax, websockets and other asynchronous heresy. With her, everything is a million times more difficult. And to the glasses with a sweater, you will also need ... and the devil knows what else they wear there. Oh well, I sincerely envy those guys (and girls) who understand this whole car. Whole. Because this is just the tip of the iceberg. Diluted with not the best memory and terrible Google.
PS Do not hit hard for grammatical and syntactical errors. Spellchecker ordered to live long, and 5 in the morning after all.
UPDATE
A good translation has been posted on Habr , giving some idea of ​​​​how the browser swears at memory and processor. Although very superficial,

S
Sergey, 2014-04-07
@edinorog

Watching who presses inter. Blonde or geek. The result, with the same actions, for some reason is always different =(

C
comAT0Zz, 2014-04-07
@comAT0Zz

All the depth, hmm. Well:
tools.ietf.org/html/rfc1034
tools.ietf.org/html/rfc2616

R
RUSgrigoryev, 2014-05-27
@RUSgrigoryev

www.html5rocks.com/en/tutorials/internals/howbrows...

A
Andrew, 2014-04-07
@kaasius

Dear TS. You have touched on a topic for which there is simply not enough space and time in the Q&A format. You should delve into the documentation first, all the necessary standards are easily searched on Google. Otherwise, you can reach the "depth" at which electrons run along the wires and carry charges. You should not ask absurd questions if you do not want the answer to bring the situation to complete absurdity.

I
Ilya Grom, 2014-04-07
@Gromobanan777

I remembered , but what you were specifically interested in was already given above.
Read the habr and good luck on the interview :)

V
Vlad Zhivotnev, 2014-04-07
@inkvizitor68sl

You are talking to the administrator, I suppose? Or to hosting support...
Read about how DNS and http work.

V
vikarti, 2014-04-11
@vikarti

habrahabr.ru/post/152593

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question