Vibeleaderboard
Index / tool

Beeper: Application-Layer Parsing in eBPF

github.com/lerboe/beeper
Category
Developer Tools
Rank
No. 1256Tools index

Previous survey · No. 1247 ·

Pricing
Open Source
Type
TOOL
Use case
Data Processing
GitHub
171 stars
Latest release
v0.1.7
Date

About

Beeper is a Rust library that parses application-layer protocols (HTTP/1.1 and HTTP/2, with RESP2 in progress) directly in the Linux kernel through eBPF. It builds an Aho-Corasick-like DFA in user space so the parsing fits eBPF limits, which lets programs monitor, redirect or answer traffic from the kernel. A companion project uses it to serve static assets from the kernel, raising HTTP server throughput by up to 4.5x.

At a glance

Beeper lets an eBPF program extract selected HTTP fields inside the Linux kernel. It is worth exploring if you already build kernel-side traffic tools and want to inspect application headers without sending every message to user space.

Good fit

Rust and eBPF developers working on Linux network observability or routing.

Consider something else when

Skip it if you need a ready-made dashboard or your kernel or protocol is outside the documented support matrix.

Start here

In an isolated Linux VM, attach the sample parser to synthetic HTTP traffic and compare one captured header with the value sent by the client.

Cost and requirements

The GPL-licensed project lists Linux 6.8 or later for HTTP/1.1 and HTTP/2. You need an eBPF integration and permission to load it. Collected headers can contain sensitive values.

Limits to know

The project lists RESP2 as work in progress. Benchmark the parser in your own traffic path before assuming the throughput reported by a sample integration.

Suggest an improvement
Read the source review

What it does

Beeper lets a program running inside the Linux kernel read web traffic: request paths, status codes and chosen headers. You tell the Rust side which fields you want; it compiles them into a state machine, loads that into a prebuilt parser, and splices the parser into your own eBPF program (eBPF being the kernel's sandboxed way to run custom code). Your kernel code then calls one function per message and gets back pointers to the captured fields, with no copy to user space.

Why it's ranked here

This is research code with an unusual amount of care behind it. It comes from a group with an arXiv paper on enforcing application-layer policy in the kernel, and the library shows that lineage: an integration test suite that runs real HTTP clients against a real server with the parser attached, a documented table of every error code and what the caller should do, and comments explaining each limit the kernel verifier forces. The audience is narrow, people writing eBPF networking code, and for them it removes a hard problem.

What's good

The parser handles the awkward parts of HTTP/1.1 that naive matching gets wrong: header names in any letter case, extra whitespace around the colon, and a request that only looks like the HTTP/2 preface. When a header block spans more data than the kernel first exposes, it pulls in the rest and resumes where it stopped. Errors come back as standard negative errno values, each documented with a recommended response. The bundled example is a working HTTP monitor that follows a connection as it upgrades to HTTP/2.

Tradeoffs

Linux only, and it needs kernel 6.8 or newer; the crate refuses to compile on other systems. Building requires clang 18, LLVM 18 and kernel headers. The state machine is capped at 512 states and 256 actions, so a large set of captured fields can fail with a state-limit error. HTTP/2 header values arrive Huffman-encoded, which your code must handle. The license is GPL-3.0, which constrains closed-source products that link it. Redis protocol support is still unfinished. It is an early release.

How to use it well

Reach for it when you are already writing eBPF programs on socket hooks and need to route, filter or answer requests by path or header in the kernel. Start with the example monitor: run it, send a request with curl, and read the trace log to see captures. Ask for only the fields you need, since each one grows the state machine. Check every return code against the documented table, and cork incomplete messages instead of dropping them. It is not a general HTTP library for ordinary user-space servers.

Technical notes+

beeper/src/lib.rs documents the mechanism: header patterns compile into a Dfa, are written into the rodata of a precompiled BPF parser, and the parser replaces stub functions in the target program via freplace; a compile_error! blocks non-Linux targets. beeper/src/http1/parser.bpf.c defines MAX_STATES 512, MAX_ACTIONS 256 and 257 edges per state (byte values plus an any-byte edge), walks bytes with bpf_for, and retries after bpf_msg_pull_data when the linear part ends early. beeper/src/dfa.rs builds patterns with shared states, case-insensitive edges, optional prefixes and bounded any-byte runs. beeper/Cargo.toml: edition 2024, default features http1 and http2, depends on xbpf and httlib-huffman, documentation built for x86_64-unknown-linux-gnu. beeper/tests/http1.rs covers case folding, whitespace, the preface and status codes against a live server. docs/error-codes.md lists -EAGAIN, -EPROTO, -EBADMSG, -E2BIG, -EFAULT, -ENOSPC, -ENOENT, -EINVAL and -ENOSYS. Cargo.toml and LICENSE: GPL-3.0.

Observed

License
GPL-3.0
Language
Rust library with C eBPF parser programs
Packaging
Crate on crates.io, Cargo workspace with an example and test utilities
Platform
Linux only; kernel 6.8 or newer for HTTP/1.1 and HTTP/2
Protocols
HTTP/1.1 and HTTP/2 supported; RESP2 work in progress
Build requirements
clang 18, LLVM 18, libelf, zlib, kernel headers
Parser limits
512 DFA states, 256 actions (beeper/src/http1/parser.bpf.c)
Tests
Integration tests attach the parser and send real HTTP requests (beeper/tests/http1.rs)

Read from README.md, Cargo.toml, beeper/Cargo.toml, beeper/src/lib.rs, beeper/src/http1/parser.bpf.c, beeper/src/dfa.rs, example/README.md, example/src/monitor.bpf.c, beeper/tests/http1.rs, docs/error-codes.md, LICENSE.

Similar tools

Browse all tools →

Tags

ebpfhttp2rustkernelparsingnetworking

Tech Stack

Rust

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.