Skip to content

Follow a request through DNS, connections and HTTP

11 min reading

Annotate where name lookup, connection setup and response work occur

Page details

System Design · Follow a request

11 min reading · 26 min with practice

Sources

Published · Last edited:

Prerequisite: Estimate one workload from user action to component demand. For basics, use the independent System Design foundations.

More
20px

Hypothetical scenario. The promotion estimate distinguishes five reads per second across the minute from fifteen during its selected busy interval. Dev demonstrates a fast catalogue handler. Priya opens the same product page from a new browser connection and waits before the handler has even started. Both observations can be correct.

Dev: “The handler is fast in my measurement.”

Priya: “Where did your clock start? Mine started when I requested the page.”

Maya: “Follow that request from the browser so we can see which waiting time is missing.”

You will trace a specific HTTPS request through name lookup, connection setup, protected communication, application work and delivery. The example deliberately chooses a new TCP connection with TLS; other transports and reused connections need their own accounting. The aim is to locate the work behind a latency number before optimizing it.

Which request path are we tracing?

Assume an HTTPS request using a new TCP connection and TLS. This is a teaching baseline, not a claim that every modern web request uses that transport. Connections can be reused, and HTTP/3 uses a different transport organization. Identify the protocol and reuse state before transferring the calculation to a real service.

The URL identifies a scheme, a host and an application resource. The browser needs a destination for the host and a supported way to exchange the request. The path portion identifies what the application is being asked to serve; it is not a network address that a router uses to locate the machine.

Resolve the host without confusing it with the record

DNS provides records used to resolve names. A resolver can answer from a valid cached record or perform further lookup work. For this exercise, assume the browser obtains a usable destination address. That answers where to attempt communication; it does not prove that the catalogue application or its product data is healthy.

Keep two kinds of freshness separate. DNS record caching affects name-resolution behavior. The price-age condition in Northwind’s brief concerns application data. A recently resolved address says nothing about whether the selected price record was updated within sixty seconds.

The browser crosses several distinct boundariesResolve a destination, establish the selected transport and TLS session, send the HTTP request, process the catalogue lookup, then deliver and present the response. Reuse can avoid selected setup work but cannot establish product-data freshness.Resolve hostDNS recordConnect and protectTCP + TLS baselineRequest and processHTTP + catalogueTransfer and presentCheck the result
A fast stage cannot certify the whole path.

Follow a named request across the actual participants

Hypothetical protocol baseline. Select HTTP/1.1 over a fresh TCP connection with TLS, without resumption or early data. The browser resolves the catalogue host, establishes the connection and then sends the read request. The catalogue obtains a source representation before it can assemble the listing. Arrows below show ordering, not measured packet timing; transport and TLS setup each contain exchanges omitted from this overview.

Name resolution, setup and the source read are distinct exchangesThe chosen sequential baseline uses a fresh TCP/TLS connection and one HTTP/1.1 request; the source read belongs to application work, not DNS.BrowserDNS resolverCatalogueProduct source1 · resolve host2 · destination3 · TCP, then TLS4 · HTTP GET Q75 · source read6 · view + evidence7 · HTTP response8 · Browser checks and presents the returned listing.
The chosen sequential baseline uses a fresh TCP/TLS connection and one HTTP/1.1 request; the source read belongs to application work, not DNS.

The request target selects Q7 and its supported representation, as proposed in page 02. DNS resolves the host, not that product identity. The HTTP response should carry the fields needed by the view contract, including price evidence where applicable. The catalogue’s internal source lookup does not become part of DNS merely because both steps retrieve information.

Connect, then establish the protected channel

In the selected baseline, TCP provides a reliable byte-stream abstraction. That abstraction handles transport concerns; it does not certify the meaning of a product response. If an application sends the wrong price successfully, reliable delivery preserves the wrong application content.

TLS provides a protected communication protocol. Server authentication and protection against tampering address different questions from catalogue correctness. RFC 8446 specifies TLS 1.3 and its security properties. A valid protected channel does not prove that a record is current or that the application applied the right business rule.

For a real investigation, distinguish time spent establishing communication from time spent waiting for application work. A connection failure may occur before the catalogue receives any HTTP request. A timeout after dispatch may instead leave uncertainty about what a remote application processed. This chapter’s read-only browsing scope avoids the separate problem of repeating a payment, but the observation boundary still matters.

Ask the application and inspect its answer

HTTP describes requests and responses at the application layer. A request carries a method, target and other fields; the response carries status and representation information. RFC 9110 defines those semantics. Northwind still needs its own rule for whether the representation contains an acceptable product listing.

The catalogue may contact the product-record service inside the owned boundary from the earlier brief. That downstream wait belongs in the visitor’s path even when a separate team operates the service. A handler duration that excludes the dependency wait cannot be substituted for an end-to-end completion measure.

After the first response bytes arrive, the payload must still be transferred and the relevant result presented. Define which presentation event ends the chosen measurement. Receiving headers, finishing the response body and showing the applicable price are distinct observations.

Account for one cold path

Hypothetical worked example. Choose these non-overlapping serial durations: DNS takes 20 ms, TCP setup 60 ms, TLS setup 60 ms, request/application waiting through first response byte 80 ms, payload transfer 40 ms, and presentation 30 ms. These are selected accounting terms, not measured timings or mandatory protocol round-trip counts.

The total is 20 + 60 + 60 + 80 + 40 + 30 = 290 ms. Against the selected 400 ms requirement, headroom is 400 − 290 = 110 ms under this model. That difference is an allowance, not proof of a production percentile or a guarantee that each phase remains constant under load.

The payload term can be made explicit using the previous lesson’s 2,000-byte response. Choose an effective payload transfer rate of 50,000 bytes per second for this one request. Then 2,000 ÷ 50,000 = 0.04 seconds = 40 ms. Requests, protocol overhead and retransmissions remain outside that simplified transfer calculation.

Reuse changes the accounting, not the acceptance rule

Suppose a second request can reuse the relevant DNS result and the existing connection/security session, so none of the three selected setup terms is repeated. The remaining chosen time is 80 + 40 + 30 = 150 ms. The saved setup allowance is 20 + 60 + 60 = 140 ms, and 290 − 140 = 150 ms agrees with that sum.

Do not multiply every request by one new connection. Browsers and servers can reuse connections, and some HTTP versions support multiple concurrent exchanges on a connection. Conversely, do not assume every visitor arrives with reusable state. State the mixture being measured rather than quietly measuring only the warm case.

The fifteen-read-per-second workload transfers 15 × 2,000 = 30,000 payload bytes per second before overhead. That aggregate demand is not the same quantity as the selected single-request transfer rate. A shared path, contention or other traffic changes the relationship. Neither number alone proves the visitor deadline.

Make the cold and reused calculations comparable

A reused path removes selected setup work, not the product checkCold phases total 290 ms. Under the stated reuse assumption the remaining application, transfer and presentation phases total 150 ms.Cold selected pathDNS 20 + TCP 60 + TLS 60App 80 + transfer 40 + view 30= 290 msReused selected pathSetup terms omitted hereApp 80 + transfer 40 + view 30= 150 msSaved setup = 20 + 60 + 60 = 140 ms; 290 − 140 = 150 ms.
Cold phases total 290 ms. Under the stated reuse assumption the remaining application, transfer and presentation phases total 150 ms.

The 80 ms application term includes the work the catalogue must wait for in this selected request. Do not add that same source-wait interval again as a separate network term. Reuse saves the stated setup work only while the relevant cached DNS result and connection remain usable. RFC 9112’s HTTP/1.1 connection rules provide a protocol reference; they do not guarantee that every browser request finds a reusable connection.

A TCP retransmission delivers stream data under the transport contract. An application retry creates another request attempt. If a proxy times out after forwarding the GET, the source read may still have completed; the proxy’s observation cannot prove otherwise. A later read can legitimately observe a newer product revision, so a repeated GET is not a promise of identical representation bytes. Record request attempts and source versions separately, and spend the same client deadline rather than resetting it at each boundary.

In the wild: protocol contracts have boundaries

The HTTP and TLS specifications provide real public contracts for message semantics and protected communication. Read them as descriptions of those mechanisms, not as evidence that Northwind’s application meets its freshness or response target. A useful design connects protocol observations to application observations without treating them as interchangeable.

When documenting an incident or test, name which boundary supplied the evidence. “The name resolved,” “the secure session was established,” “a response arrived” and “an acceptable listing was shown” establish progressively different facts.

When healthy transport delivers an unacceptable result

Hypothetical failure scenario. Northwind monitors connection success and HTTP 200 responses. A product-service cache serves an old promotion price over a healthy TLS connection. All transport checks pass while the price violates the selected freshness condition.

Preserve transport diagnostics, then add the application-level check needed for the claim. Turning off encryption or repeatedly resolving the hostname would not repair the old record. Locate the component responsible for the failed condition before selecting a remedy.

Use the path to ask the next measurement question

This model helps locate missing work in a response budget and distinguish setup from reuse. It intentionally omits protocol negotiation detail, packet loss behavior, parallel fetching, scheduling and many browser activities. A real trace should replace the selected phases and identify overlap so the same interval is not counted twice.

Averages also hide variation. The 290 ms accounting example cannot establish how often requests meet 400 ms. Preserve the observed distribution, workload shape and client conditions when evaluating that requirement. The next latency lesson develops these distinctions using the path you can now name.

Locate the boundary

  1. A name resolves and TLS succeeds. Has price freshness been established?

    Inspect the application record

    No. Resolution and secure communication address different facts. Check the age and identity of the delivered product record under the accepted freshness rule.

  2. Which chosen time remains after all three setup terms are avoided?

    Remove only the terms actually reused

    80 + 40 + 30 = 150 ms. This assumes the remaining work is unchanged and setup is fully avoided; a reused connection does not remove application waiting or payload transfer.

  3. Does the 290 ms example prove the 400 ms requirement for the promotion?

    Distinguish a budget from measured outcomes

    No. It is a sum of selected phase times. Measure qualifying client outcomes under the declared workload and retain variation, failures and missing observations.

Northwind can now name the phases that contributed to the selected 290 ms cold path. Page 06 opens that budget: the same customer deadline cannot be spent afresh by every downstream call.

Northwind decision log

Label the selected protocol and connection-reuse state.
Measure through the client event promised by the requirement.
Keep protected delivery, response status and valid product content as separate observations.

Go deeper: names, transport and applications