
Write a Simple HTTP/1.1 Server in C
Build a small HTTP/1.1 server in C with POSIX sockets: parse the request line, send correct headers and Content-Length, and handle keep-alive and bad requests.
Sockets, epoll, kqueue and io_uring, eBPF and XDP, DPDK, and protocol stacks written from the packet up.

Build a small HTTP/1.1 server in C with POSIX sockets: parse the request line, send correct headers and Content-Length, and handle keep-alive and bad requests.

Read raw frames with an AF_PACKET socket and parse Ethernet, IPv4 and TCP headers in C using the Linux header structs, with length checks at every layer.

Understand big-endian network byte order, why x86 and ARM hosts differ, and when to call htons, htonl, ntohs and ntohl in C socket code.

Decode the eBPF verifier message invalid access to packet in an XDP program, read the off, size and r values, and add the missing data_end bounds check.

Load an eBPF classifier with tc and cls_bpf on ingress or egress using a clsact qdisc, return TC_ACT verdicts, and see how tcx replaces it on Linux 6.6.

Count packets per source IPv4 address in an XDP program with a BPF hash map, then read and print the totals from a libbpf user-space program.

Write, compile and attach an XDP program in C that drops UDP packets for one port, with the bounds checks the verifier demands and a test you can run.

XDP runs eBPF programs on packets inside the NIC driver, before the kernel builds an skb. See the hook point, the five verdicts and the three attach modes.

eBPF runs small verified programs inside the Linux kernel. Learn the three parts that matter, programs, maps and the verifier, with a first complete example.

Compare epoll level-triggered and edge-triggered modes with EPOLLET, see exactly when each reports readiness, and pick the right one for your server.

Write a single-threaded TCP echo server on Linux with epoll_create1, epoll_ctl and epoll_wait, using non-blocking sockets and a clean accept and read loop.

Replace select with poll and struct pollfd to serve many clients in C without the FD_SETSIZE limit, and learn the POLLIN, POLLHUP and POLLNVAL revents.
We send one email when a new post is published. No spam.