Follow one request across the network
Picture
A name resolves to an address. A connection reaches a server. TLS protects the connection. HTTP carries the request and response.
Predict
Does a timeout prove a write never committed?
Walk through the small example
No. The server may have committed before the response was lost.
Mental model and runnable Python model
Trace browser or client → DNS → connection/TLS → load balancer → application → storage → response. This is a conceptual path, not a fixed number of network round trips: caches, connection reuse, protocol versions, proxies, and multiplexing change setup. HTTP is a request/response contract; WebSockets keep a bidirectional connection for suitable real-time workloads. Encryption in transit does not replace authentication or per-object authorization. End-to-end deadlines should propagate remaining budget to downstream calls.
What the function promises: The Python model subtracts measured sequential stage durations from a deadline. It does not simulate DNS, TLS, or a network stack.
def remaining_budget(deadline_ms, sequential_stage_ms):
if deadline_ms < 0 or any(t < 0 for t in sequential_stage_ms):
raise ValueError("Durations must be nonnegative")
return max(0, deadline_ms - sum(sequential_stage_ms))
assert remaining_budget(300, [20, 40, 80]) == 160
assert remaining_budget(100, [80, 40]) == 0
Work and storage: O(number of sequential stages). Parallel stages need a dependency-aware critical-path model, not blind addition.
When to recognize it: A deadline must cover the whole operation. A timeout does not prove the server did nothing; its response might simply be lost.
Check before applying it: A timeout is uncertain execution, and a diagram does not fix exact protocol round trips.
Change one rule
Two independent downstream calls run in parallel. Is their elapsed contribution the sum?
See what changes
Not generally; it is governed by the slower completion plus coordination overhead. Also, adding individual p99 values does not automatically produce the end-to-end p99.
Connect
Start with the system’s promises: Trace the operation whose latency and availability were promised.
Share traffic across replaceable workers: A load balancer adds routing and health decisions along this request path.