Meta's L4 load balancer that forwards packets inside the kernel with XDP and eBPF
GPL-2.0
- C
- C++
- Python

About Katran
Katran moves load balancing off the application path and into the kernel. Built by Meta, it attaches an eBPF program to the XDP hook, so packets are steered to backends before they ever climb the network stack. That is how it handles the kind of traffic volume a software proxy would choke on, while running on commodity hardware.
Under the hood it works at Layer 4: a packet's 5-tuple is hashed to pick a real server, session state lives in a fixed-size LRU connection-tracking table, and flows are wrapped in ipip encapsulation for direct server return. A modified Maglev hash keeps backend selection consistent even when weights are unequal or the pool changes.
Katran is a C++ and BPF library, not a turnkey daemon, and ships with Thrift and gRPC examples. It builds on Linux with a recent kernel and clang, tested on Ubuntu 20.04. Self-host. GPL-2.0 licensed.
Key features
- XDP and eBPF packet forwarding inside the kernel
- L4 5-tuple hashing to select backends
- Fixed-size LRU connection-tracking table
- ipip encapsulation for direct server return
- Modified Maglev hashing for unequal backend weights
Details
- First released
- 2018
- Platforms
- Linux
- Layer
- L4 (XDP · eBPF)
- Language
- C++ · BPF · Python
- Company
- Meta
- License
- GPL-2.0