Networking and Edge: recap and quiz
The module in six sentences
Section titled “The module in six sentences”- DNS. A name becomes an address by following delegations from the root, a cache removes round trips, and a time to live trades fewer lookups against slower changes.
- TCP and UDP. TCP gives a reliable ordered stream and costs a round trip to set up, UDP gives datagrams and promises nothing, and a loss holds back everything behind it in TCP.
- TLS handshakes. A secure connection costs round trips, two for TLS 1.2, one for TLS 1.3 and one for QUIC including the transport, and 0-RTT trades one more round trip for the risk of replay.
- HTTP versions. HTTP/1.1 sends one request at a time and uses several connections, HTTP/2 shares one TCP connection among streams, and HTTP/3 does so over QUIC without stalling every stream on a loss.
- Connection pooling. A connection costs round trips to open and nothing to reuse, a pool is sized by Little’s Law, and an idle connection can be closed by the other side.
- CDNs, edge caching and anycast. An edge hit costs one short round trip, a miss adds the trip to the origin, the hit rate sets both the average and the origin’s load, the short connection helps even a miss, and anycast routes a client to a nearby site but can break a connection if routing changes.
What each one does to the round trips
Section titled “What each one does to the round trips”| Idea | The common mistake | The correction |
|---|---|---|
| DNS | Forgetting that a lookup is a dependency, or that a lower TTL helps at once | Count its round trips, and lower the TTL one old TTL before a change |
| TCP | Treating the connection as free | One round trip before data, and a loss holds back what is behind it |
| TLS | Blaming the cryptography | The cost is round trips: 4, 3 or 2 in all with TLS 1.2, TLS 1.3 or QUIC |
| HTTP versions | Assuming a newer version always wins | Each trades handshakes, connections and loss behaviour, and the gain grows with distance |
| Connection reuse | Opening a connection per request | Pay the handshake once, and size the pool for the slow case |
| CDN | Looking only at the hit | The average is the hit rate’s mix, and a cold edge sends everything to the origin |
| Anycast | Using it for long connections without checking routing | It suits short exchanges, and a routing change breaks a connection |
A list: estimate a request
Section titled “A list: estimate a request”“It is slow because it is far” is not a diagnosis. Count round trips.
- Which round-trip time? To the edge, or to the origin. The floor is distance ÷ 100 ms.
- What is paid to start? DNS if nothing is cached: the device’s own round trip and up to three to the servers. Then TCP: one. Then TLS: one for TLS 1.3, two for TLS 1.2, none extra for QUIC.
- Is the connection reused? If it is, the request costs one round trip and the server’s time.
- Is the answer in a cache? A hit costs the round trip to the edge. A miss adds the edge’s trip to the origin and the origin’s time.
- What does a loss cost? With TCP, at least a round trip for every stream on the connection. With QUIC, for the streams it carried.
Check what you have learnt
Section titled “Check what you have learnt”Eight questions cover the whole module. Every option is explained, whether it is right or wrong.
Networking and Edge: module quiz
This quiz needs JavaScript to check your answers.
What comes next
Section titled “What comes next”The next module, Capacity Estimation, turns to a different question about the same system: how much of it is needed. You have seen that a request has a time. Next it gets a number: how many requests per second, how much to store, how much bandwidth, and what it costs.
Your progress
Built by GhaziAlibi.
© ShardCraft. All rights reserved.