A userspace TCP/IP stack implemented in C++ for macOS, utilizing only raw bytes. Features include a TUN virtual interface, IPv4 parsing, ICMP, full TCP state machine, HTTP/1.0 server and client. Packets are managed through an internal queue for client-server communication.
From the README
Tinystack A userspace TCP/IP stack written from scratch in C++, running on macOS. No OS networking APIs. No sockets. No libraries. Just raw bytes. --- What it implements Layer Feature ---------------- Network TUN virtual interface via macOS utun IP IPv4 parsing, header checksum ICMP Echo request/reply (responds to ping) TCP Full state machine: LISTEN → SYNRECEIVED → ESTABLISHED → FIN → CLOSED TCP 3-way handshake (client + server) TCP Data transfer with ACK TCP Connection teardown (FIN/FIN-ACK) HTTP HTTP/1.0 server (serves HTML responses) HTTP HTTP/1.0 client (sends GET, receives response) --- Architecture Packets flow through an internal queue — the client and server communicate...
Skills
- Makefile
- C++
- CMake
- TypeScript