The Design Principles of the Internet: End-to-End, Fate Sharing, Error and Flow Control
The ideas that decide where each job lives in TCP/IP: the end-to-end argument, fate sharing, best-effort delivery, and error and flow control at the hosts, shown with real lab runs of packet loss, corruption and a router outage.
kvi5hnuCode Sprout team member18 min readOn this page
Article 1 showed that IP is a datagram protocol: routers forward each packet on its own and keep no record of connections. That leaves an obvious question. If the network doesn't keep track of anything, who makes sure data arrives complete, in order and at a rate the receiver can handle?
The answer comes from two design principles, the end-to-end argument and fate sharing. Together they explain why the Internet is often described as a "dumb network with smart hosts", and why the features you depend on every day, from reliable downloads to encryption, live in your computer and the server rather than in the routers between them.
The end-to-end argument
When you design a large system, you constantly have to decide where a feature belongs. Should the network guarantee delivery, or should the hosts? Should each link encrypt traffic, or should the application?
The end-to-end argument, published as a paper in 1984, gives a rule of thumb. Paraphrased:
A function can be implemented completely and correctly only with the knowledge and help of the application at the endpoints. So the communication system can't provide that function fully by itself. It can sometimes provide a partial version, as a performance improvement.
The classic example is file transfer. Suppose every link in the path checked and repaired errors perfectly. The file could still be damaged:
- A router could flip a bit in its memory after receiving a frame correctly and before sending it on.
- The sending host could read the wrong data from disk.
- A bug in the receiver's software could write the data to the wrong place.
None of these happens on a link, so no link check can catch them. The only check that covers everything is one done by the applications at the two ends, for example comparing a hash of the file the receiver wrote with a hash of the file the sender read. And if the ends must do that check anyway, making every link perfect is wasted effort.
The diagram shows this. Each link checks only its own hop with a CRC (cyclic redundancy check, a checksum the link hardware adds to every frame). A bit flipped inside router 2 happens between two of those checks, so only the end-to-end check sees it.

The parenthetical part of the argument matters too. Lower layers may do partial work when it helps performance. Wi-Fi retransmits lost frames on the radio link, because losing one packet in ten over the air and waiting for TCP to notice would make Wi-Fi painfully slow. That local retry doesn't make the end-to-end check unnecessary. It just makes the common case faster.
The argument applies to more than errors. Encryption is the clearest modern example. Encrypting each link (as Wi-Fi's WPA3 security does) protects you from someone on that link, but every router and Wi-Fi access point still sees the plaintext. Only encryption between the endpoints, such as TLS (Transport Layer Security, the encryption behind HTTPS web pages) or QUIC (a newer transport protocol with encryption built in), protects the data across the whole path. That's why the web moved to HTTPS everywhere instead of relying on encrypted links.
Fate sharing
The end-to-end argument says what the endpoints should do. Fate sharing says where state should be kept. The principle is to keep the state for a conversation in the same place as the parties to the conversation, that is, in the end hosts.
The reasoning is simple. If the only state for a TCP connection is in the two hosts, the only failure that can destroy the connection is the failure of one of those hosts, and if a host fails the conversation is over anyway. A router failing doesn't destroy anything: no state was stored there. Packets find another route, or wait until the path comes back, and the connection carries on.
Together, the two principles produce the layout most of this course is built on:

Watching fate sharing work
This is easy to see in the lab. A client sent a steady 4 Mbit/s TCP stream to a server through router r1, with 20 ms of delay on the path. Five seconds in, the router was made to drop every packet for five seconds, as if it had crashed and rebooted. Halfway through the outage, the client's TCP state looked like this (from ss -ti, the Linux socket statistics tool that article 6 introduces, trimmed to the interesting fields):
ESTAB 0 131072 192.0.2.10:41580 198.51.100.10:5201
cubic rto:1792 backoff:3 rtt:23.308/2.211 cwnd:1 ssthresh:63 lastsnd:725 lastack:2643 unacked:91 retrans:1/4 lost:91
The first line shows the connection's state, its receive queue (0 bytes) and send queue (131,072 bytes waiting to be delivered), then the local and remote address. The second line is TCP's internal state. The connection is still ESTAB (established). The sender has 91 segments it believes are lost (lost:91), has cut its congestion window (cwnd, the amount of data it lets itself have in flight) to one segment, and has backed off its retransmission timer (rto, in milliseconds) three times. It isn't giving up. It's waiting and retrying. (cubic is the name of the congestion control algorithm, and rtt:23.308/2.211 is the measured round-trip time and its variation in milliseconds. The other fields are covered in the TCP articles later in the course.)
The client's capture shows those retries. Each time the timer expired, TCP sent the oldest unacknowledged segment again, and each time it waited about twice as long before the next try:
outage from 5.00 s to 10.03 s (time since capture start)
retransmission of the oldest unacked segment at 5.39 s
retransmission of the oldest unacked segment at 5.85 s (+0.46 s)
retransmission of the oldest unacked segment at 6.79 s (+0.94 s)
retransmission of the oldest unacked segment at 8.65 s (+1.86 s)
retransmission of the oldest unacked segment at 12.30 s (+3.65 s)

Three lessons are in that graph:
- The connection survived. No data was lost from the application's point of view, and neither program noticed anything except a pause. The router held no state about the connection, so its "crash" broke nothing that couldn't be repaired from the ends.
- Recovery waited for the next retry, not for the network. The path was back at about 10.1 seconds, but no data moved until the retransmission at about 12.3 seconds. The sender can't know the path is back until a retry succeeds. This doubling of the wait, called exponential backoff, protects a struggling network from a flood of retries, at the cost of slower recovery. Article 65 covers it in detail.
- After the pause, the backlog was delivered quickly. The steep climb is the data the sending program had queued during the outage.
There's an important exception to fate sharing in today's Internet. Firewalls, NAT (network address translation) devices and load balancers do keep per-connection state. If your home router reboots during a download, the connection usually dies, even though the outage was short, because the router forgot the address mapping the connection depended on. Article 35 shows this in detail. It's one of the main tensions in the modern Internet: these "middleboxes" are useful, but they break the principle that kept connections robust.
Error control: best effort plus repair at the ends
Data gets damaged or lost for many reasons: electrical noise, a weak Wi-Fi signal, a faulty cable, cosmic rays flipping bits in memory, and most often a router queue that's full. Handling this is called error control, and it can happen in the network, at the ends, or both.
There are two basic tools:
- Error-detecting and error-correcting codes. A small amount of extra data lets the receiver detect damage, and with stronger codes repair a few damaged bits on the spot. Every modern link does this. Ethernet frames carry a 32-bit CRC that detects damage. High-speed Ethernet links (many 25 and 100 Gbit/s links, and every 200 Gbit/s and faster one) and all Wi-Fi and cellular radios also use forward error correction (FEC) codes that repair bit errors without resending.
- Retransmission. When damage is too severe to repair, or a packet is simply gone, the whole packet is sent again.
Older connection-oriented networks such as X.25 did retransmission inside the network, at every hop. The Internet chose a different service, called best-effort delivery: IP tries to deliver each datagram, but makes no promise. If a router finds a datagram whose header is damaged, or has no room in its queue, it simply discards the datagram and does nothing else. There's no retry and usually no notice.
That might sound careless, but it fits the end-to-end argument. Plenty of applications don't want the network retransmitting for them. A video call would rather skip a lost packet than wait for a copy that arrives too late to play. Even a file transfer doesn't need data delivered in order on every hop. It needs all the pieces eventually, checked at the end. So IP offers the minimum, and each transport protocol adds what its applications need.
Best effort in the lab
The lab made the client's link lose 10% of packets at random, then sent 1,000 UDP datagrams and a 2,000,000-byte file over TCP. UDP, which adds no reliability, delivered what got through:
sender sent 1000 datagrams of 500 bytes
receiver got 911 of 1000 datagrams
TCP, over the same lossy link, delivered every byte. The matching hashes show the received file was identical to the sent one:
receiver got 2000000 bytes, sha256 8a4c1c297a6a5d58...
sender sent 2000000 bytes, sha256 8a4c1c297a6a5d58...
sender retransmitted segments: 45
Then the link was set to corrupt 5% of packets instead, flipping a random bit in each. Corrupted packets weren't delivered damaged. The receiving host checked each UDP checksum, found the damage and dropped those datagrams, and counted them. The counters below are the kernel's own error statistics, read with nstat:
sender sent 1000 datagrams of 500 bytes
receiver got 949 of 1000 datagrams
IpInHdrErrors 0
UdpInCsumErrors 50
Udp6InCsumErrors 0
Almost every missing datagram shows up as a UDP checksum error (UdpInCsumErrors; Udp6InCsumErrors is the same counter for IPv6, unused here). The one remaining datagram was damaged in a part of the frame that made the receiver discard it before UDP saw it, for example in the Ethernet destination address or type field. (It wasn't the IP header: a failed IP header checksum would have counted in IpInHdrErrors, which stayed at 0.) Either way, the application never saw a damaged datagram. It just saw fewer of them. That's best effort: damage turns into loss, and loss is something the ends know how to handle.
How strong is the end-to-end check?
TCP and UDP carry a 16-bit checksum over their header and data, computed end to end. It catches most damage, but it's weak by modern standards: some combinations of errors, such as two swapped 16-bit words, slip through. Studies of real traffic have found damaged packets that passed both the link CRC and the TCP checksum. In practice:
- For most traffic, the TCP checksum plus the link CRC is good enough.
- When you use TLS or QUIC, every record carries a cryptographic integrity check, which catches any change, accidental or deliberate. Since most Internet traffic is now encrypted, this is the end-to-end check that really protects most data today.
- For stored data, such as backups and downloads, applications add their own hash, such as SHA-256. That's the end-to-end argument in its purest form.
Article 24 shows exactly how the Internet checksum is computed and what it misses.
Flow control: not overwhelming the receiver
Suppose delivery works perfectly. A fast sender can still produce data faster than a slow receiver can process it, and the receiver's buffer will overflow. Slowing the sender to match the receiver is flow control.
In a best-effort IP network, the routers don't do this. It's done above IP, at the ends. TCP's receiver tells the sender, in every acknowledgment, how much buffer space it has left (the receive window), and the sender never sends more than that. Article 69 covers TCP's flow control in detail.
Don't confuse flow control with congestion control, the other kind of rate control TCP does:
| Flow control | Congestion control | |
|---|---|---|
| Protects | The receiver | The network between the hosts |
| Signal | The receiver's advertised window | Packet loss, delay, or ECN marks (Explicit Congestion Notification: a router marks a packet instead of dropping it) |
| Who limits the rate | The receiver, explicitly | The sender, by inference |
| Covered in | Article 69 | Article 72 |
Both are implemented in the end hosts, which fits both principles: the ends know their own capacity best, and if the network fails partway, the ends still hold everything needed to carry on.
The ongoing tension
The "smart ends, dumb network" picture was never perfectly true, and it's less true today. Networks now contain many devices that look inside packets and keep state: firewalls, NAT, load balancers, caches, and devices that speed up TCP or rewrite traffic. These middleboxes solve real problems, but they also make the Internet harder to change, because new protocols must avoid confusing them. This problem is called ossification.
One response is to hide more from the network. QUIC, the transport under HTTP/3, encrypts almost all of its own headers, partly so middleboxes can't depend on, or interfere with, details that its designers want to be free to change. Article 86 covers QUIC. In a sense, it's the end-to-end argument being reapplied to a network that had drifted away from it.
Common questions
Does the end-to-end argument mean lower layers should do nothing about errors?
No. It says lower layers can't do the whole job, so the ends must check anyway. Lower layers should still fix problems that are common on their link, if doing so improves performance. Wi-Fi retransmitting lost frames over the air is a good example, as are the error-correcting codes on fast fiber links.
If IP is best effort, why does it have a header checksum?
To protect the routing decision. A damaged destination address could send the packet somewhere it doesn't belong, so an IPv4 router checks the header checksum and drops the packet if it fails. It doesn't check the payload: that's left to the transport protocol at the end. IPv6 dropped the header checksum altogether, as article 23 explains, because links and transport checksums already cover it.
Why didn't my download survive when my home router rebooted?
Because your home router does NAT, and NAT keeps state for every connection. When it rebooted, it lost the mapping between your private address and port and its public ones, so the server's packets no longer reached you. A plain router with no NAT or firewall state would have let the connection survive, as in the lab.
How long will TCP keep retrying before it gives up?
On Linux, by default, about 15 minutes for an established connection (controlled by net.ipv4.tcp_retries2, default 15 retries with exponential backoff). Windows and macOS give up sooner. Applications can set a shorter limit with the TCP_USER_TIMEOUT socket option. Article 65 covers the details.
What's the difference between "best effort" and "unreliable"?
They describe the same service from different angles. "Best effort" says the network tries to deliver without promising anything, and "unreliable" says there's no guarantee. Neither means packets are usually lost: on a healthy network almost all of them arrive.
Is encrypting each link enough to protect my data?
No. Link encryption protects data only on that link. Every device where the link ends, such as a Wi-Fi access point, a router or a corporate proxy, sees the plaintext. End-to-end encryption such as TLS protects the data along the whole path. This is the end-to-end argument applied to security.
Does UDP do flow control?
No. A UDP sender can send as fast as it likes, and if the receiver's buffer is full, the receiving host drops the extra datagrams. Applications built on UDP, such as QUIC or video conferencing, add their own flow and congestion control.
Summary
- The end-to-end argument says functions such as reliable delivery, integrity and encryption can only be done completely at the endpoints. Lower layers may add partial help for performance.
- Fate sharing puts connection state in the end hosts, so only an endpoint failure can destroy a connection. In the lab, a TCP connection survived a five-second router outage, with retries at doubling intervals and recovery on the first retry after the repair.
- IP offers best-effort delivery: damaged or excess datagrams are dropped, with no retry. In the lab, UDP lost about 9% of datagrams under 10% random loss, while TCP delivered all 2,000,000 bytes intact. Corrupted packets were dropped by checksum checks, so damage turned into loss.
- Error control uses codes (detection and correction, on every link) and retransmission (end to end, in TCP and QUIC). TLS and QUIC add strong cryptographic integrity checks.
- Flow control protects the receiver and congestion control protects the network. Both live in the end hosts.
- Stateful middleboxes such as NAT and firewalls break fate sharing, and their influence on protocol design is called ossification.
Practice questions
1. A storage team copies files across a data-center network that has CRCs on every link and error-correcting memory in every switch. Should they still check a hash of each file after copying? Why?
Answer
Yes. Link CRCs and switch memory protection don't cover everything: the sending or receiving host can read or write the wrong data, software can have bugs, and some errors slip through link checks. Only a check done by the applications at both ends covers the whole path, which is the end-to-end argument.
2. In the lab outage, the path was back at about 10.1 seconds, but data didn't flow again until about 12.3 seconds. Why?
Answer
The sender had no way to know the path was back. It was waiting for its retransmission timer, which had doubled after each failed try (about 0.46, 0.94, 1.86, then 3.65 seconds). The next retry was due at about 12.3 seconds, and only when it was acknowledged did the sender learn the path worked and resume.
3. Which of these keep per-connection state that can break a TCP connection if they reboot: a plain IP router, a NAT device, a stateful firewall, an Ethernet switch?
Answer
The NAT device and the stateful firewall. A plain router and an Ethernet switch keep no per-connection state (a switch keeps a table of MAC addresses, the hardware addresses of Ethernet cards, but it relearns that within moments).
4. A sender is limited by a small receive window advertised by the receiver. Is this flow control or congestion control?
Answer
Flow control. The receive window is the receiver's explicit statement of how much buffer it has. Congestion control is the sender's own limit based on signs of network congestion such as loss, delay or ECN marks.
5. Why does Wi-Fi retransmit lost frames itself, when TCP would retransmit them anyway?
Answer
For performance. Radio links lose frames far more often than wires. If only TCP retransmitted, every loss would cost at least a full round trip plus a timeout or several duplicate acknowledgments, and TCP would also treat each loss as congestion and slow down. Retrying locally takes a fraction of a millisecond. This is the "partial implementation as a performance improvement" allowed by the end-to-end argument.
6. In the corruption lab, the application received fewer datagrams but never a damaged one. What did that?
Answer
The receiving host's UDP checksum check. It recalculated the checksum of each arriving datagram, found that it didn't match for the corrupted ones, discarded them and counted them in UdpInCsumErrors. Best-effort delivery turns damage into loss.
Previous: What TCP/IP Is: Packets, Datagrams, Connections and Packet Switching
Next: Layering and Encapsulation: OSI, the TCP/IP Model and How Headers Nest

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.