Recall warm-up
- Persistent connection, base + N small objects, pipelining: total RTTs?
Stuck? Peek at 5.3 HTTP: messages, methods, status codes, cookies, persistent connections and RTT counting
- HTTP: request (method, path, version, headers, body) / response (status, headers, body); TCP 80; URL = protocol + host + path.
- Methods GET, POST, HEAD, PUT, DELETE; codes 2xx ok, 3xx redirect (301, 304), 4xx client (404), 5xx server.
- Stateless; cookies via Set-Cookie / Cookie.
- RTTs (base + N small): non-persistent 2(N+1); k-parallel 2 + 2⌈N/k⌉; persistent 2 + N; pipelined 3. Add DNS first.
- What does a home NAT router change in an outgoing packet?
Stuck? Peek at 3.3 Network Address Translation (NAT): private ranges, NAPT & trade-offs
- Private IPv4 ranges:
10.0.0.0/8,172.16.0.0/12(172.16..31.x.y),192.168.0.0/16. - NAPT table: maps
(Private IP, Private Port) ↔ (Public IP, NAT Port). - Rewrites: Outgoing → Source IP + Source Port; Incoming → Destination IP + Destination Port (+ checksums).
- Private IPv4 ranges:
- Which address changes at every hop — MAC or IP?
Stuck? Peek at 2.1 Role of the data link layer: hop-to-hop delivery and MAC addresses
- Data link layer = hop-to-hop delivery of frames to the next directly connected node.
- Jobs: framing, link addressing, error detection, medium access (+ error/flow control).
- MAC address: 48 bits, 6 bytes, 12 hex digits; 24-bit vendor prefix; flat.
- A new frame (new MAC addresses) is built on every link; the packet inside is unchanged.
- Foundation: bit stuffing inserts a 0 after five consecutive 1s.
The Hook
This is the story the whole course has been telling. You sit at the office, open your laptop, type http://www.example.com and press Enter. In about a tenth of a second, every lesson you studied runs, layer after layer, hop after hop. Let us follow the one message there and back.
Predict First
Your laptop has just joined the office network and knows nothing. Before any web data flows, how many different "lookups" must it do: one (the web page), two (name + page), or more?
,More. It needs its own IP address and the gateway (DHCP), the gateway's MAC address (ARP), the server's IP address (DNS), then a TCP connection, then the HTTP request. Several of these are cached after the first time.
Core Concept
Step 0: getting on the network (Foundation)
ARP (Address Resolution Protocol): to send a frame to an IP address on the same LAN (for example the gateway), the host broadcasts "who has this IP?"; the owner replies with its MAC address, which is cached in the ARP table.
Step 1: the name (DNS)
The browser parses the URL (5.3) and needs the IP of www.example.com. It sends a DNS query in a UDP datagram to port 53 of the local resolver (5.2). The query travels: application message → UDP segment → IP datagram (destination = resolver's IP) → Ethernet frame (destination MAC = gateway, found by ARP) → bits (Phases 1–2). The resolver walks root → TLD → authoritative unless cached, and returns the A record.
Step 2: leaving home or office (NAT, routing, forwarding)
Packets leave with a private source address; the edge router's NAPT table rewrites it to the public address and a fresh port (3.3). Each router does a longest-prefix match on the destination (3.1.5) to pick the next hop; routing tables were built by distance-vector or link-state routing (3.4). At every hop the frame is rebuilt with new MAC addresses (2.1) and checked with its CRC (2.2.4); if a link's MTU is smaller than the datagram and DF = 0, it is fragmented (3.2.2), reassembled only at the server.
Step 3: the connection and the page (TCP + HTTP)
The browser opens a TCP connection to port 80: SYN, SYN-ACK, ACK (4.3.2, 1 RTT). It sends GET / HTTP/1.1; the server answers 200 OK with the HTML (1 RTT + transmission). TCP slow start (4.3.5) begins with a small cwnd, so a large page takes several RTTs; flow control (4.3.3) keeps the receiver's buffer from overflowing; lost segments are retransmitted after a timeout or 3 duplicate ACKs. The browser then requests the images over the same persistent connection.
Step 4: the way back and the minimum time
Responses retrace the steps in reverse: frames hop back, the NAT router translates the public port back to your laptop's private address and port, TCP reassembles the byte stream in order, and the browser renders the page. With DNS already cached, the minimum is 2 RTT to the first byte of the page (1 for the TCP handshake, 1 for request/response), plus transmission and any DNS time.
| Phase of the course | What it did in this story |
|---|---|
| 1 Layering, switching, delay | encapsulation; packet switching; every delay we add up |
| 2 Data link | frames, MAC addresses, CRC, access to the shared LAN |
| 3 Network | IP addresses, LPM forwarding, routing, NAT, fragmentation |
| 4 Transport | ports, TCP handshake, reliability, flow and congestion control |
| 5 Application | DNS name lookup, HTTP request/response |
Putting it together
- A page load runs DHCP, ARP, DNS, a TCP handshake and HTTP, in that order.
- Every layer of the course plays a part: frames, routing, NAT, TCP control, DNS and HTTP.
- With caches warm, the first byte arrives after about 2 RTT plus DNS and transmission.
Visual
Worked Examples
Put in order: TCP handshake, ARP for the gateway, DNS query, HTTP GET, DHCP.
Show the full solution
DHCP → ARP → DNS query → TCP handshake → HTTP GET. (DNS needs the gateway's MAC, so ARP comes first; HTTP needs the TCP connection.)
DNS answer cached at the laptop, ARP cache warm. Minimum number of RTTs to the server before the first byte of the page arrives (transmission ignored)?
Show the full solution
1 RTT for the TCP handshake + 1 RTT for the GET and the start of the response = 2 RTT.
DNS resolution takes 4 ms (answer in the local resolver's cache). RTT to the web server is 30 ms. The HTML file takes 12 ms to transmit. Time from pressing Enter until the HTML has fully arrived (DHCP/ARP already done, one TCP connection)?
Show the full solution
4 (DNS) + 30 (TCP handshake) + 30 (request/response RTT) + 12 (transmission) = 76 ms.
GATE Traps
- ARP and DHCP work only inside one LAN (broadcasts); routers do not forward them.
- DNS uses UDP; the page uses TCP — two different transports in one page load.
- IP addresses stay fixed end to end (except where NAT rewrites them); MAC addresses change at every hop.
- Fragments are reassembled only at the destination host, never by routers on the path.
Memory Hook
"Address me (DHCP), find the door (ARP), find the house (DNS), knock (TCP), ask (HTTP)."
Connect the Dots
That is the full journey. Next (Phase 6): merge every rule card into one sheet, practise with mixed questions from all phases, drill GATE patterns, and take the 90-minute final test.
Self-Test
- MCQ
Which happens first when a freshly booted laptop opens a web page?
- DNS query
- DHCP request
- TCP SYN
- HTTP GET
- MSQ
Which protocols use broadcasts on the local LAN?
- ARP request
- DHCP discover
- HTTP GET
- TCP SYN
- NAT
DNS 10 ms, RTT 40 ms, HTML transmission 20 ms, one TCP connection. Time until the HTML has arrived (ms)?
Write your answer before opening the key.
- MCQ
On the way from the laptop to the server, which field is changed by a home NAT router?
- Destination IP
- Source IP and source port
- TCP sequence number
- HTTP method
- MCQ
Which layer's mechanism reassembles fragmented datagrams?
- Each router on the path
- The destination host's network layer
- The data link layer
- HTTP
Rule Card
- Order: DHCP (address, gateway, DNS server) → ARP (gateway MAC) → DNS (UDP 53) → TCP handshake (port 80) → HTTP GET/200 OK.
- Minimum to first byte (cached DNS/ARP): 2 RTT + transmission.
- IP fixed end to end (NAT rewrites at the edge); MAC changes per hop; CRC per hop; fragments reassembled at the destination.
Concept Ledger
- DHCP (Foundation)
- ARP, ARP table (Foundation)
- end-to-end page-load sequence
- minimum page-load time 2 RTT + transmission (+ DNS)
Answer Vault
Try the questions first. Open when you are ready to check.
Warm-up answers
- 3.
- The private source IP and port → its public IP and a new port (NAPT), recorded in the translation table.
- The MAC addresses (a new frame per link).
Self-test answers
- B — Without an IP address nothing else can be sent.
- A: Needs an address and the gateway.
- C: Needs the server's IP (DNS).
- D: Needs a TCP connection.
- AB — ARP and DHCP discovery are broadcasts.
- C: Unicast to the server.
- D: Unicast to the server.
- 110 — 10 + 40 + 40 + 20 = 110.
- B — NAPT rewrites the private source address and port.
- A: The server address stays.
- C: Not changed by NAT.
- D: Application data untouched.
- B — Reassembly happens only at the destination.
- A: Routers never reassemble.
- C: Not the link layer.
- D: Not the application.
Flashcards
- Order of steps for a fresh laptop?
Reveal answer
DHCP → ARP → DNS → TCP handshake → HTTP. - Minimum RTTs to the first page byte with cached DNS?
Reveal answer
2. - Which protocols here use UDP?
Reveal answer
DHCP and DNS.
Exam shortcuts
- Page fetch time = DNS + 1 RTT (TCP) + 1 RTT (GET/response) + transmission (+ more RTTs for objects per 5.3). — cached ARP/DHCP; slow-start effects ignored for small objects.