Skip to main content
← PROBLEMS / ARCHITECTURE
An end-to-end domain learning journey

XDP In-Kernel SYN Flood
& DDoS Packet Dropping.

Move SYN flood filtering out of iptables/nf_conntrack into a Native XDP eBPF program using a Per-CPU LPM CIDR blocklist, stateless SYN-flood rate limits, and ringbuf drop sampling.
Start the journey7 stages· Last modified Nov 23, 2026
FIRST PRINCIPLES. PRODUCTION SCALE.
The idea to keep with you

When traffic spikes expose hidden coupling, drop spoofed SYN floods via XDP_DROP before sk_buff or nf_conntrack allocation, and use Per-CPU maps + atomic link pinning for zero-downtime rule updates.

TL;DR30-second simplified summary
▾

A 20M PPS spoofed SYN flood overflows nf_conntrack in 13 ms and pegs ksoftirqd via sk_buff allocations. Native XDP bypasses sk_buff using LPM CIDR allow/blocklists, SYN-only rate limits, stateless XDP_TX SYN-cookies, 16-queue RSS, and 1-in-16K ringbuf drop sampling to hold CPU under 15%.

Before you begin · Building blocksAlready know these? Jump to Stage 01 ↓
eBPF & XDP In-Kernel Packet Processing
eBPF runs sandboxed, JIT-compiled bytecode safely inside the Linux kernel, and XDP (eXpress Data Path) hooks directly into the NIC driver RX ring before sk_buff allocation—enabling 20M+ PPS filtering per core.
Zero-Copy I/O, sendfile & io_uring
Zero-copy I/O keeps file bytes inside the Linux kernel page cache and streams them straight to a network socket via DMA scatter-gather, while io_uring batches asynchronous syscalls over shared memory ring buffers.
Circuit Breaker Pattern
A stateful proxy that monitors downstream failures and slow calls over a sliding window, tripping open to fail fast in microseconds instead of letting 2,000ms+ timeouts exhaust caller thread pools.
Full walkthrough · 7 stages
01
L4 · FUNDAMENTALS

.

02
L4 · FUNDAMENTALS

.

03
L5 · APPLIED DESIGN

.

04
L5 · APPLIED DESIGN

.

05
L6 · SCALE & TRADE-OFFS

.

06
L6 · SCALE & TRADE-OFFS

.

07
L7 · STAFF / PRINCIPAL

.

Practice · Explain the consequences

Practice: Make the trade-off yourself.

Question 1 of 3
Score: 0/3

If the attacker randomizes spoofed source IPs across millions of addresses, why is per-IP rate limiting alone insufficient—and what XDP technique solves it?

Recommended Learning Flow