Lion Cipher Lab

Drop a packet flood in the kernel with XDP/eBPF (before it ever reaches your app)

Why it matters

When a volumetric flood hits a Linux box, the expensive part is not the decision to drop a packet — it is everything the kernel does BEFORE it can decide. On the normal path the driver receives the frame, the kernel allocates an sk_buff (the heap structure that represents a packet as it travels up the stack), and the packet climbs through the networking layers until a netfilter hook (where iptables/nftables live) finally runs your DROP rule. Under a real flood you pay that setup cost millions of times a second, and the CPU saturates long before your rules are the bottleneck. XDP (eXpress Data…

What you'll learn

Steps in this lab

  1. Where a packet dies matters: the receive path
  2. eBPF and the verifier: why kernel code you wrote is safe to run
  3. Build the range: a veth pair, no hardware needed
  4. Write the XDP filter in C, from scratch
  5. Compile to BPF bytecode and load in generic mode
  6. Prove it drops: flood the port and read the counters
  7. Measure it: pps and CPU, XDP vs the stack
  8. Add a BPF map: live drop counts, no reload
  9. Meet the verifier: break it on purpose
  10. The judgment: XDP vs nftables vs a scrubber, and doing it right

Open the full interactive lab →