Skip to content

feat(network): BPF ingress/egress filtering#1055

Closed
Zenithar wants to merge 5 commits intoDataDog:mainfrom
Zenithar:zenithar/chaos-controller/full_bpf_network_filter
Closed

feat(network): BPF ingress/egress filtering#1055
Zenithar wants to merge 5 commits intoDataDog:mainfrom
Zenithar:zenithar/chaos-controller/full_bpf_network_filter

Conversation

@Zenithar
Copy link
Copy Markdown
Contributor

@Zenithar Zenithar commented Apr 8, 2026

What does this PR do?

  • Adds new functionality
  • Alters existing functionality

Replaces the legacy iptables/u32-based network disruption packet filtering with a full eBPF (TC classifier) implementation for both ingress and egress traffic paths.

Key changes

  • New bpfdisrupt packageEngine that manages the BPF data plane: clsact qdisc lifecycle, IFB device for ingress redirect, BPF program attachment (TC egress classifier + ingress DirectAction), and LPM trie map population for target CIDR matching.
  • New eBPF C program (ebpf/network-disruption/disruption.bpf.c) — TC classifier that matches packets against an LPM trie of disruption rules (CIDR + port + protocol), supporting both IPv4 and IPv6.
  • BPF map config tool (ebpf/network-disruption/main.go) — Userspace helper that pins and populates the LPM trie maps via libbpfgo.
  • Refactored injector/network_disruption.go — Integrates the BPF engine, replacing iptables/u32 filter chains with BPF classifiers. Simplifies the overall tc qdisc/filter setup.
  • New network/ abstractionsTrafficController and NetlinkAdapter interfaces for tc and netlink operations, with mocks for testability.
  • Comprehensive tests — Unit tests for bpfdisrupt.Engine, network disruption helpers, and controller-level BPF network disruption integration tests.
  • Updated docs — Revised network disruption documentation to reflect the BPF-based architecture.

Code Quality Checklist

  • The documentation is up to date.
  • My code is sufficiently commented and passes continuous integration checks.
  • I have signed my commit (see Contributing Docs).

Testing

  • I leveraged continuous integration testing
    • by adding new unit tests or end-to-end tests.
  • I manually tested the following steps:
    • locally.
    • as a canary deployment to a cluster.

@Zenithar Zenithar self-assigned this Apr 8, 2026
@Zenithar Zenithar changed the title Zenithar/chaos controller/full bpf network filter feat(network): BPF ingress/egress filtering Apr 8, 2026
@Zenithar Zenithar force-pushed the zenithar/chaos-controller/full_bpf_network_filter branch from 05925b2 to aacb677 Compare April 8, 2026 12:03
@Zenithar Zenithar marked this pull request as ready for review April 8, 2026 12:10
@Zenithar Zenithar requested a review from a team as a code owner April 8, 2026 12:10
@Zenithar Zenithar closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant