A web request, end to end
Almost every network fault shows up as “the page does not load.” This page follows one request from a laptop that has just been plugged in, through each protocol in order, so you can tell which stage broke. The addresses are examples: a LAN of 192.168.1.0/24, a gateway at 192.168.1.1, a DNS resolver at 198.51.100.53, and a web server at 203.0.113.10.
sequenceDiagram
participant H as Laptop
participant S as Switch
participant G as Gateway and DHCP server
participant D as DNS resolver
participant W as Web server
H->>S: 1. DHCP discover (broadcast)
S->>G: flooded
G->>H: 2. DHCP offer and ack (address, gateway, DNS)
H->>G: 3. ARP for the gateway
H->>D: 4. DNS query for app.example.com
D->>H: answer 203.0.113.10
H->>W: 5. TCP SYN, SYN-ACK, ACK
H->>W: 6. TLS handshake
H->>W: 7. HTTP request
W->>H: HTTP response
1 and 2. Getting an address
Section titled “1 and 2. Getting an address”A new host has no IP address and does not know who the gateway or DNS server is. It broadcasts a DHCP request. Each header layer is filled in with what the host does know:
| Layer | Source | Destination |
|---|---|---|
| Ethernet | The laptop’s own MAC | ff:ff:ff:ff:ff:ff (broadcast) |
| IP | 0.0.0.0 | 255.255.255.255 |
| UDP | Port 68 (client) | Port 67 (server) |
| DHCP | Discover or request message |
The switch floods the frame out of every other port. As a side effect it learns that the laptop’s MAC is on the port it came from. The gateway, running the DHCP server (or a relay, covered in networking services), passes the payload up through IP and UDP to the DHCP process. The reply carries an address from its pool, the subnet mask, the default gateway, and the DNS server. It is sent back as a unicast frame to the laptop’s MAC, and since the switch has learned that MAC, it goes straight to the right port.
The laptop installs the address, adds a route to the gateway, and records the DNS server.
# What DHCP gave the hostip addr show eth0 | grep inetip route show defaultresolvectl status | grep -A1 'DNS Servers'
# Watch the exchangesudo tcpdump -ni eth0 -e 'port 67 or port 68'| If it fails | Likely cause |
|---|---|
Address 169.254.x.x | No DHCP reply: server down, wrong VLAN, relay missing |
| Address but no route | The lease lacks a gateway option |
| Wrong DNS | Stale or rogue DHCP server, or a bad option on the real one |
3. ARP for the gateway
Section titled “3. ARP for the gateway”To send anything outside 192.168.1.0/24, the laptop must put the gateway’s MAC in the frame. It broadcasts an ARP request for 192.168.1.1, and the gateway replies. (ARP explains the exchange.)
ip neigh show 192.168.1.1# 192.168.1.1 dev eth0 lladdr 00:11:22:aa:bb:01 REACHABLEIf this shows FAILED or INCOMPLETE, the fault is at layer 2: the port, the VLAN, or the gateway itself.
4. DNS
Section titled “4. DNS”The application asks the resolver library for app.example.com. The query is a UDP datagram to port 53 on the DNS server. It is addressed (at layer 3) to the DNS server, but framed (at layer 2) to the gateway, since the resolver is off-subnet. The gateway forwards it. The reply carries the A and AAAA records.
dig app.example.com +short# 203.0.113.10
# See which server answered and how long it tookdig app.example.com | grep -E 'SERVER|Query time'| If it fails | Likely cause |
|---|---|
NXDOMAIN | The name does not exist, or a search-domain mistake |
| Timeout | Resolver unreachable, UDP/53 blocked, or resolver overloaded |
| Wrong address | Stale cache, split-horizon view, or a CDN returning a regional address. See split horizon |
5. TCP handshake
Section titled “5. TCP handshake”With the address known, the client opens a TCP connection to 203.0.113.10 port 443. The destination MAC is still the gateway. The SYN crosses the internet, using routes built by the protocols in routing protocols. At the server, the SYN is delivered to the listening socket, and the operating system creates a connection socket for this client.
# Watch just the handshakesudo tcpdump -ni eth0 'host 203.0.113.10 and tcp[tcpflags] & (tcp-syn|tcp-ack) != 0'| What you see | Meaning |
|---|---|
| SYN, then SYN-ACK, then ACK | Healthy |
| SYN repeated, no reply | Packet dropped by a firewall or routing fault. Retries back off 1, 2, 4 seconds |
| SYN answered by RST | Reachable host, nothing listening on that port |
| Handshake completes but data stalls | Often MTU or PMTU trouble |
6 and 7. TLS and HTTP
Section titled “6 and 7. TLS and HTTP”For HTTPS, the next step is the TLS handshake (how it works): agree on parameters, verify the server’s certificate, derive session keys. The browser then writes an HTTP request into the encrypted stream, and the server’s reply travels back as a series of TCP segments.
# One command that shows each stage with timingscurl -so /dev/null -w \'dns %{time_namelookup}s connect %{time_connect}s tls %{time_appconnect}s first-byte %{time_starttransfer}s total %{time_total}s\n' \ https://app.example.com/# dns 0.012s connect 0.045s tls 0.110s first-byte 0.190s total 0.205sThe timings are cumulative, so subtract the previous figure to get each stage’s own cost. A large DNS number points at the resolver, a large gap from connect to TLS at certificate or handshake problems, and a large gap before first byte at the application or the backend.
Where each protocol lives
Section titled “Where each protocol lives”| Layer | Protocol | Job in this exchange |
|---|---|---|
| Application | DHCP, DNS, HTTP | Configuration, name lookup, the request itself |
| Security | TLS | Encrypts and authenticates the session |
| Transport | UDP, TCP | Datagrams for DHCP and DNS, a reliable stream for HTTP |
| Network | IP, ICMP | End-to-end addressing and routing |
| Link | Ethernet, ARP | Hop-by-hop delivery on each segment |
Working through a failure
Section titled “Working through a failure”The stages give an order of attack. Start at the bottom, and stop at the first stage that fails.
| Step | Check | Command |
|---|---|---|
| Link | Cable and speed | ip link, ethtool eth0 |
| Address | Lease and route | ip addr, ip route |
| Gateway | ARP and ping | ip neigh, ping -c3 192.168.1.1 |
| Beyond the gateway | Routing | ping 203.0.113.10, mtr 203.0.113.10 |
| Name | DNS | dig app.example.com |
| Port | TCP | nc -vz 203.0.113.10 443 |
| Secure session | TLS | openssl s_client -connect app.example.com:443 |
| Application | HTTP | curl -v https://app.example.com/ |
The same sequence applies inside Kubernetes and cloud networks. A pod gets an address from the CNI instead of DHCP, a Service name resolves through cluster DNS, and the connection passes through a kube-proxy or eBPF layer, but the order of stages is unchanged.