Advanced · Module 8
Network Programming and Socket Architecture
Architect resilient network software using the BSD socket API, master TCP and UDP transport protocols, eliminate blocking bottlenecks with epoll event loops, and leverage zero-copy kernel transfers.
Modern systems software rarely runs in isolation on a single machine. High-performance services, databases, proxies, and distributed engines must coordinate state across the wire. This module expands your systems programming toolkit from local operating system primitives to network boundaries: establishing reliable streams and datagrams with the BSD socket API, navigating IPv4/IPv6 dual-stack resolution, driving asynchronous event loops with Linux epoll, streaming gigabytes per second directly across network interface cards using zero-copy transfers, and synthesizing these techniques into a production HTTP/1.1 capstone web server.
- 1Socket Foundations: Berkeley Sockets, Address Structures, and TCP HandshakesPro — members onlyMaster BSD socket APIs, configure IPv4 sockaddr_in structs, convert network byte endianness, and trace the TCP 3-way handshake across kernel socket queues.16 min
- 2Protocol-Independent Networking: getaddrinfo and Dual-Stack IPv4/IPv6Pro — members onlyBuild protocol-independent network software using getaddrinfo, traverse DNS resolution lists, resolve service ports, and deploy dual-stack IPv4/IPv6 sockets.16 min
- 3Synchronous Multiplexing: Non-Blocking Descriptors, select, and pollPro — members onlyManage thousands of concurrent socket connections on a single thread using O_NONBLOCK, inspect readiness states with select and poll, and overcome FD_SETSIZE limits.16 min
- 4High-Performance Event Multiplexing: Linux epoll ArchitecturePro — members onlyEliminate O(N) multiplexing bottlenecks using Linux epoll, configure Red-Black tree interest lists, master Edge-Triggered vs Level-Triggered notification, and prevent descriptor leaks.16 min
- 5Connectionless Datagrams: UDP Sockets, Framing, and Packet LossPro — members onlyMaster connectionless UDP networking with sendto and recvfrom, preserve message boundaries, build application-level framing, and diagnose packet loss.16 min
- 6TCP State Machine and Socket Options: setsockopt, SO_REUSEADDR, and TIME_WAITPro — members onlyNavigate the 11 states of the TCP lifecycle, eliminate bind failures using SO_REUSEADDR and SO_REUSEPORT, tune transmission latency with TCP_NODELAY, and manage TIME_WAIT drain states.16 min
- 7Zero-Copy Data Pipelines: sendfile, splice, and Vectored I/OPro — members onlyEliminate redundant CPU memory copies and context switches using Linux sendfile, stream kernel buffers via splice, and aggregate non-contiguous buffers with vectored writev.16 min
- 8Event-Driven Server Architectures: Reactor Patterns and Production Event LoopsPro — members onlyArchitect non-blocking event-driven network services using the Reactor pattern, manage connection state machines and outbound write buffers, and integrate timerfd and signalfd into unified epoll loops.16 min
- 9Project: High-Throughput HTTP/1.1 Web ServerPro — members onlyArchitect a production-grade HTTP/1.1 file server integrating non-blocking sockets, Edge-Triggered epoll, zero-copy sendfile, and connection state machines.25 min
- 10Linux io_uring: Completion-Based Asynchronous I/OPro — members onlyUnderstand Linux io_uring submission and completion queues, registered resources, and the difference between readiness and completion.18 min
- 11Advanced Linux Event Sources: eventfd, signalfd, timerfd, and inotifyPro — members onlyTurn counters, signals, timers, and filesystem changes into file-descriptor events handled by one Linux event loop.16 min