Part 8 of 8 · 3 min read
Exercises
Easy
Easy 1: Name the step (15 minutes)
Match each problem to the step that fails: (a) a name does not turn into an address, (b) the browser warns about an expired certificate, (c) the page arrives with a 404, (d) data arrives out of order, (e) a new connection feels slow to start.
Done when: five answers, each naming DNS, TCP, TLS or HTTP, and one reason.
Hint
Names are DNS. Order and loss are TCP. Certificates are TLS. Codes are HTTP.
Easy 2: Read the status (15 minutes)
For each status code, say who is at fault and whether a retry makes sense: 200, 301, 400, 401, 403, 404, 500, 503.
Done when: eight lines, each with a fault side and a retry decision.
Hint
4xx means the client should fix the request. 5xx may pass.
Easy 3: Speed from distance (15 minutes)
Use the formula top speed = window ÷ round trip. With a window of 128 KB, find the top speed at round trips of 10 ms, 50 ms and 200 ms.
Done when: three results in KB per second, and one sentence on the pattern.
Hint
Convert milliseconds to seconds before dividing.
Medium
Medium 1: Add up the wait (25 minutes)
A user in London opens a page from a server in Singapore, round trip 180 ms. DNS takes 40 ms, and TLS takes 2 round trips. Add up the time before the first byte. Then add up the time for a second request on the same open connection.
Done when: two totals in milliseconds, with each row shown.
Hint
Count DNS, then 1 round trip for TCP, 2 for TLS, 1 for HTTP. A second request needs only HTTP.
Medium 2: TTL trade-off (25 minutes)
A shop plans to move to a new server in an hour. Its DNS record has a TTL of 24 hours. Explain what will happen, and plan a way to change the TTL beforehand. State the cost of a short TTL.
Done when: a plan with timing, one problem if the plan is ignored and one cost of the short TTL.
Hint
Lower the TTL a day before the move, then restore it.
Medium 3: Fewer round trips (30 minutes)
A page loads 30 small files one after another on HTTP 1.1 with a 150 ms round trip on one open connection. Work out the time. Then give three changes that cut the time and estimate each result.
Done when: a baseline total, three changes and a new total for each.
Hint
30 requests × 150 ms. Fewer, larger files or HTTP 2 help.
Hard
Hard 1: Draw the full path (40 minutes)
Draw a timeline for a first visit to a site, with DNS, TCP, TLS and HTTP. Mark each round trip. Show which parts a repeat visit within a minute skips, and why.
Done when: one timeline for the first visit, one for the repeat visit, and a note of three skipped steps with reasons.
Hint
A repeat visit skips DNS (saved) and the handshakes (open connection).
Hard 2: Failure at each step (40 minutes)
For each of the five steps (DNS, TCP, TLS, HTTP request, response), list one real failure, how users would see it and one design measure that guards against it.
Done when: five rows with failure, symptom and guard.
Hint
Think of an expired certificate, a down name server, a lost packet, a bad request and a crashed server.
Hard 3: Where to put servers (45 minutes)
A company has users in three regions with round trips to one central server of 40 ms, 180 ms and 250 ms. Work out the time before the first byte for each region, assuming 3 round trips plus a 40 ms DNS lookup. Propose where to put extra servers, and the new totals.
Done when: three totals before the change, a placement plan and three totals after the change.
Hint
A server inside each region makes the round trip about 20 ms in that region.