You end up withAn HTTP server on raw sockets, a DNS resolver that walks from the root servers, a userspace TCP/IP stack (Ethernet, ARP, IPv4, ICMP, TCP) that answers ping and carries TCP connections, a toy TLS 1.3 client that talks to a real server, and a BitTorrent client that downloads a real file from real peers.
Data pulled 2026-11-08 · time estimates are editorial
Why build one when every library already speaks HTTP? Because the bugs that cost days are below the library: the request that hangs only behind one proxy, the DNS answer that’s stale for exactly one TTL, the connection that stalls on 2% packet loss, the certificate error nobody can reproduce. After this track, a three-way handshake, a DNS referral and a TLS key schedule are things you’ve written, not acronyms in an error message. Hacker News has voted these tutorials up since 2008. Every step below shows its HN score and quotes what HN said.
How to read the receipts.
Points are summed across every HN submission of the same URL. For multi-part works on one site (Beej’s guide, the TCP/IP stack series, the Illustrated TLS pages), that includes parts submitted on their own.
“Submitted N×” means HN rediscovered it N times.
Quotes come from the highest-ranked top-level comments in those threads, and a quote is sometimes a criticism. Quotes keep the commenter’s spelling.
Steps are ordered for learning, not by points.
Times are our estimates, not the authors’. They assume evenings and weekends, and a reader who writes C and one of Python or Go comfortably.
Hardware. A laptop. Stage 3 needs Linux (a VM is fine) for its TAP device. Install Wireshark or tcpdump before you start; you’ll watch every packet you send.
A long, collaborative answer to the classic interview question, from the keypress to the rendered page. Read it as a map: every stage of this track is one of its paragraphs, done properly.
The classic introduction to the Berkeley sockets API: getaddrinfo, socket, bind, listen, accept, connect, send and recv, then poll, select, broadcast and the partial-send problems that bite real programs. Write the stream server and client as you go.
“Back in 2010 I had my first embedded programming job. I needed to do some network programming in C (controlling a PLC over ethernet). My boss at the time told me “just read Beej’s guide and you’ll be fine”. He was right. That system is running 24/7 since then.”
Three parts: a minimal HTTP server on a raw socket, the WSGI interface that lets it run real web frameworks, and a concurrent version that forks a process per connection (and deals with the zombies). Then test it the way this commenter suggests:
“Write a simple server, send requests through some commonly encountered firewalls, proxy servers, etc. while running Wireshark on the client and server sides and see what happens to your request and response data.”
A toy recursive resolver in about 200 lines: build a query by hand, parse the binary response, then follow referrals from a root server down to the answer. Bonus exercises add features a real resolver needs.
“Incidentally, writing toy recursive resolvers is one of the primary methods I use to help me learn new languages. If you take the time to develop an understanding of the domain, I’ve found its an easily repeatable exercise and can be done in a couple of hours.”
“Julia’s posts are always so informative; DNS being one of those topics which I presume so many developers are like myself and have “just enough knowledge to be dangerous” :-)”
HN’s caveat (on the earlier 80-line Go version, which has the same shape): “So what happens when there is a cycle in the graph? Does it just DoS the resolver?” (charcircuit, 2022 · comment). Another commenter listed what a toy still skips: “handling failed NSs, IPv6 only NSs, cycles etc” (comment). Those make good exercises.
Building a DNS server in Rust · Emil Hernvall · https://github.com/EmilHernvall/dnsguide · 222 points, submitted 4× (2018–2022) · Rust. Goes further: a caching, recursive DNS server. From the author: “It’s more about teaching DNS than about teaching rust, and async is complex enough that it’d be a pedagogical impedement.” (oxymoron, 2020 · comment)
Stage 35–8 weeksA TCP/IP stack in user space
Read first: A tcpdump Tutorial with Examples · Daniel Miessler · https://danielmiessler.com/blog/tcpdump · 549 points, submitted 24× (2009–2022) · Free · 1 evening. You’ll debug this stage by watching packets.
“Anybody doing any kind of network programming should have it under their belt. Application level debugging only goes so far.”
And a warm-up: What happens if you write a TCP stack in Python? · Julia Evans · https://jvns.ca/blog/2014/08/12/what-happens-if-you-write-a-tcp-stack-in-python/ · 410 points, submitted 2× (2014–2025) · 1 evening. A short, honest account of a TCP handshake built with Scapy, and of everything that went wrong. Read HN’s diagnosis too: “The idea that Python is so slow that it’s confusing TCP sounds wrong to me. I think it’s more likely that your packet capture scheme is slow.” (tptacek, 2014 · comment)
1,748 points across 8 submissions of its parts (2016–2025) · Free · C on Linux · ~5–8 weeks
Five parts that build a stack from layer 2 up, on a Linux TAP device: Ethernet and ARP, IPv4 and ICMP (your stack answers ping), the TCP handshake, TCP data flow with a socket API, and retransmission. The author’s finished code, with a socket API on top, is the level-ip repository.
“If you’re going to write a TCP stack to see how it works, it’s useful to log all packets that don’t advance the connection.”
Alternative, in Rust: read smoltcp (https://github.com/smoltcp-rs/smoltcp, 265 points, submitted 3×), a small, standalone TCP/IP stack for embedded systems. “It works with tun/tap interfaces and there’s a tcpdump clone in the example using raw sockets that works on any regular Linux network interfaces.” (blinkingled, 2019 · comment)
Stage 42–3 weeksTLS
Read first: How HTTPS Works · DNSimple · https://howhttps.works/ · 861 points, submitted 10× (2018–2026) · Free comic · 1 evening. The concepts, as a comic. The caveat: “Worth noting that “The Handshake” episode [0] covers the key exchange using RSA. This has the downside that it doesn’t support forward secrecy” (jwcrux, 2020 · comment). TLS 1.3, which the next steps use, removed RSA key exchange for exactly that reason.
2,237 points across 10 submissions of the TLS 1.2 and 1.3 pages (2018–2025) · Free · ~1 week
A real TLS 1.3 session, client says “ping”, server says “pong”, with every byte on the wire annotated and every key derivation reproduced with command-line tools. Work through it with the RFC open. The TLS 1.2 version (https://tls12.xargs.org/) is easier to follow first, because its handshake isn’t encrypted.
A TLS 1.3 client written from the RFC and the Illustrated TLS pages, using Go’s crypto primitives (X25519, HKDF, AES) but none of its TLS library, until it connects to a real website. It skips certificate verification entirely, as the post says. Do the same in any language with those primitives.
“Learning a protocol by writing a toy client (or toy server) is a blast. It’s so satisfying to see a real, production-quality server sending real responses to your little mess.”
Bencoding, the tracker request, the peer handshake, the peer wire protocol and concurrent piece downloads with hash checks, ending with a real Debian ISO downloaded from real peers. It pulls together everything before it: TCP connections, a binary protocol, and many peers at once.
“Over the holidays, I challenged myself to learn Go by torrenting the Debian ISO — from scratch. This post is a bit of a brain dump about everything I’ve learned over the past week.”
Alternative:Build your own BitTorrent · CodeCrafters · https://app.codecrafters.io/courses/bittorrent/overview · 457 points, submitted 1× (2023). Staged, test-driven, in many languages. The stage instructions are free to read; submitting code needs a paid membership.
Stage 62–3 weeks, readingHow the web uses all this
Latency, bandwidth and TCP’s behaviour as the web sees them: slow start, head-of-line blocking, TLS round trips, mobile networks, HTTP/1.1, HTTP/2, WebSocket and WebRTC. After Stages 1–5 you’ll recognise every mechanism it measures.
“After reading this, I suddenly understood so much more about what a web application actually is by appreciating it from the point of view of the browser.”
“One of the most valuable books you can read for your career, in my opinion. The only other one is Designing Data Intensive Applications.”
Read alongside: HTTP/3 explained · Daniel Stenberg · https://http3-explained.haxx.se/ · 944 points, submitted 8× (2019–2025) · Free. Why HTTP/3 moved to QUIC over UDP, from the author of curl. “As the packet loss rate increases, HTTP/2 performs less and less good.” it explains, and why that can’t be fixed in TCP. The caveat: “The document is now five years old and full of statements like “we’ll see that in the upcoming years”. I think it’s due for an update.” (sedatk, 2025 · comment)
Optional: go further
Monitoring and Tuning the Linux Networking Stack · Joe Damato (packagecloud) · https://blog.packagecloud.io/monitoring-tuning-linux-networking-stack-receiving-data/ · 290 points, submitted 9× (2016–2022) · Free. The receive path through a real kernel, from the NIC’s ring buffer to your socket, with every tunable along the way. Its sending-side companion is linked from the same blog. The caveat is about its opening claim that you can’t tune Linux networking without reading kernel source: “No, it isn’t.” (joosters, 2017 · comment)
Networking for Game Programmers · Glenn Fiedler · https://gafferongames.com/categories/game-networking/ · 2,183 points across 40 submissions of its networking posts (2009–2024) · Free. UDP, reliability built on top of it, snapshot interpolation, and why fast-paced games avoid TCP. HN argued about the advice: “Yet he recommends they implement their own reliably protocol over UDP, and they avoid TCP because it’s better to implement your own QoS?” (rstuart4133, 2016 · comment). Read it for the trade-offs, not as a rule.
The theory shelf (read alongside, not in sequence)
HN musicale, 2021, on A Systems Approach · comment
“Besides it being open source, it’s kind of exciting that it has some coverage of topics like virtual networks, SDN, advanced congestion control, etc..”
“I cannot recommend Kurose’s textbook high enough since I’ve been using it from the 1st edition and it’s by far the best textbook on the computer networking subject.”
Editorial backlog
Checked against HN on 2026-11-08 (candidates_receipts.json), not used:
Computer Networks from Scratch (Seth Archer Brown): 876 points over 3 submissions, a free book that starts from first principles. Only its first three chapters are published, so it isn’t a course yet. Re-check later; it could become the on-ramp.
Network Programming with Go (Jan Newmarch): 708 points over 8 submissions. HN found its security chapter dangerously wrong, recommending a low-level cipher API that “only encrypts the first block worth of data” (FiloSottile, 2017 · comment).
How DNS works (DNSimple’s comic): 271 points over 22 submissions. HN corrected a factual error about who runs top-level domains (comment). Step 3 covers the same ground by building it.
ICMP, Ping, and Traceroute – What I wish I was taught (xkln): 199 points. Good, but HN corrected its “host unreachable” explanation (comment).
Beej’s Guide to Network Concepts: 147 points over 5 submissions. A newer companion to step 1, recommended in its thread; worth a re-check as an alternative.
The TCP/IP Guide (Kozierok, 49 points), Concurrent Servers (Eli Bendersky, 24 points) and Jon Gjengset’s Implementing TCP in Rust livestream (7 points): weak HN story signal.
Not yet checked: W. Richard Stevens’ TCP/IP Illustrated and Unix Network Programming (often recommended in comments, but paid books with no single URL), Bert Hubert’s Hello DNS, Cloudflare’s learning center, WireGuard’s whitepaper, QUIC implementations.
Method
Candidates came from the 108 networking-tagged stories in the 4,140-story pull, plus a networking topic pull with 43 terms: 247 candidates in all (phase1-stories/data/networking_candidates.json). The pull also caught neural-network tutorials, social networks and TLS 1.3 news, which were skipped by hand.
Selection. 30 resources had receipts pulled; 22 are used here, chosen by hand for followability and sequence. Points were then totalled across every submission of each URL.
Filters. Beej’s site hosts several guides, so only submissions with “network programming” in the title count for step 1. Glenn Fiedler’s site also hosts posts on physics and floating point, so only the networking posts count. The Illustrated TLS points include its old address (ulfheim.net) and its TLS 1.2 page.
Quotes come from the top five top-level comments of the two best-scoring threads per resource, in HN’s ranked order via the Firebase API. Some quotes are trimmed with ”…”; links go to the full comment. Every ID and quote is checked with phase1-stories/scripts/check_track.py.
Costs and status were checked on 2026-11-08 on each resource’s own page: the CodeCrafters membership notice, Computer Networks from Scratch’s chapter status, the Kurose and Ross 9th edition and free labs, and the languages each tutorial uses. All other resources are free web pages or repositories. Time estimates are editorial, not measured.
Data:tracks/networking/receipts.json (resources used) and candidates_receipts.json (all 30 checked).