Every byte you send rides in an IP packet that may be lost, and TCP turns those packets into a reliable stream by numbering bytes, waiting for acknowledgements and never having more than one window unacknowledged, so one connection moves at most one window per round trip. Almost every slow transfer, stalled token stream or hung training job traces back to that sentence, or to one of the boxes that rewrite or drop packets on the way.
Each layer adds one header and one promise; a streamed token pays 52 bytes of header for 124 of data. Fig. 1 follows one token down the server's stack, across two routers and up the client's.
You need nothing beyond what an engineer who has called an HTTP API knows. The overview of one LLM request through every layer is section 4 of Topic: protocols; this page is the depth under it. The running example is that root's streaming request: 277 bytes up, then Server-Sent Events, one small write per token about 50 ms apart. Later sections scale it up to the transfer that hurts most in ML work, a checkpoint of hundreds of gigabytes across a long path.
| IP | TCP | UDP | QUIC | |
|---|---|---|---|---|
| Gives you | an address for every machine; packets forwarded hop by hop | a reliable, ordered, flow- and congestion-controlled byte stream between two sockets | ports and a checksum on single messages | reliable, encrypted, independent streams in one connection, plus unreliable datagrams if wanted |
| Costs | nothing guaranteed: loss, reordering, duplicates | one round trip to open; head-of-line blocking; one stream capped at window / round trip | you write reliability and pacing yourself | user-space CPU; UDP blocked on some networks |
| Header | 20 bytes (IPv4, no options), 40 (IPv6) | 20 bytes, usually 32 with timestamps | 8 bytes | after the first packets, a short header (1 flag byte, a 0 to 20 byte connection ID, a 1 to 4 byte packet number, RFC 9000 s17.3.1), inside UDP's 8 |
| Defined in | RFC 791 (1981), RFC 8200 (2017) | RFC 9293 (2022, replaces RFC 793) | RFC 768 (1980) | RFC 9000, 9001, 9002 (2021); v2 RFC 9369 |
| Where you meet it | VPC subnets, pod IPs, MTU limits | every HTTP/1.1 and HTTP/2 call, gRPC, torch.distributed rendezvous, S3 uploads | DNS, NTP, RoCEv2 between GPUs | HTTP/3 to browsers and CDNs |
Not here: name lookup (DNS), encryption (TLS and certificates), request semantics (HTTP), SSH, GPU fabrics (Interconnects and scaling) and the event loop that serves many sockets (Concurrency). Labels: measured here, illustrative, derived (with its formula).
measured marks what was run for this page on 5 October 2026 on an Apple M1 Pro laptop (macOS 27.0.1, Python 3.13.5, aioquic 1.3.0) on a home broadband line, on loopback or against public test endpoints; illustrative marks a picture of a shape rather than data; derived numbers show their formula. Linux behaviour is taught from the kernel source and documentation.
IP gives every network interface an address, puts source and destination on every packet, and lets each router forward it one hop closer. That is the whole promise: a packet can be dropped, duplicated, delayed or overtaken, and IP says nothing (RFC 791 s1.2: a datagram service with no reliability mechanisms).
An IPv4 address is 32 bits (192.0.2.7); an IPv6 address is 128 bits in hex groups, the longest run of zero groups shortened to :: (2001:db8::7). Addresses are handed out as prefixes in CIDR notation (RFC 4632): 10.0.0.0/16 is every address whose first 16 bits match, 232−16 = 65,536 addresses. A VPC is a prefix, its subnets are longer prefixes inside it, and a router's table is a list of prefixes with a next hop each; the longest matching prefix wins.
Three reserved blocks cause most address incidents in ML infrastructure:
10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 (RFC 1918) are reused inside every company, VPC, Docker bridge and Kubernetes cluster. Two networks that both picked 10.0.0.0/16 cannot be peered or joined by VPN without renumbering one: the router cannot tell which 10.0.3.4 you mean.100.64.0.0/10 (RFC 6598) is for carrier-grade NAT, and some Kubernetes and overlay setups also use it, so they collide.169.254.0.0/16 (RFC 3927) never leaves the link; clouds put the instance metadata service at 169.254.169.254 (AWS IMDS), so an agent that can fetch arbitrary URLs from a VM can read that VM's credentials (server-side request forgery; the DNS page covers the rebinding variant).IPv6 has a private block too, unique local addresses fc00::/7 (RFC 4193), but its point is that every device can have a global address and NAT (section 9) is not needed. When a name has both an IPv6 (AAAA) and an IPv4 (A) address, clients race them with Happy Eyeballs (RFC 8305): prefer IPv6, start IPv4 if it has not connected within a short delay (250 ms recommended), keep the winner. A broken IPv6 path therefore costs a quarter of a second per connection, not a failure.
10.0.0.0/8 and 10.100.0.0/16 be peered? Try 100.64.0.0/10 and 172.31.0.0/16 (the AWS default VPC) too.Every IPv4 packet carries a time to live (TTL; in IPv6 the hop limit) that each router decrements; at zero the router drops it and returns an ICMP "time exceeded" (ICMP is IP's control-message protocol: errors, and echo, which is ping). That stops a routing loop from circulating a packet forever, and it is how traceroute and mtr map a path. ICMP also carries the "packet too big" signal section 10 depends on, which is why "block all ICMP" breaks things.
| IPv4 (RFC 791) | IPv6 (RFC 8200) | |
|---|---|---|
| Address | 32 bits, about 4.3 billion, exhausted | 128 bits |
| Header | 20 bytes without options, with a header checksum | 40 bytes fixed, no header checksum, options moved to extension headers |
| Fragmentation | routers may split a packet unless the Don't Fragment bit is set | routers never fragment; only the sender may, so path MTU discovery is mandatory in practice |
| Smallest MTU every link must carry | 68 bytes (RFC 791) | 1,280 bytes (RFC 8200 s5) |
Dual stack is the normal case. Google's share of users reaching it over IPv6 first crossed 50 percent on 28 March 2026 (50.10 percent) and stood at 51.69 percent on 3 October 2026, the latest point in its published data (fetched 5 October 2026; weekends run higher than weekdays).
How it fails. Overlapping prefixes (peering refused, or traffic silently going to the wrong network): compare route tables with ip route (Linux) or netstat -rn (macOS), and plan VPC ranges before the first cluster. No route at all: "Network is unreachable" instantly. Loss at one hop: mtr host shows loss per hop; loss that starts at one hop and continues to the end is real, loss at one hop only is usually that router de-prioritising ICMP.
An address picks a machine; a port (16 bits, 0 to 65,535) picks the program. A socket is the operating system's handle for one end of a conversation: your code reads and writes it, the kernel runs the protocol. Servers listen on a well-known port (443 for HTTPS, 22 for SSH, 29500 by convention for torch.distributed's rendezvous); the client's kernel picks a temporary ephemeral port for its end. A TCP connection is named by its 5-tuple, and the kernel at each end uses it to find the socket for every arriving packet.
Three consequences follow from the picture. Section 3 shows how TIME_WAIT turns the port count into a rate limit. Anything that rewrites addresses or ports (NAT, section 9; a load balancer) must keep a table keyed on the 5-tuple, and that table fills and forgets. And changing any element ends a TCP connection: a laptop moving from Wi-Fi to a phone hotspot gets a new address and every TCP connection on it dies, while QUIC survives the move (section 12 records it).
Three connections from one client to one HTTPS server: the protocol, both addresses and the server's port are the same, and the ephemeral source port is the only thing that tells them apart. The ephemeral range is 32,768 to 60,999 on Linux, 28,232 ports (ip-sysctl docs), and 49,152 to 65,535 on this Mac, 16,384 ports (measured sysctl net.inet.ip.portrange, the IANA dynamic range of RFC 6335).
socket() → bind(addr, port) → listen(backlog) → loop: accept() returns a new socket per client → recv/send → close()
socket() → connect(addr, port) (the kernel picks the ephemeral port and runs the handshake) → send/recv → close()
Which address the server binds matters. 127.0.0.1 (loopback) accepts only from the same machine; 0.0.0.0 (or ::) accepts on every interface. A model server bound to 127.0.0.1 inside a container is unreachable from outside even with the port published, and the client sees "connection refused" (the root's Failure lab case "Connection refused" shows the exact error text of curl, requests, httpx and Node). The reverse mistake, a notebook on 0.0.0.0 on a machine with a public address, exposes it to the internet. How one process serves thousands of sockets at once (epoll, kqueue, the event loop) is the Concurrency page's.
TCP promises the bytes and their order, not where your writes started and ended; UDP keeps each datagram whole. measured on loopback, three writes of token-000n, reader started after the writes:
So every protocol on TCP has framing: HTTP/1.1 uses Content-Length or chunk sizes, Server-Sent Events use blank lines, gRPC and HTTP/2 put a length in front of each frame. Code that assumes "one recv equals one message" passes every test on loopback and fails under load or on a real network, where segments split and merge differently.
lsof -nP -iTCP -sTCP:ESTABLISHED (macOS and Linux) or ss -tnp (Linux) lists each connection's 5-tuple and owning process; lsof -nP -iTCP:8000 -sTCP:LISTEN shows who listens on a port and on which address.
Opening: the three-way handshake. TCP numbers every byte. Each side picks a random initial sequence number (random so an attacker off the path cannot guess it and inject data, RFC 9293 s3.4.1): the client sends SYN ("my bytes start at x"), the server SYN-ACK ("mine start at y; I expect x+1"), the client ACK, with data allowed on that third segment. So a new connection costs exactly one round trip before the request leaves. measured: connect() to Cloudflare's speed-test host took 14.1 to 19.4 ms over twelve connections, against a ping round trip of 14.0 to 18.4 ms to Cloudflare's resolver: one round trip, as predicted.
Each direction closes separately: the side that has finished sending sends FIN, the other acknowledges, and a half-close is allowed (send the whole request, shut the sending side, keep reading). RST (reset) is the abrupt alternative, "this connection does not exist for me": a kernel sends it for a segment that matches no socket (a refused connection, a NAT that forgot the mapping), and an application forces one by closing with unread data.
Two of these states cause most production tickets; ss -tan (Linux) or netstat -an -p tcp (macOS) prints their names. CLOSE_WAIT piling up means your program received the peer's FIN but never called close() (a leak in your code, not the network); TIME_WAIT piling up means you open and close connections faster than you should. Fig. 2 walks the running request through both kernels:
socket(), bind() and listen(): its kernel now answers SYNs on port 443. The client has no socket yet.connect() started, both ends are ESTABLISHED and the 277-byte request is on its way. The connection moves to the accept queue until the server calls accept() (section 8). Over HTTPS, the TLS handshake comes first.Connection: close, so after the last event the server calls close(): its kernel sends FIN, "no more data from me", and enters FIN_WAIT_1.close(). A socket stuck here forever is a bug in the program, not the network.Light in fibre covers about 200,000 km per second (refractive index about 1.5), so New York to London, 5,585 km, can never take less than a 56 ms round trip (High Performance Browser Networking, chapter 1, table 1-1). Every protocol step that waits for an answer costs one of those.
That is why connection reuse matters more the farther away the API is, and why the root's On the wire tab measures cold, resumed and reused connections.
The side that closes first holds the connection in TIME_WAIT for twice the maximum segment lifetime (2 MSL), so a delayed duplicate of an old segment cannot be mistaken for data in a new connection on the same 5-tuple, and so it can resend a lost final ACK (RFC 9293 s3.6). Linux fixes it at 60 seconds (TCP_TIMEWAIT_LEN (60*HZ) in include/net/tcp.h; not a sysctl).
A client that opens a fresh connection per request (no connection pool, an embedding API called in a tight loop, a health checker) hits that wall with EADDRNOTAVAIL ("Cannot assign requested address"). The fix is reuse: a pool with keep-alive, which also saves the round trips above. Whoever closes first holds TIME_WAIT, so a server that closes idle client connections collects them too.
When the SYN gets no answer (a firewall, a security group, a host that is down) the client retries with exponential backoff; Linux's default of 6 retries gives up after about 131 seconds (tcp_syn_retries). A connect with no timeout of its own can hang for two minutes, so every client needs an explicit connect timeout, much shorter than its read timeout. The root's Failure lab records five clients' errors for "Connect timeout" against an address that never answers, and for "Connection refused" the contrast: an RST back in under a millisecond.
The SYN negotiates options that can never be added later (RFC 9293 s3.2, RFC 7323, RFC 2018): the MSS, window scaling (section 5), SACK permitted (section 4) and timestamps. On every one of this page's connections to Cloudflare the kernel reported all four plus ECN (section 6) as agreed (TCP_CONNECTION_INFO options = 15). A middlebox that strips an option from the SYN removes that feature for the life of the connection, silently.
macOS. This Mac uses an MSL of 15 s, so TIME_WAIT is 30 s (measured net.inet.tcp.msl: 15000); its netstat listed no TIME_WAIT entry after twenty closed loopback connections, so the state could not be seen here and the numbers above are Linux's.
Kernel knobs, a last resort. tcp_tw_reuse lets outgoing connections reuse a TIME_WAIT port when timestamps prove it safe (default 2, loopback only, ip-sysctl); tcp_tw_recycle, still recommended by old blog posts, was removed in Linux 4.12 because it broke clients behind NAT (commit 4396e46187ca).
The receiver keeps saying "I have every byte up to n" (a cumulative ACK); a segment sent but not yet acknowledged is in flight. If segment 5 of 10 is lost, 6 to 10 still arrive, but the receiver can only repeat "up to the end of 4": these repeats are duplicate ACKs, and the bytes of 6 to 10 wait in the receive buffer, invisible to the application, until 5 is repaired. That wait is head-of-line blocking, and it is why HTTP/2's many streams on one TCP connection all stall on one loss while HTTP/3's do not (the root's On the wire tab measured one lost packet delaying all three HTTP/2 streams and only one HTTP/3 stream).
A sender decides a segment is lost in one of two ways:
TCP_RTO_MIN (HZ / 5)), a 1 s initial value and a 120 s ceiling (tcp.h). A timeout is expensive: at least 200 ms idle, and the congestion window collapses to one segment (section 6).illustrative model with recorded inputs: the root's streaming request replayed by the model of the timeline below (delayed ACKs on, TCP_NODELAY on).
A token stream breaks fast retransmit. It needs later segments to generate duplicate ACKs, and a stream sends one small segment every 50 ms or so; if the last segment is lost there is nothing behind it. Linux's answer is RACK-TLP (RFC 8985): call a segment lost when one sent after it has been acknowledged and a reordering window has passed, and when the tail goes quiet, send a tail loss probe after about two round trips to provoke an ACK that reveals the hole.
The root's streaming request (277 bytes up; a 244-byte response head, then seven Server-Sent Events written at the times the root recorded: 2.4, 123.8, 175.1, 226.5, 278.0, 329.1 and 330.1 ms after the request arrived), replayed over one TCP connection. Time runs down, to scale. Predict first: with "Token 2 lost", which tokens does the client application see late, and why do tokens 3 to 5 wait too? Then flip Recovery.
One-way delay is half the round trip; segments up to 1,448 bytes; the receiver ACKs every second segment or after 40 ms (Linux's minimum delayed ACK) and at once for out-of-order data (RFC 5681 s4.2); the sender retransmits on three duplicate ACKs (s3.2), after a tail-loss probe at two round trips (RFC 8985 s7), or when its timer fires at RTT + 200 ms, doubling after each expiry; Nagle holds a small write while data is unacknowledged (RFC 9293 s3.7.4). No TLS (as on the root's plain port), no congestion window limit (seven small segments never reach the initial window of 10), no queueing. Real stacks differ in detail (RACK time-based detection, SACK); the order of events and the size of each wait are the point.
illustrative model with recorded inputs "Last token lost" has no later segments and no duplicate ACKs, so only the probe or the timer can notice.
In two of this page's twelve downloads the receiver held out-of-order bytes for repair (36,608 and 254,880 bytes, tcpi_rxoutoforderbytes, measured); the other ten saw none. The application never noticed: TCP repaired the holes and delivered in order, and the cost (about a round trip, a smaller window) is invisible unless you read the per-connection counters.
Retransmissions inside a data centre should be near zero; growth there is a real fabric or NIC problem. Linux: nstat -az TcpRetransSegs before and after a test, and ss -ti per connection (retrans: current/total, lost:, rto:). macOS: netstat -s -p tcp | grep -i retrans. A connection whose RTO has backed off to tens of seconds looks hung; it is waiting for its timer.
Every ACK carries the receiver's receive window, the free space left in its buffer, and the sender never has more unacknowledged bytes in flight than that (flow control). A second cap, the congestion window (section 6), protects the network; the sender may have min(receive window, congestion window) in flight. It sends one window, then waits a round trip for the acknowledgements, so at most one window arrives per round trip, however fast the link:
measured: the twelve downloads below, three per buffer; the pipe and the train of bytes in flight are drawn to the runs' windows and goodputs.
The header's window field is 16 bits, so without help the largest window is 65,535 bytes: over a 100 ms path that caps one connection at 65,535 × 8 / 0.1 = 5.2 Mbit/s whatever the link (derived). The window-scale option (RFC 7323 s2) multiplies the field by 2shift, shift at most 14 (windows up to 1 GiB), agreed once in the SYN. A middlebox that strips it, or a socket whose buffer was small when it connected, is stuck with a small window for life.
measured Twelve downloads from Cloudflare's speed-test endpoint, one TCP connection each, the receive buffer fixed with SO_RCVBUF before connect() or left to the kernel, goodput over the second half of each transfer. The prediction is the window the kernel reported over the measured smoothed RTT; the link tops out near 46 Mbit/s.
Defaults reproduce the window-over-RTT rule independently: for the two window-limited buffers goodput is within about 10 percent of window / RTT (the RTT is reported in whole milliseconds, so the prediction is only that precise); at 256 KB and with autotuning the prediction exceeds the link, and the link wins. The kernel advertised 28,728 to 29,776 bytes for a 16 KB request: macOS sizes the buffer above what you ask, so read the window the kernel reports (tcpi_rcv_wnd), not the number you passed. Raw runs: src/meas/out/tcp_path.json.
Autotuning. Modern kernels grow the receive buffer as the connection proves it needs one. In the autotuned runs the advertised window grew from 128 KB to about 0.9 to 1.4 MB within a few hundred milliseconds (measured, first run below), with a window-scale shift of 6 against 3 when the buffer was fixed small: the kernel picks the shift at connect() from the buffer size at that moment.
setsockopt(SO_RCVBUF) disables receive autotuning for that socket (tcp_rmem in ip-sysctl). A client "tuned" with a 256 KB buffer is capped at 256 KB / RTT: 21 Mbit/s on a 100 ms cross-region path (derived), far below an untuned client whose window grows to tcp_rmem's maximum (default between 128 KB and 32 MB depending on memory). Two separate knobs: net.ipv4.tcp_rmem's third value caps autotuning; net.core.rmem_max caps only explicit setsockopt calls, and its default rose from 212,992 bytes to 4 MB in Linux 6.18 (commit a6d4f25888b8), so guides that quote "208 KB" describe older kernels. For a 10 Gbit/s, 100 ms path the third value of tcp_rmem and tcp_wmem must be at least the 125 MB BDP.A transfer far below link speed with no retransmissions, and a throughput that changes with distance rather than load. ss -ti on Linux shows rcv_space, snd_wnd and cwnd; iperf3 -c host -P 1 against -P 8 demonstrates the per-connection cap to anyone who doubts it. The throughput calculator in section 13 works out which limit binds for a path you describe.
The receive window protects the receiver; nothing in it protects the routers between. If every sender sent as fast as its window allowed, router queues would overflow and throughput would collapse, as the internet did in October 1986 (Jacobson and Karels, 1988). So each sender also keeps a congestion window (cwnd), its own estimate of what the path can carry, and probes for more while watching for overload.
Slow start. A new connection starts at 10 segments (RFC 6928; TCP_INIT_CWND 10 in Linux) and adds one per ACK, doubling every round trip, until a loss or the slow-start threshold. Reaching a 125 MB window from 14.6 KB takes about log2(125 MB / 14.6 KB) ≈ 13 round trips, 1.3 s on a 100 ms path (derived); this page's home line (about 115 KB, Fig. 4) fills in about 3. A 2 KB API response finishes inside slow start, so for it latency, not bandwidth, is everything. Linux also returns to slow start after a connection has been idle for one RTO (tcp_slow_start_after_idle, default on), so a burst after a pause starts small again.
Reno: after slow start, add one segment per round trip and halve on loss, additive increase, multiplicative decrease (RFC 5681). Fair and stable, and hopeless on long fat paths: after one loss at a 10,000-segment window, one segment per 100 ms round trip needs 5,000 round trips, over 8 minutes, to get back (derived). CUBIC, the default in the Linux, Windows and Apple stacks (RFC 9438 s1; this Mac reports net.inet.tcp.use_newreno: 0 and 209 sockets on CUBIC), grows as a cubic in time since the last loss, W(t) = C (t − K)3 + Wmax with C = 0.4, cuts to 0.7 instead of 0.5, and K is the time to climb back to the window where the loss happened: back fast, careful past the old level, then accelerating. Because it runs on time, not round trips, long-RTT flows recover as fast as short ones.
The cost of filling the pipe: queues. Reno and CUBIC learn they went too fast only when a queue overflows, so they keep the bottleneck's buffer full. measured on this page's home line, ping every 100 ms with one 25 MB download in the middle: the download ran at 44.1 Mbit/s and the round trip went from a 14.4 ms median at idle to 37.0 ms while it ran: about 23 ms of queue, roughly 125 KB waiting at the bottleneck (44.1 Mbit/s × 22.6 ms, derived). Section 5's runs show it too: the window-limited downloads ended with a current RTT of 17 to 22 ms, the ones that filled the link 35 to 49 ms. Interactive traffic on that link (a video call, the next streamed token) waits in the same queue: bufferbloat.
BBR (Bottleneck Bandwidth and Round-trip propagation time, from Google) models the path instead of reacting to loss: it estimates bottleneck bandwidth and minimum RTT and paces at that rate, keeping the queue near empty. It shines on long paths with random, non-congestive loss, where CUBIC would back off for nothing, and is in Linux since 4.9 (commit 0f8782ea1497). Its current version is still an IETF draft, draft-ietf-ccwg-bbr-06 (6 July 2026), not an RFC; check what a kernel ships with sysctl net.ipv4.tcp_available_congestion_control. Only the sender chooses: on a download, the server's algorithm decides, not yours.
ECN (RFC 3168) lets a router mark a packet "congestion experienced" instead of dropping it, and the receiver echoes the mark; this Mac negotiated it on every connection recorded here. L4S (RFC 9330, 2023) builds on it for very low queueing delay; ISPs deploy it, you do not tune it on a cluster.
Inside one data centre on a clean network the default is almost always right; the wins from BBR are on long, lossy paths (cross-region replication, uploads from a home line). One BBR flow can take more than its share from CUBIC flows on a shallow-buffer link, so test before switching a fleet.
Nagle's algorithm (RFC 896, January 1984; RFC 9293 s3.7.4) was the fix for terminals sending one 41-byte packet per keystroke (40 bytes of headers, 1 of data): while any sent data is unacknowledged, hold new small writes and send them together when the ACK arrives or a full segment accumulates. On the other side, a receiver may wait before acknowledging, hoping to piggyback the ACK on a reply: a delayed ACK, under 0.5 s, with an ACK for at least every second full-sized segment (RFC 1122 s4.2.3.2). Linux delays between 40 ms and 200 ms (TCP_DELACK_MIN (HZ/25), TCP_DELACK_MAX (HZ/5) in tcp.h).
Together they stall. A client writes a request in two pieces (headers, then body): the first goes out; Nagle holds the second until the first is acknowledged; the server, holding half a request, has nothing to reply with, so its delayed ACK waits 40 ms or more. Every request pays it. A token stream is bitten the same way: token 2 is written while token 1 is unacknowledged, so Nagle holds it until token 1's ACK returns a full round trip later. On a 100 ms path, tokens that left the model 50 ms apart arrive in clumps, one clump per round trip.
The fix is one socket option. TCP_NODELAY turns Nagle off so every write goes out at once. Latency-sensitive stacks set it by default: gRPC's C core calls grpc_set_socket_low_latency(fd, 1) on its client and server sockets (tcp_client_posix.cc), and Go's TCP connections start with no delay (SetNoDelay: "The default is true"). TCP_CORK (Linux) is the deliberate opposite: assemble a response from several writes and release it as full segments.
Python's asyncio sets TCP_NODELAY on every TCP transport, but only when the socket reports its protocol as TCP (sock.proto == IPPROTO_TCP in asyncio/base_events.py, read in the 3.13.5 source). On this Mac a socket returned by accept() reports protocol 0, so the server side of an asyncio connection kept Nagle on while the client side had it off. Whether your server framework sets the option is worth one getsockopt call. The root's Failure lab could not reproduce the stall on this Mac's loopback (case "Nagle plus delayed ACK (not reproduced on macOS loopback)"): there the ACK returns in microseconds, so nothing waits. The stall needs a real round trip.
Latency per request of almost exactly 40 ms (or 200 ms) more than the work takes, independent of payload size; streamed tokens arriving in bursts rather than evenly. Check getsockopt(IPPROTO_TCP, TCP_NODELAY) on both ends, or a packet capture (tcpdump, needs root) showing small segments waiting for ACKs. Fix: set TCP_NODELAY on both ends, and write each logical message in one call.
The kernel completes the handshake on its own; accept() only hands your program a connection that is already established. Finished connections wait in an accept queue as long as the backlog passed to listen(), capped by somaxconn: 4,096 on Linux since 5.4 and 128 before (ip-sysctl; many tuning guides predate the change), and 128 on this Mac (measured kern.ipc.somaxconn). A server that accepts more slowly than clients arrive (a single process busy loading a model, a rendezvous rank before it calls accept) fills it.
When it is full, Linux drops new SYNs (tcp_conn_request in tcp_input.c counts a ListenOverflow and drops), so the client resends its SYN after its 1 s initial timeout, then 2 s later: connects that take 1 s or 3 s instead of a millisecond. A handshake that completes while the queue is full has its final ACK ignored, unless tcp_abort_on_overflow is on, which sends the client a reset instead (tcp_minisocks.c; off by default).
accept(): this experiment's backlog, far below the caps above.accept().connect() calls return success in 0.3 to 0.4 ms and client 4's is reset at once: seven of eight connects succeeded, though only two connections fit the queue.SO_REUSEPORT each worker process binds the same port with its own queue and the kernel spreads new connections across them, so they accept in parallel (illustrative: four workers).measured on this Mac with listen(2) and a server that does not call accept() until all eight clients have tried.
The others learned they had been dropped only when they wrote (broken pipe) or read (reset). A successful connect is not a server that will answer: a client needs a read timeout as well as a connect timeout, and a health check should send a request, not just open a socket.
Many workers, one port. SO_REUSEPORT lets several sockets, typically one per worker process, bind the same address and port, and the kernel spreads new connections across them, so N workers accept in parallel instead of fighting over one queue (man 7 socket). SO_REUSEADDR is different and older: it lets a restarted server bind its port while old connections on it are still in TIME_WAIT, which is why almost every server sets it.
Every connection is a file descriptor, and processes have a limit (ulimit -n). A server with thousands of streaming clients, or a dataloader whose workers each hold connections, hits it with EMFILE ("Too many open files"); compare ls /proc/PID/fd | wc -l with the limit.
ss -lnt: for a listening socket, Recv-Q is the current accept-queue length and Send-Q its limit (idiag_rqueue = sk_ack_backlog, idiag_wqueue = sk_max_ack_backlog in tcp_diag.c). nstat -az TcpExtListenOverflows TcpExtListenDrops counts the drops. Fix: accept faster (more workers, an event loop), raise the backlog in the code and somaxconn, and have clients retry with jitter.
On Slurm clusters a job inherits the soft limits of the shell it was submitted from unless the administrator configured otherwise (PropagateResourceLimits, whose default is to propagate all limits, slurm.conf); check inside the job with srun bash -c 'ulimit -n' rather than trusting the login node.
PropagateResourceLimits or PropagateResourceLimitsExcept is configured. What is true: a cluster can be configured not to propagate, and a job cannot raise a limit above what the node allows.A machine with a private address (section 1) reaches the internet through network address translation: a NAT device (a home router, a cloud NAT gateway, a Kubernetes node doing SNAT for its pods) rewrites each outgoing packet's source address and port to its own public address and a port it allocates, and remembers the mapping so it can rewrite the replies back. To the NAT, that table entry is the connection. Two limits follow: the table has a size, and entries that look idle are thrown away.
Idle timeouts are shorter than you think. The IETF asks that an established TCP mapping survive at least 2 hours 4 minutes idle (RFC 5382 REQ-5) and a UDP mapping at least 2 minutes (RFC 4787 REQ-5), but devices choose their own: an AWS NAT gateway times out a connection idle for 350 seconds and answers later packets with a reset, not a FIN (AWS NAT troubleshooting). Load balancers have their own idle timers. Neither end is told: the next write fails with "connection reset by peer", or, if the middlebox drops silently, hangs until a retransmission timer gives up.
TCP_KEEPIDLE = 300 s (below the gateway's 350 s). The kernel sends an empty probe; the server's kernel acknowledges it; the mapping is refreshed. Neither program did anything.TCP keepalive is not a heartbeat by default. With SO_KEEPALIVE on, Linux waits 7,200 s idle, then probes 9 times 75 s apart: 7,200 + 9 × 75 = 7,875 s, 2 hours 11 minutes, before it declares a silent peer dead (TCP_KEEPALIVE_TIME (120*60*HZ), TCP_KEEPALIVE_PROBES 9, TCP_KEEPALIVE_INTVL (75*HZ) in tcp.h). This Mac uses 7,200 s, 75 s and 8 probes (measured sysctl). Both are far longer than a 350 s NAT timeout, so set the per-socket options (TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT on Linux; TCP_KEEPALIVE on macOS) below the shortest idle timer on the path, as AWS's own fix says, or have the pool discard connections idle longer than that.
Keepalive cannot see a wedged peer. A process that is alive but stuck (a rank deadlocked in a collective, a server in a long garbage collection) still has a kernel that answers probes. For data you have sent, TCP_USER_TIMEOUT bounds how long it may stay unacknowledged before the connection is dropped (Linux 2.6.37 and later, man 7 tcp; standardised as an option in RFC 5482). For everything else you need an application heartbeat and a deadline: NCCL's watchdog timeout in PyTorch, gRPC deadlines, an SSE stream's ping events.
The root's Failure lab cases "Reused keep-alive connection closed by the server" and "Read timeout: connected, then nothing" show both shapes with real client errors; the SSH page (its section 9) records ServerAliveInterval detecting a dead path in seconds where TCP keepalive would take two hours.
Every connection through a NAT uses one of its source ports. An AWS NAT gateway supports up to 55,000 simultaneous connections per public IPv4 address to each unique destination (destination address, port and protocol), 5 Gbit/s scaling to 100 Gbit/s, and 1 to 10 million packets per second; beyond the connection limit its ErrorPortAllocation metric counts the connections it could not open (NAT gateway basics, CloudWatch metrics). A fleet of dataloader workers opening fresh connections to one storage endpoint can reach it. Fixes in order: reuse connections; add addresses to the gateway; and for S3 or DynamoDB, take NAT out of the path with a gateway VPC endpoint, which has no additional charge and needs no NAT device (gateway endpoints).
Failures only after idle periods, at a suspiciously round interval (350 s, 600 s, 3,600 s): a middlebox idle timer; compare the failure timestamps with each connection's last use. New connections failing while old ones work: a full NAT table (the gateway's port-allocation metric; on a Linux NAT, conntrack -S). ss -to (Linux) shows each socket's keepalive timer.
Every link has a maximum transmission unit (MTU), the largest IP packet it carries: 1,500 bytes on standard Ethernet, less on links that wrap packets in extra headers. A bigger packet must be fragmented or dropped, and fragmentation is fragile (lose one fragment, lose the packet), so TCP avoids it: each side announces an MSS in its SYN, the MTU minus IP and TCP headers (1,500 − 20 − 20 = 1,460 for IPv4; 1,440 for IPv6), and the timestamp option then takes 12 bytes of every segment (the hero's 1,448).
Path MTU discovery. A link further on may be smaller than yours. So TCP sends with the Don't Fragment bit set, and a router that cannot forward a packet drops it and returns ICMP "fragmentation needed" with the next link's MTU (IPv4, RFC 1191) or "packet too big" (IPv6, RFC 8201); the sender shrinks its packets for that destination.
measured from this laptop (interface MTU 1,500) with don't-fragment pings to Cloudflare's resolver: the router answered the oversized probes with exactly that message, naming an MTU of 1,492, and a binary search found the largest payload that gets through, 1,464 bytes (+ 28 bytes of IP and ICMP headers = 1,492).
Path MTU discovery depends on that ICMP message coming back. A firewall or security group that drops all ICMP breaks it, with a signature worth memorising: the handshake and small requests work, then the first full-size packet vanishes and the transfer hangs. A TLS handshake whose certificate chain needs a full-size packet, a large POST, a model download or an allreduce over a VPN all stall while curl to a health endpoint passes. Fixes: allow ICMP "fragmentation needed" / "packet too big" through; clamp the MSS on the tunnel or router; or let TCP find the size by probing (packetization-layer PMTUD, RFC 4821; Linux net.ipv4.tcp_mtu_probing=1 turns it on when a black hole is detected, 2 always, default 0, ip-sysctl). QUIC and other datagram protocols probe the same way (RFC 8899).
Inside an AWS VPC every current-generation instance supports 9,001-byte jumbo frames, about six times fewer packets per byte (derived: 8,949 / 1,448 payload bytes per segment with timestamps). Traffic through an internet gateway, over a VPN, or between regions (unless through a transit gateway) is limited to 1,500, and inter-region VPC peering to 8,500 (EC2 network MTU); AWS recommends jumbo frames within one cluster placement group. Two failures follow: traffic leaving the VPC at 9,001 depends entirely on path MTU discovery working; and nodes of one job with different MTUs (one image sets 9,001, another 1,500) pass every small message and hang on the first large one, such as a training job's first large allreduce. Check every node: ip link show (the mtu field), then ping -M do -s 8973 peer (Linux; 8,973 + 28 = 9,001) between each pair.
1,492 is the signature of PPPoE, which carries IP over a DSL or fibre line inside an 8-byte header (RFC 2516: "the PPP MTU MUST NOT be greater than 1492"). The TCP connections on this path used segments of 1,388 bytes (tcpi_maxseg), below the 1,492 − 40 − 12 = 1,440 this link allows (derived), so the smaller limit came from the server's side, which cannot be seen without a packet capture.
macOS: ping -D -s 1472 host (1,472 + 28 = 1,500); Linux: ping -M do -s 1472 host, and tracepath host, which reports the path MTU hop by hop without root. A reply of "frag needed and DF set (MTU n)" tells you the limit; silence at one size and success just below it, with no ICMP message, is a black hole. IPv6 could not be probed the same way here: ping6 -D needs root on macOS ("IPV6_DONTFRAG: Operation not permitted").
UDP adds an 8-byte header to IP: source port, destination port, length, checksum (RFC 768). No connection, handshake, acknowledgement, retransmission, ordering, flow or congestion control; what it keeps is message boundaries: each sendto is one datagram, delivered whole or not at all (section 2's recording shows three sends arriving as three reads). Use it when a late packet is worthless (voice, video, game state), when a question and its answer each fit in one packet (DNS), or to build your own transport in user space (QUIC). The price includes congestion control: an application that blasts UDP at a fixed rate harms everyone on the link, which is why the UDP usage guidelines ask UDP applications to control their rate.
A QUIC implementation treats those drops as network loss and slows down, so an undersized UDP buffer silently caps HTTP/3 throughput. quic-go's documentation recommends raising the Linux limits to about 7.5 MB (net.core.rmem_max and wmem_max = 7,500,000, quic-go wiki); Linux's default limit was 212,992 bytes until 6.18 raised it to 4 MB (section 5). HTTP/3 is not niche: W3Techs counted it on 40.8 percent of websites on 5 October 2026 (W3Techs).
measured on loopback: 5,000 datagrams of 1,200 bytes sent in one burst at a socket that reads only after the burst. TCP's buffer grows and its window slows the sender; a UDP socket has a fixed buffer, and datagrams that arrive while it is full are discarded with only a counter to record it.
| Size (UDP payload) | Where it comes from |
|---|---|
| 1,472 / 1,452 | largest payload in one 1,500-byte packet over IPv4 / IPv6 (1,500 − 20 or 40 − 8, derived); larger datagrams are fragmented, and losing one fragment loses the datagram |
| 1,232 | the EDNS buffer size DNS Flag Day 2020 recommends as the default: IPv6's 1,280 minimum MTU minus 48 bytes of IPv6 and UDP headers (dnsflagday.net/2020); larger DNS answers fall back to TCP |
| 1,200 | the smallest maximum datagram size QUIC requires a path to carry, and the size a client pads its first datagram to (RFC 9000 s14; measured in section 12) |
| 9,216 | the largest datagram this Mac's kernel accepts at all (measured: 9,216 bytes sent, 9,217 refused with "Message too long", net.inet.udp.maxdgram); the protocol itself allows up to 65,507 over IPv4 (65,535 − 20 − 8, derived) |
Linux: nstat -az | grep -i udp, where a growing UdpRcvbufErrors means the buffer overflowed; ss -uam shows each socket's buffer use. macOS: netstat -s -p udp, "dropped due to full socket buffers" (the counter this page's measurement read before and after). Where you meet UDP in ML: DNS on port 53 (packets, truncation and TCP fallback recorded on the DNS page), HTTP/3 on 443, NTP for clocks (TLS and token validity depend on them), and RoCEv2 between GPUs (section 14).
The QUIC run is real: aioquic 1.3.0 on loopback, a client and a small echo server, every UDP datagram logged with its size and source port, and both endpoints' qlog (QUIC's standard event log) recording the packet types and frames inside (src/meas/quic_migrate.py). Midway the client moves to a new UDP socket, which is what a NAT rebinding or a switch from Wi-Fi to mobile looks like to the server. The TCP side is drawn from the specification, not recorded.
TCP plus TLS has three costs that could not be fixed inside TCP: a round trip for TCP and another for TLS 1.3 before the request leaves (section 3); one ordered byte stream under all of HTTP/2's streams, so one loss stalls them all (section 4); and ossification: firewalls, NATs and load balancers parse TCP's headers and drop what they do not recognise, and TCP lives in kernels that update slowly, so new TCP features take a decade to deploy, if ever. QUIC (RFC 9000, May 2021, started at Google) moves the transport into a library on UDP and encrypts almost everything so middleboxes cannot ossify it again.
Costs. QUIC runs in user space, encrypting and acknowledging every packet itself, so it spends more CPU per byte than kernel TCP with its offloads. Some networks block or throttle UDP 443, so every client keeps a TCP fallback: it learns a server speaks HTTP/3 from an alt-svc header or a DNS HTTPS record, then races or falls back. Inside a data centre on a clean network, kernel TCP is usually cheaper and simpler; between your own services gRPC and most inference servers still use HTTP/2 over TCP.
QUIC hides its headers from network operators who used to read TCP's to debug (RFC 9312 discusses what remains visible). QUIC v2 (RFC 9369, 2023) changes nothing functional; it exists so that middleboxes do not hard-code version 1. RFC 9221 adds unreliable datagrams inside a QUIC connection, for media and tunnels. Packet captures show only encrypted payloads; use the endpoints' qlog files (aioquic, quic-go, Chrome's chrome://net-export) or SSLKEYLOGFILE to decrypt a capture in Wireshark. "HTTP/3 fast at home, slow or falling back in the office": UDP 443 blocked. This laptop's curl 8.7.1 has no HTTP/3 support at all, which the root page also notes; the root's On the wire tab measured cold, resumed and 0-RTT connections.
A 70-billion-parameter model in bf16 (2 bytes per parameter) is 140 GB of weights. A full training checkpoint with Adam in mixed precision usually also holds an fp32 master copy and two fp32 moments, 4 + 4 + 4 more bytes per parameter: 14 bytes per parameter, 980 GB (derived; layouts vary by framework). Over one connection capped at 5 Gbit/s that is 140 × 8 / 5 = 224 s for the weights and 980 × 8 / 5 = 1,568 s, 26 minutes, for the full state (derived), per checkpoint, while the GPUs may wait. One connection has four separate ceilings, and the lowest wins:
Pick a path, then predict how many connections the cross-region preset needs to fill 10 Gbit/s before dragging Parallel connections. Formulas: window / RTT; (MSS / RTT) × √(3/2) / √p; the per-flow cap; the link. illustrative inputs The path presets are typical shapes, not measurements, except the home line, which is this page's measured one.
So the fix is always parallel streams. That is what S3 multipart upload is for (an object split into up to 10,000 parts of 5 MiB to 5 GiB, uploaded concurrently, S3 multipart limits); what PyTorch's Distributed Checkpoint does by having every rank write its own shard ("saving models from multiple ranks in parallel", DCP docs); what s5cmd and rclone do with many concurrent transfers; and why NCCL opens several sockets per peer (section 14). AWS's documentation also lists Multipath TCP and ENA Express as ways past the single-flow cap.
Request rates, not bytes, bound small objects. S3 supports at least 3,500 PUT/COPY/POST/DELETE and 5,500 GET/HEAD requests per second per partitioned prefix (S3 performance). Ten million small image files are a request-rate and latency problem (each GET pays at least a round trip, plus a handshake if the connection is not reused), not a bandwidth one. Pack them into large sequential shards (WebDataset tar files, Parquet, MosaicML's MDS) so each request moves megabytes, spread keys across prefixes, keep connections alive, and prefetch with several workers: the parallel-streams trick again.
ss -tn dst HOST (Linux) or lsof -nP -iTCP.SO_RCVBUF by hand) or add streams.nstat, ss -ti)? Loss binds: find it (mtr, NIC counters with ethtool -S) or use more streams.Linux 6.15 added io_uring zero-copy receive (the iou-zcrx documentation was merged then), and devmem TCP lets a NIC place received payloads directly in device memory such as a GPU's. Both cut the CPU cost of receiving at high rates; they matter for ingest and serving rather than for NCCL, which already bypasses the kernel when it uses RDMA.
An allreduce moves gigabytes between GPUs every step, and kernel TCP copies each byte from the NIC into kernel memory and then into the application, takes interrupts and backs off on any loss. At hundreds of gigabits per second per node that is too slow and too costly, so the heavy traffic uses RDMA (remote direct memory access: one machine's NIC reads and writes another's memory with no kernel stack copying, and with GPUDirect RDMA straight into GPU memory). It runs on InfiniBand, on RoCEv2 (RDMA inside UDP datagrams to port 4791 over routed Ethernet) and on AWS EFA (the SRD protocol). Each fabric in more detail (the port's IANA registration, where reliability lives, SRD's congestion control), how they are built, their topologies and what each collective costs on them are on Interconnects and scaling, section 4.
TCP is still on the critical path at start-up. NCCL picks NVLink and shared memory inside a server, the IB/RoCE transport across servers, and plain TCP sockets when nothing better exists (NCCL_IB_DISABLE=1 forces that fallback, NCCL environment variables). Even on InfiniBand it sets up its connections over TCP sockets first (the same page's "InfiniBand connection bootstrap sockets"), and PyTorch's rendezvous is a TCP store on MASTER_PORT (29500 unless set, torchrun source). When NCCL does fall back to sockets it opens several per peer, because one TCP connection cannot fill a fast NIC (sections 5 and 13): NCCL_SOCKET_NTHREADS helper threads with NCCL_NSOCKS_PERTHREAD sockets each, defaulting on AWS to 2 and 8, so 16 TCP connections for each network connection between two ranks, the product capped at 64 (same page).
The checklist for a job that hangs at start-up or on its first big collective (wrong interface and the separate GLOO_SOCKET_IFNAME, a firewall that opens only MASTER_PORT, an MTU mismatch, a silent fallback to sockets, the accept queue at the rendezvous rank, a straggler that only looks like the network) is owned by Launching distributed training, section 6; this page explains the TCP and IP behind each (sections 3, 8 and 10). What each collective moves is Distributed training; timeouts and checkpointing at scale are Fault tolerance at scale.
Four tools answer most questions, each at a different layer. ping asks whether a host answers and what the round trip is (ICMP echo; some networks drop it, so silence is not proof the host is down). traceroute and mtr show the path and where loss starts (TTL, section 1). ss (Linux; netstat and lsof on macOS) shows every socket's state, queue, window, RTT and retransmissions as the kernel sees them. tcpdump shows the packets themselves (needs root): SYNs resent with no answer, RSTs, window sizes, segments waiting for ACKs, for example tcpdump -ni any 'tcp port 443 and host 203.0.113.5'. Start from what you see:
| Symptom | Most likely mechanism | Command that shows it |
|---|---|---|
| "Connection refused" in under a millisecond | nothing listens there, or it listens on another address (section 2) | lsof -nP -iTCP:PORT -sTCP:LISTEN; ss -ltnp |
| Connect hangs, then times out | SYN dropped by a firewall or security group (section 3) | nc -vz -w 3 host port; mtr host |
| Connects take 1 s or 3 s instead of milliseconds | full accept queue or lost SYNs (section 8) | ss -lnt (Recv-Q against Send-Q); nstat -az TcpExtListenOverflows |
| "Cannot assign requested address" under load | ephemeral ports exhausted by TIME_WAIT (section 3) | ss -tan state time-wait | wc -l; fix with pooling |
| Many CLOSE_WAIT sockets that never go away | your code does not close connections the peer closed (section 3) | ss -tan state close-wait; find the leak |
| Transfer far below link speed, no retransmissions | window over RTT (section 5) | ss -ti (rtt, cwnd, rcv_space); iperf3 -P 1 against -P 8 |
| Transfer slow with growing retransmissions | loss (sections 4, 6) | nstat -az TcpRetransSegs; ethtool -S eth0 for NIC drops |
| Everything slows while one big transfer runs | queue at the bottleneck: bufferbloat (section 6) | ping during the transfer: idle against loaded RTT |
| Each request about 40 ms slower than it should be | Nagle plus delayed ACK (section 7) | check TCP_NODELAY on both ends |
| Fails after idle periods with "connection reset" | NAT or load-balancer idle timeout (section 9) | time since last use against the middlebox's timer; ss -to |
| Small requests work, big ones hang | MTU black hole or mismatch (section 10) | ping -M do -s 1472 (Linux), ping -D -s 1472 (macOS); tracepath |
| HTTP/3 slow or falling back on one network | UDP blocked or UDP buffer drops (sections 11, 12) | nstat -az UdpRcvbufErrors; test UDP 443 |
Distributed job hangs at init_process_group | wrong interface, firewall, MTU (section 14) | NCCL_DEBUG=INFO; NCCL_SOCKET_IFNAME |
ss -ti (reference)Defaults from the current kernel documentation (ip-sysctl, net.core sysctls) and include/net/tcp.h, read 5 October 2026; distributions may override them. This Mac's equivalents are in src/meas/out/env.txt.
| Setting | Default | What it does, and when to change it |
|---|---|---|
net.ipv4.tcp_congestion_control | chosen when the kernel is built (CUBIC is the default named in RFC 9438 s1); read it, do not assume | sender's algorithm; try bbr on long lossy paths (section 6) |
net.core.somaxconn | 4096 (128 before 5.4) | cap on any listen() backlog (section 8) |
net.ipv4.tcp_rmem / tcp_wmem | 4K, 131072, up to 32 MB / 4K, 16K, up to 4 MB (depends on RAM) | min, initial, autotuning maximum; raise the third value to the BDP for long fat paths (section 5) |
net.core.rmem_max / wmem_max | 4194304 since 6.18 (212992 before) | caps explicit SO_RCVBUF/SO_SNDBUF only, not autotuning; matters for UDP and QUIC (section 11) |
net.ipv4.ip_local_port_range | 32768 60999 | ephemeral ports (section 3) |
net.ipv4.tcp_tw_reuse | 2 (loopback only) | 1 allows reuse of TIME_WAIT for outgoing connections; pooling is the real fix |
net.ipv4.tcp_mtu_probing | 0 | 1 probes when a black hole is detected, 2 always (section 10) |
net.ipv4.tcp_slow_start_after_idle | 1 | 0 keeps the congestion window across idle periods on long-lived connections |
net.ipv4.tcp_syn_retries | 6 (about 131 s to give up) | shorter connect failure; better: set a connect timeout in the client |
| keepalive time / interval / probes | 7200 s / 75 s / 9 (tcp.h) | set per socket below the NAT idle timeout (section 9) |
| TIME_WAIT length | 60 s, fixed (tcp.h) | not tunable; reuse connections |
Reading ss -ti. One line per connection: cubic or bbr (algorithm), wscale (send and receive window-scale shifts), rto: (current timer, ms), rtt:x/y (smoothed RTT / variance, ms), mss:, cwnd: (segments), ssthresh:, bytes_acked:, retrans: (in flight / total), pacing_rate, rcv_space: (autotuning's estimate); field list in man 8 ss. Small cwnd with climbing retrans: loss-limited. Large cwnd and a throughput equal to window / RTT: window-limited. The macOS counterpart is netstat -s -p tcp for totals; per-connection detail needs getsockopt(TCP_CONNECTION_INFO), which this page's scripts use.
requests.post() to an HTTPS API for the first time?tcp_rmem/tcp_wmem maxima to the BDP, never pin SO_RCVBUF, consider BBR for lossy paths, and above all use parallel streams (multipart upload, sharded checkpoints).tcp_tw_reuse=1 helps outgoing connections; tcp_tw_recycle no longer exists (removed in 4.12, broke NAT).ping -M do -s 1472 on Linux): success below a size and silence above it, with no ICMP reply. Fix: allow those ICMP messages, clamp MSS on the tunnel, or enable tcp_mtu_probing.TCP_NODELAY?TCP_NODELAY sends each write at once.10.0.0.0/16: all addresses sharing the first 16 bits (section 1)TCP_NODELAY (section 7)Every link was checked on 5 October 2026. Times are reading times for the part worth reading; times for this knowledge base's pages were estimated from their word count on 5 October 2026 (about 220 words a minute) and may have changed since.
The overview this page deepens: one LLM request through every layer. Its On the wire tab measures HTTP/1.1, 2 and 3 under delay and loss; its Failure lab reproduces 39 failures, including connection refused, connect and read timeouts, resets and the window cap. About 33 min (its own estimate), plus the tabs.
Turning names into the addresses of section 1; UDP's best-known user, recorded packet by packet with real glibc and musl resolvers (its section 7). About 45 min.
The handshake that sits on top of TCP and inside QUIC. About 45 min.
Semantics, HTTP/1.1, 2 and 3 framing, proxies and timeouts: what rides on this page's transports. About 45 min.
SSE, WebSockets and long-lived connections: where idle timeouts and keepalive (section 9) bite most. About 38 min.
Keepalives that notice a dead path in seconds (its section 9, the SSH side of this page's section 9), and tunnels and port forwarding on clusters: TCP inside TCP. About 38 min.
What NCCL's collectives move between GPUs under each parallelism scheme (section 14). About 32 min.
Failure rates, detection timeouts and checkpointing at cluster scale (sections 13 and 14). About 41 min.
NVLink, NICs and the hardware under RDMA. About 31 min.
InfiniBand, RoCE and NVLink as fabrics: topologies and what each collective costs on them (section 14).
torchrun, rendezvous, how NCCL picks its interfaces, and launch hangs (section 14).
Threads, locks and event-driven I/O: how one process serves thousands of the sockets of section 2.
Timeouts, retries, backoff and idempotency as a system: what to do with the resets and timeouts this page explains. About 40 min.
The service on top of the socket: connection pooling, timeouts and idempotency at the API level. About 32 min.
Ilya Grigorik's free chapter: handshake cost, slow start, window over RTT, head-of-line blocking, with clear diagrams (2013, so before QUIC was standardised). About 35 min. Its UDP chapter covers NAT traversal well. About 25 min.
Buffer sizing for long fat paths from the people who run a 100 Gbit/s science network. The reference for section 13. About 40 min.
The paper that introduced slow start and RTT variance estimation after the 1986 collapses; still the best explanation of why. About 45 min.
The exact meaning and default of every Linux knob in section 15. About 45 min, as a reference.
The 2022 consolidation of TCP's specification; sections 3.4 to 3.8 cover everything on this page. About 2 h 30 min.
Readable for specifications; read sections 5 (connections), 8 (address validation), 9 (migration) and 12 to 14 of RFC 9000, then RFC 9002's loss detection. About 3 h.
The per-flow caps and jumbo-frame rules that decide real transfer speeds on AWS. About 35 min.
What NCCL_SOCKET_IFNAME, the socket thread knobs and the IB settings do. About 30 min for the socket and network parts.
How modern Linux detects loss by time and probes a silent tail, the mechanism behind section 4's streaming caveat. About 1 h.
src/meas/, rerun with run_all.sh) and the primary sources linked inline. Replaces the old page "TCP, UDP, and IP: the transport foundations"; corrections to it are in boxes in sections 8 (closed block) and 10, inline in section 13, and all listed in src/coverage.json.