Network programming in C/C++

4 tutorials

These tutorials teach networking by implementing the protocols yourself instead of calling a library. Let's Code a TCP/IP Stack is a 5-part series that starts at Ethernet and ARP and works up through IPv4, ICMP and TCP in C, using a Linux TAP device so your stack can talk to real traffic. It is the most direct way to understand what the kernel's network stack does for you.

Eli Bendersky's Programming concurrent servers (6 parts) builds the same simple server several ways: sequentially, with threads, and event-driven with select, epoll and libuv. MQTT Broker from scratch (7 parts) builds Sol, a small MQTT broker in C, and covers binary protocol parsing, an event loop and topic routing. Networking from Scratch is a GitHub repository of networking exercises.

A sensible order is the concurrent servers series first, since it only needs sockets, then the MQTT broker, then the TCP/IP stack. All of them assume you are comfortable with C pointers, structs and reading man pages on Linux.

Esc

Type to search every entry. ↑↓ to move, Enter to open.