Kayavak / Foundations of Computing / CS·09 Networking Fundamentals / Deeper
Deeper · Foundations of Computing
Networking Fundamentals
The questions the chapter doesn't stop for: why this exists, the model to keep in your head, what changes when an assumption does, how sure we are of each claim, and what's still open. Read it after the chapter; back to the chapter.
Why does this exist?
Telephone networks reserve a whole circuit for each call, which is wasteful for computers that send short bursts with long silences. In the early 1960s Paul Baran at RAND, looking for networks that could survive damage, and Donald Davies at Britain's National Physical Laboratory, looking for efficient computer communication, independently proposed packet switching: chop data into small blocks that travel separately and share the lines. ARPANET sent its first message in October 1969.
As other networks appeared (radio, satellite), they needed to interconnect. Vint Cerf and Bob Kahn's 1974 paper described a protocol for joining different networks through gateways; it split into TCP and IP, and the ARPANET switched to TCP/IP on 1 January 1983. Names came next: Paul Mockapetris designed DNS in 1983 to replace a single, hand-edited hosts file. In 1986 the network suffered "congestion collapse", throughput between two neighbouring sites in Berkeley falling by a factor of about a thousand, until Van Jacobson's 1988 algorithms made TCP back off when packets are lost. Netscape's SSL (1995) added encryption for the commercial web, now TLS 1.3 (2018); QUIC (2021) and HTTP/3 (2022) moved reliable, encrypted streams onto UDP.
The mental model
Try it yourself first: write your own model in the Mental Model Explorer, then compare.
The network makes one promise: it will try to deliver a packet. Everything you rely on (ordering, reliability, names, security) is built on top, at the ends, by protocols that assume the middle may drop, delay, reorder or read anything.
| Question | Answer |
|---|---|
| What is it? | A stack of protocols, each using the one below and offering something more to the one above |
| Problem it solves | Moving data between programs on different machines across networks owned by different people |
| Parts | Link (frames on a wire or radio), IP (addressed packets, routing), transport (TCP, UDP, QUIC), application (DNS, HTTP, TLS) |
| How it works | Each layer wraps the data in its own header; routers look only at IP; the ends handle reliability and encryption |
| Assumptions | Best-effort delivery; the ends are smart and the middle is simple (the end-to-end argument) |
| When they change | Middleboxes that inspect or rewrite traffic (NAT, firewalls) make new protocols hard to deploy: one reason QUIC encrypts its headers and runs over UDP |
| Where it fails | Latency is bounded by the speed of light; partitions happen; DNS and certificates are single points of trust |
| Related ideas | Sockets are an OS API (ch08); distributed systems build on unreliable messages (Distributed Systems) |
What if?
What if TCP had no congestion control?
Reason it through, then open
Every sender would transmit as fast as its own link allowed. Routers' queues would overflow, packets would be dropped, and senders would retransmit them, adding more load. The network would spend its capacity carrying copies that get dropped again: congestion collapse, which is what happened in 1986. Congestion control makes each sender slow down when loss or delay signals a full queue, sharing the bottleneck instead of fighting over it.
What if TCP never retransmitted lost packets?
Reason it through, then open
You'd have UDP with a connection handshake: data arrives in order when it arrives, but gaps stay gaps. Every application would need its own recovery, which is exactly what real-time voice and video do over UDP, preferring a brief glitch to waiting for a late packet. For files and web pages, where every byte matters, each application would end up reinventing retransmission.
Where the boundary is
| Aspect | TCP | UDP |
|---|---|---|
| Delivers | An ordered, reliable byte stream | Independent datagrams, maybe lost, duplicated or reordered |
| Setup | A handshake before data | None |
| Message boundaries | None: applications must frame messages | Each datagram is one message |
| Congestion control | Built in | Up to the application (QUIC adds it) |
| Use for | Web, databases, files, most APIs | DNS queries, real-time media, games, and as the base for QUIC |
Derive it
How big a TCP window must be to fill a link.
- TCP can have at most one window of unacknowledged data in flight; it then waits for acknowledgements, which take one round trip.
- So the best throughput is window ÷ RTT.
- To fill a link of bandwidth B, the window must be at least B × RTT: the bandwidth-delay product.
- Mumbai to London is about 72 ms round trip. To fill 100 Mbit/s: 100 × 10⁶ bit/s × 0.072 s = 7.2 Mbit, about 900 KB in flight.
- The original TCP header allows a window of only 64 KB: 64 KB ÷ 72 ms ≈ 7 Mbit/s, whatever the link speed. That's why the window-scaling option (RFC 1323, 1992) exists, and why long, fast paths still need tuned buffers.
How sure are we?
| Claim | How it's known | Where from |
|---|---|---|
| Throughput ≤ window ÷ RTT | Theorem | Follows from how sliding windows work |
| Light in fibre travels about 200 km per ms | Measured | Physics of glass (refractive index about 1.5) |
| Congestion collapse in 1986 | Historical | Jacobson, Congestion Avoidance and Control, 1988 |
| The four-layer model | Model | The OSI seven layers and real protocols (TLS, QUIC) don't fit cleanly in either model |
Still open
Congestion control is still an active field: BBR models the bottleneck instead of reacting to loss, and how fairly it shares links with older algorithms is debated. So is how to evolve a network full of middleboxes, how to secure routing (BGP hijacks still happen), and how to make DNS private without concentrating it in a few resolvers.
What would change your mind? If most traffic moved to networks that guarantee delivery and timing end to end, the "smart ends, simple middle" design would no longer be the whole story. Some data-centre networks already move in that direction.
Recall
What is the bandwidth-delay product, and why does it matter?
Bandwidth × RTT: the amount of data that must be in flight to fill a link, so the TCP window must be at least that large.
What happened in 1986 that led to TCP congestion control?
Congestion collapse: throughput fell about a thousandfold because senders kept retransmitting into full queues.
Why must applications frame their own messages over TCP?
TCP delivers a byte stream with no message boundaries; one send may arrive as several reads or be merged with others.
What does the end-to-end argument say?
Functions like reliability and security belong at the endpoints, because only they can check them fully.
Why does QUIC run over UDP?
Middleboxes block or interfere with new transport protocols; UDP passes through, and QUIC adds reliability and encryption on top.
Reflect
Be honest with yourself; this stays in your browser. Anything you can't tick yet is what to revisit.