Computer Networks
Opening a connection…
Initializing Sorting Algorithms...
Sorting
Trees
Graphs
Preparing interactive visualizations...
Computer Networks
Opening a connection…
Every connection is a stack of small agreements. Watch a message gain its headers, a TCP window slide, cwnd saw up and down, and routing tables argue their way to the same answer.
A message travels down the stack gaining a header per layer, crosses the wire as bits, and is unwrapped layer by layer on the way up.
1 header per layer58 B of framingEncapsulationSYN, SYN-ACK, ACK with real sequence numbers, both endpoints walking their state machines, then the FIN teardown and TIME_WAIT.
1.5 RTT to open11 TCP statesThree-Way HandshakeStop-and-Wait, Go-Back-N and Selective Repeat with packets and ACKs in flight, losses you inject, timeouts and a window that slides.
W packets per RTTO(W) bufferARQcwnd plotted round by round: slow start, ssthresh, additive increase and multiplicative decrease, and why Reno treats three duplicate ACKs gentler than a timeout.
cwnd per RTTO(1) stateAIMDA stub resolver asks a recursive resolver, which walks root, TLD and authoritative servers — then answers the next lookup from cache until the TTL runs out.
3 referrals cold, 0 warmcache bounded by TTLIterative ReferralAn IPv4 address as 32 bits under a mask: network and broadcast addresses, the usable host range, and whether two hosts share a subnet.
O(1) AND32 bitsBitmaskingRouters trade distance tables Bellman-Ford style until they converge — then a link fails, bad news counts to infinity, and poison reverse steps in.
O(diameter) roundsO(V) per routerBellman-FordLink-state advertisements flood the network until every router holds the same map, and each one runs Dijkstra for its own forwarding table.
O(E log V) per routerO(V + E) mapFlooding + DijkstraAn ARP request is broadcast and answered, and a switch learns which MAC lives on which port: flood while the destination is unknown, forward once learned.
O(1) table lookupO(hosts) tableLearn / Flood / ForwardHead-of-line blocking three ways: queued responses in HTTP/1.1, one lost TCP segment stalling every HTTP/2 stream, and QUIC isolating streams over UDP.
HOL per version1 connectionMultiplexingOne packet hop by hop: the subnet test, the default gateway, NAT, longest prefix match, TTL and the BGP announcements behind every routing table.
hop by hop20-byte headerLongest Prefix MatchCertificate chains, Diffie-Hellman key exchange and the one-round-trip TLS 1.3 handshake that sits between TCP and HTTP.
1 RTT (TLS 1.3)O(1)Asymmetric → SymmetricHTTP verbs, status codes, headers and statelessness — the request/response contract that rides on top of everything in this section.
O(1) requeststatelessRequest/ResponseThe whole trip end to end — DNS, the TCP and TLS handshakes, the HTTP exchange and rendering — before this section takes each piece apart.
~300ms cold8 stagesFull StackWhat happens to the bytes once HTTP has delivered them: DOM, CSSOM, layout, paint and compositing.
per frame8 actsCritical Render PathA page load pays for a DNS lookup, a TCP handshake and a TLS handshake before the first byte of HTML. Counting round trips explains most of what makes a site feel slow.
IP drops, duplicates and reorders packets. Sequence numbers, windows, timeouts and congestion control are how TCP manufactures a clean byte stream out of that.
Is it DNS, the subnet mask, an ARP cache, a routing loop or head-of-line blocking? Knowing which layer owns a symptom is most of the work in fixing a network fault.