Тёмный

What happens when you type google.com into your browser and press enter? (Detailed Analysis) 

Hussein Nasser
Подписаться 413 тыс.
Просмотров 124 тыс.
50% 1

In this video I want to go through what really happens under the hood when you type google.com and you hit enter in a browser. This is inspired by alex’s github page below, it is a great detailed description of what happens. I did however add more details to certain areas and I removed some stuff like keyboard events and low level operating system like that. So if you are interested stay tuned!
Alex Github page
github.com/alex/what-happens-...
Chapters
0:00 Intro
1:54 Initial Typing
3:00 URL Parsing
7:40 DNS Lookup
19:15 TCP Connection
24:19 TLS, ALPN. SNI
33:38 First GET request
40:00 HTML Parsing
initial Typing
As you type g the browser will attempt a search and display an auto complete result of the previously visited sites
Some browser does an actual search using the default configured search engine we will skip that part. This will have he same effect as next steps
URL PARSE
As you complete the phrase google.com and hit enter , the browser will parse and will figure out whether this is a url or a search term . It is a url so it will attempt to visit the website google.com
HTTP or HTTPS? Determine the port
The next step is to determine which protocol to use HTTP or HTTPS? to know that there is a protocol called HSTS list and we made a video about that tech. It is a local list of websites that only need to communicate with HTTPS. Google.com is in the HSTS list so we will use HTTPS so we now know the port is 443! We need to figure out the IP address so we can establish the connection
DNS Lookup
TO find out the IP address we do a DNS look up .first we ask the operating system, because the domain could be cached, we find that its not . The OS then looks through the hosts file and see if there is a n hardcoded entry , there isnt ..
Next the browser check if DoH is enabled DNS over HTTPS if yes then it communicate with the DNS provided (e.g cloud flair and ask for DNS) thats another TLS connection assume we are not using DoH The we establish an insecure UDP request to port 53 on the default DNS Configured on our router (could be 8.8.8.8 or 1.1.1.1) that in itself is a connection so we need to send the packet..
TCP connection
We know the IP we know the port! we can now establish a connection, we also know that we should also do TLS since its HTTPS and our client is smart enough to do TLS 1.3 so we will first do 3 way handshake and establish a TCP connection between 10.0.0.2 port random 1234 and 4.1.2.3 port 443
TLS, ALPN, SNI
Assuming I’m using the latest browser so it supports TLS 1.3 and my server also supports TLS 1.3, next is Client Hello. Client generates a public and private key, merges public and private key in DH sends out public and merged keys which cannot be broken in a client hello. It also sends the supported cipher suits (supported for symmetric key algorithms) If TLS extensions are enabled such as ALPN & SNI the client also sends in the same request the host name google.com in the TLS client hello along with the fact that it actually supports HTTP2 (this might be different in Chrome since it uses HTTP/2 over UDP or QUIC)
First Request GET/
The client is now ready to send an actual HTTP data, so it builds header GET / since that is what we want to send, puts the hostname in the header and other stuff, checks if there are cookies and puts them, the whole thing is compressed and sent as a binary format. The data is then encrypted with the TLS symmetric key and sent..
The get request is then streamed into the HTTP/2 tcp connection and sent to the server.
HTML Parsing
Make multiple requests css? JS? Multiple streams?
If H1 then pipeline?
🛰 Network Engineering Videos
• Network Engineering
🏰 Load Balancing and Proxies Videos
• Proxies
🐘 Postgres Videos
• PostgresSQL
🚢Docker
• Docker
🧮 Programming Pattern Videos
• Programming Patterns
🛡 Web Security Videos
• Web Security
🦠 HTTP Videos
• HTTP
🐍 Python Videos
• Python by Example
🔆 Javascript Videos
• Javascript by Example
Support me on PayPal
bit.ly/33ENps4
Stay Awesome,
Hussein

Наука

Опубликовано:

 

6 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 140   
@hnasr
@hnasr 6 месяцев назад
If you enjoyed this video check out my fundamentals of backend engineering course backend.win
@ishandhar2851
@ishandhar2851 3 года назад
Beautiful explanation. This channel is heaven for ppl like me, looking to know a whole of things at a fundamental level. Keep Rocking 👍👍
@PrinceKumar-hh6yn
@PrinceKumar-hh6yn 2 года назад
Yeah Fundamentals ✨💕👌👌
@khaingkhanthtun
@khaingkhanthtun 3 года назад
Thank you so much, I am a student/beginner at software engineering and I am enjoying your content of explaining the fundamentals as well as linking them elegantly with the coding + software part. I might even argue there’s not a lot of content like this out there. Keep up the work sir.
@Girry_
@Girry_ 3 года назад
Hi Hussein. I'm from Kenya. You're making me a better engineer day by day. Discovered your channel a few days ago and I always want to watch and learn something every day. I've never stuck to a specific tech channel this tight before. Be blessed! Thank you!
@HarshKapadia
@HarshKapadia 3 года назад
What a brilliant video, Hussein! Thank you so much! This combines all the concepts in one video and it is such a good way to consolidate everything!
@SyedHaris007
@SyedHaris007 3 года назад
I have been searching for this question from the day interviewer asked me this. but Believe me, it is the best explanation on the internet so far. 💕
@gavinlindridge
@gavinlindridge 4 года назад
I'm just starting to work my way though your content, and I have to say I love your teaching style. Alot is still going over my head but I'll get there! Appreciate the work.
@hnasr
@hnasr 4 года назад
Thank you so much Gavin! Let me know how can I improve and make the content more digestible. Any ideas welcome 🙏
@pratiknayak2009
@pratiknayak2009 2 года назад
One of the best videos on the internet for this topic. I come here every single time to refresh my concepts and damn! Its just crazy. Kudos to you Hussein!
@pranjalagrawal9083
@pranjalagrawal9083 3 года назад
This channel is gold. Its been 2 days i have been consuming your content and i ve already learnt so much. I am pretty sure m going to see almost all your playlist in the coming days. Thank you for this knowledge.
@hnasr
@hnasr 3 года назад
Thank you Pranjal!! ❤️😊🙏 enjoy the content
@antelope6826
@antelope6826 Год назад
I don’t always watch 45-minute videos on YT, but if Hussein makes one I definitely will 😎. Love your in-depth explanation of the web request process!
@shikhaphogat1462
@shikhaphogat1462 3 года назад
Want to take a day just to say you thankyou.. Because this channel has everything that L2-L7 networking requires. I feel I can do my interview preparation just by these videos
@paraschugh3365
@paraschugh3365 Год назад
Man, this guy knows what a "Detailed Analysis" is. Fabulous Video.
@kevalbhogayata1942
@kevalbhogayata1942 3 года назад
Always wanted to make a video on the exactly same concept, but was not aware about the details of the process. Thanks man, Hats off!
@faadi4536
@faadi4536 2 года назад
Hey Hussein, I am working as a DevOps and have 1 year of experience. I gave several interviews and was never asked for this question so I never bothered to understand this. In my last interview, I was asked this question and I was only able to talk about DNS lookup part. I knew this stuff but it didn't came to my mind as this falls into a single point of context. Thanks for making this video. It is a very detailed insight and you have explained all the stuff. Kudos to you. Your explanation is very detailed compared to another guy who has made the same video on the same topic. Keep Rocking Bro.. Good luck.
@chaudharyu.8453
@chaudharyu.8453 3 года назад
Very unique, nobody else goes in this depth! 👍👍
@arunprakash1101
@arunprakash1101 3 года назад
That's simply fantastic!! Keep up the good work 👏
@selphie99
@selphie99 4 года назад
I feel lucky to find you Hussein Nasser, I am so happy with your videos and am learning a lot, your way of explaining things is addicted to watch, I wish I found your videos before. Keep doing great stuff, please don't stop.
@hnasr
@hnasr 4 года назад
Cena thank you so much Cena 😊🙏 I know this video is long so I appreciate it really! Happy you like the content.
@Sanaatani_Proud
@Sanaatani_Proud 4 года назад
Excellent !!! you definitely deserve millions of subscribers 🥰
@dishantsingh6659
@dishantsingh6659 3 года назад
Best channel for backend engineering. Thank you for the efforts :)
@shashikantdivekar7839
@shashikantdivekar7839 3 года назад
Sir, one of the best videos. Very nicely explained. You are helping many folks here. Thank you.
@AnkitYadav-kz2ei
@AnkitYadav-kz2ei 8 месяцев назад
litterly, i was seeking such type of explanation for almost 4yr of my college , now i got it. thank you!!
@Sri58
@Sri58 3 года назад
It's just a fabulous explanation, @Hussain. And thank you so much for this wonderful presentation. Keep rocking
@hnasr
@hnasr 3 года назад
❤️thanks
@ritwiksen1987
@ritwiksen1987 Год назад
You have a great knack for explaining things very lucidly. Much unlike other youtubers who upload unintelligible videos purely for the purposes for profiteering.
@KrAsHeDD
@KrAsHeDD 20 дней назад
It was very short indeed. lol I totally enjoyed watching and learnt something. Thank you!
@akshitdhanda4544
@akshitdhanda4544 2 года назад
One of THE best explanations. Very informative.
@theSDE2
@theSDE2 2 года назад
Just to understand this video, i had to watch multiple other videos of yours sir. Amazing explanation
@RahulGupta-ts3zf
@RahulGupta-ts3zf 3 года назад
Amazing explanation. New here. But looking upon your content and way of teaching I shared this with dozen of my tech savyy friends and my leads. Amazing work. Thank you for all content at one single place ♥️
@hnasr
@hnasr 3 года назад
Rahul Gupta thanks Rahul! Appreciate it dear glad the content was helpful
@soumyadeeproy6611
@soumyadeeproy6611 4 года назад
Thank God that I have stumbled upon your videos,very informative and hope to get most out of it :)
@hnasr
@hnasr 4 года назад
Thank you 🙏 glad you enjoyed the content! Suggest what would you like to see next I might consider it😊
@soumyadeeproy6611
@soumyadeeproy6611 4 года назад
@@hnasr Plz consider making a video quantum cryptography :)
@tibebetech4867
@tibebetech4867 Год назад
Great Job! This is as best it gets in full package!....Thank you!
@hackcorner5379
@hackcorner5379 2 года назад
Awesome explanation. Salute to your effort.
@vanshthukral5477
@vanshthukral5477 2 месяца назад
Thanks a lot for this amazing content!
@neuron8186
@neuron8186 3 года назад
This question was asked in my interview thanks I watched this video long ago
@zuggrr
@zuggrr Год назад
Thank you sooooo much for this video ! this is gold to me
@anandc6707
@anandc6707 Год назад
Excellent one, thanks!
@tomatosauce605
@tomatosauce605 2 года назад
This is the weirdest suggestion I’ve ever had for a video… I had an exam today (Cyber Scheme Team Member).. this was one of the questions - word for word!!!!!!!
@md.hossain693
@md.hossain693 7 дней назад
i needed exactly this video
@christophervradis7285
@christophervradis7285 2 года назад
Hussein - big big thumbs up for all your videos. Have you ever thought about making a video for above the fold loading? I think nowadays it is pretty useful!
@raviborana9210
@raviborana9210 3 года назад
Hii Naseer, Don't you think router will again make ARP request for final destination and put destination MAC instead of it's own?
@rv0_0
@rv0_0 16 дней назад
I dont know how did i landed here, but i am glad that i landed here.
@user-oy4kf5wr8l
@user-oy4kf5wr8l 4 года назад
Although i dont understand all lol...but huge respect to u, bro!
@anujmishra4013
@anujmishra4013 4 года назад
happy new year with best best video
@hnasr
@hnasr 4 года назад
anujm 4467 happy new year 🎆🎈🎊 enjoy it
@MyLifeMyWorld08
@MyLifeMyWorld08 2 года назад
very nice explanation
@alexk6745
@alexk6745 3 года назад
Good explanation, but many pieces still missing. Certificate validation, check in CRL. Backend is much more complicated with F5 routers and Web farms. Anyway thumb up! So far one of the best explanations I found for my wife.
@afrozalam5389
@afrozalam5389 3 года назад
You mentioned that the HSTS list is cached in the browsers DB. What happens if the cache is cleared for a site which is ready to serve https? Doesn't that make going to http a bad decision?
@d2s517
@d2s517 2 года назад
Hey nice explanation! One quick question what happens if server hosted website with ipv6 and our machine has ipv4 & ipv6?
@a.b.m.abdurrahmanraju5985
@a.b.m.abdurrahmanraju5985 9 месяцев назад
In tcp/ip model we add https header in application layer and add this https port number in tcp header but both are same thing. why?
@MayankAggarwal
@MayankAggarwal 4 года назад
Awesome!!
@manojnaidu619
@manojnaidu619 3 года назад
Fabulous rundown❤️
@hassanmunene5406
@hassanmunene5406 11 месяцев назад
Hussein you are the best ❤
@matnexmix6922
@matnexmix6922 2 года назад
Was expecting you to explain how the packets are sent through underwater internet cables... 😂 Much love. Hussein Nasser...
@AnkitYadav-kz2ei
@AnkitYadav-kz2ei 8 месяцев назад
can you tell us what happens when we search for any keyword and click on any link?
@MyLifeMyWorld08
@MyLifeMyWorld08 2 года назад
You got 1 more subscriber ;)
@PP-qi9vn
@PP-qi9vn 3 года назад
can you explain about garbage collector and the algorithms is related to it?
@kimfucku8074
@kimfucku8074 4 года назад
Happy New Year!
@hnasr
@hnasr 4 года назад
Happy new year 🎆🎊🎈
@bashar876
@bashar876 2 года назад
Brilliant!
@BabuBakthavachalam
@BabuBakthavachalam 4 года назад
Great. Thank you
@willturner3440
@willturner3440 2 года назад
Bounced I think I have clear my fundamentals first
@pjmagesh
@pjmagesh Год назад
Wonderful!
@philipk883
@philipk883 4 года назад
Nobody: Hussein: "YO!"
@muhammadsuyanto901
@muhammadsuyanto901 4 года назад
. 囧KT80AAF
@ashutoshmishra2328
@ashutoshmishra2328 3 года назад
Hi Hussein, One Question, while doing DNS we have directly sent UDP datagram to 1.1.1.1:53 through router in the video, but when did we fetch DNS IP and port details from router.? will there be one more request for that to the router.?
@hnasr
@hnasr 3 года назад
Great question! When the device connects to the router and asks for an IP address the DNS IP address is provided to the device. Another possibility is that the DNS IP is the router itself and the router will take care of making the DNS request on our behalf.
@ashutoshmishra2328
@ashutoshmishra2328 3 года назад
@@hnasr Thanks for the quick reply. so it means it can be done in any of the two ways, it solely depends on the router not on the browser we have or any configuration in browser.
@anand3915
@anand3915 3 года назад
It's outstanding
@pranjalagnihotri6072
@pranjalagnihotri6072 3 года назад
Hey Hussien, it's a silly question but do you ever thought to work for "Google". Also thankyou thankyou thankyou for sharing us such great content and making us better Software Engineer 🚀
@a_k__
@a_k__ 3 года назад
I am wondering if h2 is compressing the body of the request to binary automatically, is it unnecessary to encode your JSON post request data to save bandwidth if you are using h2? I also thinking about protocol buffer as well. One of the benefits of pb is to save bandwidth by using a schema. I am not actaully sure if pb is using binary for comms.
@hnasr
@hnasr 3 года назад
Both h1 and h2 compress the body based on the header content-encoding algorithm (gzip etc)
@a_k__
@a_k__ 3 года назад
@@hnasr interesting. Do you think the compression can be more efficient using Protocol Buffers or ASN1 rathen than just relying on h1 and h2 compression? Also these topics are a bit untangible to me. Is there a way to somehow see these step by step?
@KittyMaheshwari
@KittyMaheshwari Год назад
why didn't you blurred everything
@hemanthkala6979
@hemanthkala6979 3 года назад
Hi bro can you give small explanation with ur message about TLS,GET and HTML parse
@nikunjbhartia2222
@nikunjbhartia2222 4 года назад
Another dumb question, which layers of the OSI model are involved when you connect to a webserver running on your localhost.
@hnasr
@hnasr 4 года назад
Nikunj Bhartia all of them probably minus the physical layer
@nikunjbhartia2222
@nikunjbhartia2222 4 года назад
Interesting.. thanks
@omaramine8710
@omaramine8710 4 года назад
Hi Hussein, can you mak video about DNSimple and DNS Record ! :-) thank you so much!
@jinayshah4215
@jinayshah4215 3 года назад
Great video!! Just one question why would the browser over HTTP 1.1 need 6 connections to fetch 3 resources?
@hnasr
@hnasr 3 года назад
To fetch 3 resources in parallel it only needs 3 connection. I was referring the to maximum number of connections per domain that the browser can open which is 6.
@brod515
@brod515 4 года назад
@15:15 you say the source I.P is 10.0.0.1 but the graphic shows 10.0.0.2. I'm assuming you made an error in what you said.
@hnasr
@hnasr 4 года назад
MrBrN197 thank you yes good catch! If was a mistake at my end i should said 10.0.0.2
@mohammadturabali3870
@mohammadturabali3870 3 года назад
thank you very much
@galfrasian
@galfrasian 4 года назад
Hats off man.
@hnasr
@hnasr 4 года назад
Thank you dear !
@zekawat
@zekawat 3 года назад
so gooooood
@relaxingsounds5469
@relaxingsounds5469 4 года назад
If it were the first communication with the outside world, wouldn't your computer need to first ARP for the mac address of the default gateway?
@hnasr
@hnasr 4 года назад
Correct, that is the first thing that happens. The computer knows the default gateway IP address (from DHCP) it asks for ARP and gets that. Here is where most ARP poisoning attacks happens
@relaxingsounds5469
@relaxingsounds5469 4 года назад
@@hnasr Thanks for the speedy reply! I'm literally still watching the video hehe. Yea I saw later on where you started referencing arp, so my comment might have been pre-mature. Keep up the great work
@SupGhostly
@SupGhostly 4 года назад
I love all your videos and I'm learning so much. But could you make this video without skipping "sooo much stuff"?
@hnasr
@hnasr 4 года назад
Thanks Eric! Your the first one who actually complains that the video is short haha , thanks for your comment! cheers
@SupGhostly
@SupGhostly 4 года назад
@@hnasr yeah sorry. I love all your videos but i love the details in these technologies. when you skip things like 3-way handshake I have to pause and go do research. have it all in one video will be amazing. I know this must be a lot of work for you so thank you again for the quality and taking the time to share your knowledge. QQ: will you be making a " beginner to expert with python" playlist?.
@hnasr
@hnasr 4 года назад
Eric thanks Eric! Really appreciate the feedback. Will keep that in mind. For python, I do have an adhoc playlist but not really beginner to expert. I do have a free course on udemy. Check my website
@ca7986
@ca7986 4 года назад
@@hnasr I agree with @nando I love to listen and watch the details! Please dont skip!
@krishnabirla16
@krishnabirla16 Год назад
What’s with the blur?
@techw4y
@techw4y 2 года назад
quite complicated explanation, unlike your other videos! You should have started it at a high level and then dive deep into router, proxy etc. After all this I still cant figure out where is DNS server and how name resolution is done.
@DevashishMulye
@DevashishMulye 3 года назад
"So who the heck knows the mac address of this thing?" - Huessein Nasser
@ca7986
@ca7986 4 года назад
❤️
@delwarmia9393
@delwarmia9393 6 месяцев назад
Very like
@allisonmachado
@allisonmachado 3 года назад
BOM DEMAIS!
@milindgour2526
@milindgour2526 3 года назад
I think the video is toooooooooo short man , kidding ....but really appreciate the content ....
@shikhaphogat1462
@shikhaphogat1462 3 года назад
awesome
@section9999
@section9999 3 года назад
"Why do we need Application-Layer Protocol Negotiation? Because...WE ARE COOL! 😎" - Daily dose of wisdom w/ Hussain
@charank7852
@charank7852 4 года назад
Hi Hussein ..do u have video on OSI model ?
@hnasr
@hnasr 4 года назад
Yes Its a critical concept that I had to explain check it out - you can always search youtube for “osi model hussein” ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7IS7gigunyI.html
@charank7852
@charank7852 4 года назад
@@hnasr thanks for reply Hussein.
@a_k__
@a_k__ 3 года назад
it would be great if you can make a video about ddd and cqrs
@hnasr
@hnasr 3 года назад
I kind of talked about CQRS (although I didn't know it was called that) here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-T8gic7Hb-dk.html The idea is to separate reads from writes
@a_k__
@a_k__ 3 года назад
@@hnasr Thanks! I missed this one!
@nikunjbhartia2222
@nikunjbhartia2222 4 года назад
Didn't get how router gets mac address of dns server
@hnasr
@hnasr 4 года назад
Nikunj Bhartia there is a configuration in the router to specify the DNS server ip address by default the router you get from the ISP ships with the ISP provided DNS one you can change it to anything like 1.1.1.1 or 8.8.8.8 (google)
@nikunjbhartia2222
@nikunjbhartia2222 4 года назад
@@hnasr thanks. So, the router's ARP table comes hard coded with DNS IP and Mac address ? Or it's only the DNS IP that is configured and router makes an ARP request to get DNS Mac address
@kallikantzaros
@kallikantzaros 3 года назад
@@nikunjbhartia2222 router just forwards that request to DNS server. Since client knows DNS IP address (1.1.1.1 or 8.8.8.8) it just forwards that packet on the Internet, then Internet does its magic through other ISPs networks and volla, your request reaches one of DNS servers. Then, it goes deeper than that on how DNS servers know where to find that nasty website you are looking for. Once they find, they go back and send it to your router. Your router then forwards it to you (client) and you have IP address of the website you looked for. After that, TCP handshake, TLS and all that "jazz" :) is going to happen.
@meghnam2221
@meghnam2221 3 года назад
Do all that jazz? Hmm ...
@searcholex
@searcholex Год назад
went heywire after html toooooo long
@stevenciu123
@stevenciu123 10 месяцев назад
TOO MUCH WHAT A DRAG
@sciencefreak1357
@sciencefreak1357 3 года назад
google.com
@FantasyPitzy
@FantasyPitzy 4 года назад
Hey! Good info but you made it 3 times longer than necessary :)
@hnasr
@hnasr 4 года назад
I know, this is a skill Im trying to get better at. Say more with less. Thanks for your comment
@rova354
@rova354 9 месяцев назад
2222 :D
@tharunpalla4764
@tharunpalla4764 3 года назад
Please stay on topic. Dont talk other stuff
@j.a.2770
@j.a.2770 3 года назад
5 minutes to explain typing in the URL ....25 minutes before the handshake...Good detail but need to edit. Come on my good bro.
@dutni_king
@dutni_king Год назад
your explanation is quite noisy for me. i suggest omitting peripheral stuff and just explain core by core.
@SamirKhan-bu4ct
@SamirKhan-bu4ct 4 года назад
Please don't use slangs 🙏
@adrian_gheorghita
@adrian_gheorghita 2 года назад
Nu se înțelege ce spui. Mănânci în timp ce vorbești? You ruined the whole tutorial, too bad.
@mokhtaramen9556
@mokhtaramen9556 3 года назад
Man, you talk too much nonsense, try to be more specific and be more accurate, i get bored quickly and leave your videos.
@Coolguydudeness1234
@Coolguydudeness1234 2 года назад
Interesting detail, if you’re using chrome and accessing google services it’s actually going to use quic/http3. It’s their application connecting to their services, they can use whatever protocol they please
@haseeb9621
@haseeb9621 6 месяцев назад
Далее
Fail-over and High-Availability (Explained by Example)
19:21
DNS is beautiful
41:01
Просмотров 46 тыс.
Yeni Özbək Mahnisi Yoxsa Vefali Reqsi? 😍
00:36
Просмотров 2,1 млн
What happens when you type a URL into your browser?
10:14
HTTP Cookies Crash Course
1:09:21
Просмотров 119 тыс.
What Happens When You Click a Link? - Computerphile
9:51
Cloudflare Open sources Pingora (NGINX replacement)
29:33
Собери ПК и Получи 10,000₽
1:00
Просмотров 2,2 млн