finds.dev

jonhoo/rust-tcp

A learning experience in implementing TCP in Rust

View on GitHub

★ 562Rustupdated Jun 2024

// the take

A from-scratch, in-progress TCP implementation in Rust, built live on jonhoo's YouTube streams as a way to learn both the protocol and the language at the same time. It's for developers who want to see what TCP actually looks like under the hood — state machine, sequence numbers, retransmission — rather than use another networking library.

The whole thing lives in three small files (tcp.rs, lib.rs, main.rs), so you can read the entire TCP state machine in one sitting instead of hunting through a large codebase. It's paired with hours of recorded video walking through the exact design decisions, which is rare — most 'toy implementations' give you the code with none of the reasoning. Working directly against a TUN device means you're seeing real packets from a real kernel, not a simulated harness.

This is explicitly a learning project, not a library — no crates.io publish, no semver, no guarantee the API is stable or even that edge cases of the TCP spec are handled correctly. Last push was mid-2024 and the project reads as paused rather than finished, so don't expect gaps (congestion control, proper RTT estimation) to get filled in. No tests in the tree, which is a real gap for something implementing a stateful protocol where off-by-one sequence number bugs are exactly the kind of thing you want regression coverage for.

We read the README, the directory tree and a key source file in September 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
562
Forks
69
Language
Rust
Last commit
1 Jun 2024

// nearby

If rust-tcp isn't quite it.

All repos →