End-to-End Journey of a Web Request
A student attaches a laptop to a campus network (LAN) and accesses google.com.
Step 1: Obtaining an IP Address
Need for IP Address
- Need IP address
- Manual configuration
- Automatic configuration (DHCP)
- Get laptop's own IP, first-hop router(gateway)'s address, DNS server's address
DHCP Request and Broadcast
- DHCP request encapsulated in UDP, encapsulated in IP, encapsulated in 802.3 Ethernet (LAN).
- Ethernet frame broadcast (destination: FFFFFFFFFFFF) on Local Area Network, received at router running DHCP server.
- Ethernet demuxed to IP demuxed, UDP demuxed to DHCP.
Receiving DHCP Response
- DHCP server formulates DHCP ACK containing client's IP address, IP address of first-hop router for client, name and IP address of DNS server.
- Encapsulation at DHCP server, frame forwarded (switch learning) through LAN, demultiplexing at client.
- DHCP client receives DHCP ACK reply.
- Client now has
- its own IP address
- Client knows
- name and address of DNS server
- IP address of first-hop router
- Client now has
Step 2: Resolving google.com via DNS
DNS Query Creation
- Before sending HTTP request, need IP address of google.com
- DNS를 통해 가져올 수 있음
ARP for Router MAC Address
DNS query created, encapsulated in UDP, encapsulated in IP, encapsulated in Ethernet. To send frame to router, need MAC address of router interface.
- ARP를 통해 얻을 수 있음
- ARP를 통해 router의 IP를 router의 MAC으로 translate
ARP (Address Resolution Protocol) query broadcast, received by router, which replies with ARP reply giving MAC of router interface.
- Client knows MAC of first-hop router, so can now send frame containing DNS query.
DNS Query Transmission and Response
- IP datagram containing DNS query forwarded via LAN switch from client to first-hop router.
- IP datagram forwarded from campus network into ISP network (Tables created by RIP, OSPF, IS-IS and/or BGP routing protocols) routed to DNS server.
- Demuxed to DNS server.
- DNS server replies to client with IP of www.google.com
Step 3: Sending and Receiving the HTTP Request
TCP Handshake
- To send HTTP request, client first opens TCP socket to Web server.
- TCP SYN segment inter-domain routed to Web server (step 1 in 3-way handshake).
- Web server responds with TCP SYNACK (step 2 in 3-way handshake).
- TCP connection established (between your TCP stack and server's TCP stack).
HTTP Communication
- HTTP request sent into TCP socket.
- IP datagram containing HTTP request routed to www.google.com
- Web server responds with HTTP reply containing web page.
- IP datagram containing HTTP reply routed back to client
Conclusion
The web page is finally displayed.