examples: add floodguard (adaptive in-kernel blackholing) - #619
Open
lneto wants to merge 1 commit into
Open
Conversation
This was referenced Jul 4, 2026
A demoable dataplane use case: a softirq PRE_ROUTING netfilter hook counts packets per source address and, once a source crosses a threshold, drops its traffic and broadcasts the mitigation on a netlink.channel for a userspace dashboard. Detection, mitigation and telemetry all run in the kernel, in Lua, hot-loaded, with no userspace agent in the packet path. Third of three use-case PRs toward the Netdev talk. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lneto
force-pushed
the
claude_floodguard
branch
from
August 3, 2026 12:34
08cb6a3 to
98f6f12
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A demoable dataplane use case for the netlink support: adaptive blackholing that detects flooding sources and mitigates them entirely in the kernel, in Lua, in softirq, streaming each action to userspace over a netlink channel.
A
PRE_ROUTINGnetfilter hook counts packets per source address in anrcu.table; once a source crossesTHRESHOLDpackets it is dropped and ablackholed <ip>event is broadcast on thefloodguardnetlink.channel. Detection, mitigation and telemetry all run in one softirq runtime, hot-loaded, with no userspace agent in the packet path. The channel is a genl multicast family a userspace dashboard subscribes to (template:tests/netlink/channel_subscriber.c).Validated end-to-end against a network namespace source: 150 pings from
10.99.0.2past a threshold of 100 → ~99 get through, the rest are dropped, and dmesg shows the blackhole event with the correct source address. Run steps in the README.Scope note
This showcases the softirq
netlink.channel(kernel-to-userspace telemetry) with dataplane mitigation. The control-plane variant — a sleepable reactor installing a blackhole FIB rule vianetlink.rt— is a natural follow-up once rule support (#616) and anFRA_SRCselector land; it is deliberately not stacked here so this PR stays self-contained onmaster.Third of three use-case PRs toward the Netdev talk (nl80211 #617, netfailover #618, floodguard).
🤖 Generated with Claude Code