惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
D
Docker
GbyAI
GbyAI
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
G
Google Developers Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
小众软件
小众软件
Engineering at Meta
Engineering at Meta
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
B
Blog
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
A
About on SuperTechFans
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog

Show HN

Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code.
GitHub - bardhyliis/ebpf-ddos-mitigation
bardhyliis · 2026-06-16 · via Show HN

Bare-Metal Network Shield

A hybrid nftables + XDP/eBPF mitigation stack extracted from a game server orchestration platform after repeated issues with high-PPS UDP flood traffic affecting container performance.

The goal is not to replace enterprise DDoS mitigation services or dedicated hardware appliances, but to reduce kernel overhead during sustained flood conditions and help keep game server containers responsive in small-scale bare-metal environments.


Why This Exists

During testing and production operation, I found that relying solely on traditional firewall rules and conntrack-based filtering could still introduce enough CPU and kernel networking overhead to impact running game servers under sustained high packet rates.

This project explores a layered approach:

  • nftables for stateful filtering and rate limiting
  • XDP/eBPF for early packet drop paths
  • a small userspace daemon to synchronize state between them

Docker, UFW, and nftables

Docker’s iptables-based networking and UFW can introduce complexity when combined, especially in environments with heavy custom firewalling.

Rather than continuing to layer rules on top of multiple abstractions, I opted to manage filtering directly with nftables.

The ruleset uses a custom chain at a high-priority prerouting hook (-150) so traffic can be evaluated early in the networking path before reaching later firewall stages or container networking rules.


Architecture

1. Stateful Filtering (nftables)

nftables handles:

  • Per-protocol rate limiting
  • Connection tracking-based protections
  • Dynamic blacklist with timeout

IPs that exceed extreme thresholds are added to a blacklist set with a time-based expiration.


2. Fast-path filtering (XDP/eBPF)

In testing, nftables alone still introduced measurable CPU overhead under sustained high packet rates.

To reduce this overhead, a userspace daemon monitors the nftables blacklist and synchronizes entries into an eBPF map used by an XDP program.

When enabled, XDP allows packets to be dropped very early in the kernel networking path (at the XDP hook in the driver or generic fallback mode depending on system support).

Note: XDP mode depends on driver support. Systems without native XDP support will fall back to a generic mode in the kernel networking stack.


Implementation Notes

  • C# is used for orchestration and remote management of rules
  • nftables rules are generated per-port and deployed dynamically
  • XDP synchronization runs as a systemd service with a 2-second polling interval

This introduces a small window where newly flagged IPs may still reach the kernel before being added to the XDP map.


Kernel Tuning

UDP buffer sizing

Increasing rmem_max and wmem_max improves resilience under bursty traffic patterns by reducing packet drops in the kernel receive buffers.

This is especially relevant for real-time game traffic where short bursts can otherwise cause visible desynchronization.


TCP congestion control

This setup uses BBR instead of CUBIC:

  • CUBIC can interpret packet loss as congestion
  • BBR tends to behave more consistently under variable network conditions typical in game server traffic

Stress Testing

Tested on an AMD EPYC bare-metal node under synthetic UDP flood conditions reaching approximately 500,000 packets per second.

At peak load, the upstream provider eventually null-routed the box to protect their network.

This behavior is visible in the full 22-minute telemetry replay:

👉 Performance audit: https://ray-hosting.com/en-US/performance-audit

Stress Test

Observed behavior:

  • nftables handled initial filtering
  • XDP reduced CPU and softirq pressure under sustained load
  • system remained responsive until upstream provider rate-limited or null-routed traffic

This is not a guarantee of performance under all conditions; results will vary depending on hardware, driver support, and traffic patterns.


Known Limitations

  • The XDP synchronization daemon uses polling (2s interval), which introduces a small propagation delay between detection and hardware map update
  • Orphaned nftables chains may remain after unexpected node restarts and are cleaned up via a garbage collection script
  • SSH-based orchestration introduces overhead compared to fully agent-based systems

Contributing

PRs are welcome, especially in areas such as:

  • Reducing or replacing polling-based XDP synchronization
  • Improving nftables chain lifecycle management
  • Reducing SSH overhead in orchestration flows

License / Usage

This is not a reference implementation for DDoS mitigation and should not be considered a substitute for upstream protection services.

It reflects an operational setup that evolved from real-world game hosting workloads where high-PPS UDP traffic and connection spikes were impacting server stability.

The same mitigation stack is currently used in production on my own game hosting infrastructure (Ray Hosting), and is provided here as-is. It may require tuning depending on kernel version, NIC driver behavior, and workload characteristics.