Low-Level Atlas III
From “I built real systems” to “I built systems that talk to each other”
Part III of the Low-Level Atlas series: sockets, concurrency, and network protocols to the bone — raw TCP, a hand-rolled binary protocol, RFC 6455 WebSocket, connection concurrency at scale, and a real-time chat with a C client and a TypeScript client speaking the same wire format. No frameworks, no shortcuts. Assumes you already did Atlas I and II.
./chat --room systemssend(frame)terminalbrowserRead it as a build queue, not a course catalog.
Start with raw TCP, suffer through designing your own framing before adopting WebSocket, then make connections concurrent at scale and give the chat rooms and presence — with a C client and a TypeScript client speaking the same protocol at the end.
Orientation
Where to start, what Atlas I and II you need first, and how this atlas is organized as a build queue.
TCP from Scratch
Raw BSD sockets to the bone: the three-way handshake, TCP_NODELAY, socket buffers, backpressure, half-close, and real network error handling — a simple echo server understood all the way down.
Design Your Own Protocol
Design your own application protocol over raw TCP before adopting WebSocket: framing, binary serialization, versioning, heartbeats — feel the problem a real standard exists to solve.
WebSocket, for Real
RFC 6455 implemented by hand in C: the HTTP Upgrade handshake, Sec-WebSocket-Accept, the frame format, control frames, fragmentation, and the close handshake.
Concurrency at Scale
Long-lived connections that need to see each other: epoll/kqueue vs thread-per-connection vs hybrid pools, the C10K→C10M problem, and lock vs lock-free connection registries.
Messaging Architecture
Rooms, presence, message history, delivery guarantees and ordering — and the pub/sub backplane concept for scaling a server across processes.
Two Clients, One Protocol
The same protocol surviving two runtimes: a terminal client in C and a client in TypeScript, side by side, low-level vs high-level solving the same network problem.
Client in C
A real terminal client: connecting, parsing WebSocket frames client-side, a non-blocking UI loop that serves keyboard input and incoming messages at once, and reconnection with backoff.
ExploreClient in TypeScript
The same protocol in TypeScript/Node: automatic reconnection, out-of-order message handling, and a direct comparison of what the high-level runtime gives you for free versus raw C.
ExploreAlways Active
Testing network protocols: mock sockets, fuzzing malformed frames, Wireshark/tcpdump debugging, connection observability, and TDD applied to async and concurrent code.
The real-time chat, v0 → v5
Built across every branch in this atlas — a raw TCP echo server, then a binary protocol, then RFC 6455 WebSocket, then rooms and scale, then two clients speaking the same wire format — the same way Atlas I built an OS and Atlas II built a database engine: in milestones, not all at once.
Raw TCP echo server
One client, one message, round trip. No protocol yet — just a socket that works.
Custom binary protocol
A hand-rolled framing and serialization format working between N clients — no WebSocket yet.
RFC 6455 WebSocket
Migrate to a compliant WebSocket implementation, verified against a real browser client.
Rooms, presence, scale
Broadcast to hundreds of simulated connections with real concurrency, not a toy loop.
Two clients, side by side
A complete C client and a complete TypeScript client, both talking to the same server.
Pub/sub backplane (optional)
Scale the server across processes — the door into distributed infrastructure, discussed when reached.
Network Craftsmanship
Testing network protocols — mock sockets, frame fuzzing, Wireshark/tcpdump, connection observability, TDD for async code.
Registries and operating memory
Registries keep external references, specs, tools, and source material normalized behind short atomic notes.