Journey of a Web Request
Solution 1:
the request flows from my machine -> switch -> default gateways (are routers ,I presume) -> DNS Servers -> Data Centres -> the Web Server .. am I correct ?
No.
PC -> Ethernet broadcast: ARP-request:
"what is ethernet address for IP-address of DNS server?"
DNS-Server: ARP-response: "My Ethernet address is a:b:c:d:e:f"
PC -> DNS: "What is the IP-address of www.google.com?"
DNS-Server -> ISP DNS: "What is the IP-address of www.google.com?"
ISP-DNS -> DNS server
"I don't do recursive, do your own work, google.com DNS at 2.3.4.5, 4.5.6.7"
DNS-Server -> 2.3.4.5 "What is the IP-address of www.google.com?"
2.3.4.5 -> DNS-Server "I refuse your connection attempt!"
DNS-Server -> 4.5.6.7 "What is the IP-address of www.google.com?"
4.5.6.7 -> DNS Server
"www.google.com is 1.2.3.4; google.com DNS at 4.5.6.7, 3.2.1.3"
DNS-server -> PC "www.google.com is 1.2.3.4"
PC -> Ethernet broadcast: ARP request:
"what is ethernet address for IP-address of router?"
Router -> PC: "my ethernet address is d:e:a:d:b:e"
PC -> Router: IP to 1.2.3.4 "get / HTTP1.1; host: www.google.com"
Router -> PC: ICMP redirect: "for 1.2.3.x use router2.internal at 192.168.0.253"
PC -> Ethernet broadcast: ARP-Request:
"what is ethernet address for 192.168.0.253?"
Router2 -> PC: "my ethernet address is b:e:e:f:f:o"
PC -> Router2: IP packet for 1.2.3.4 ("get / HTTP1.1; host: www.google.com")
Router2 -> Router3 "1 IP packet for 1.2.3.4 (...)"
Router3 -> Router4 "3 IP packets for 1.2.3.4 (...)" (he split em)
Router4 -> Router5 "3 IP packets for 1.2.3.4 (...)"
Router3 -> Router2 "Routing change, line to Router 4 outage, find new route!"
Router5 -> Akamai mirror
"{external IP of Router2} sent you 'get / HTTP1.1; host: www.google.com'"
...
etc etc etc etc etc etc etc
(thousands of packets later)
PC .... { hmm, I still need 4 images and two CSS files, can't display page yet ... }
(hundreds of packets later)
I've omitted switch details, collisions, backoffs, throttling, re-transmits, spanning-tree, timeouts, NAT, three way-handshakes, concurrent persistent HTTP connections, and hundreds of other things that happen all the time. Filling in all the steps would take thousands of lines (if not tens or hundreds of thousands) like the above.