Repository navigation
Announcement filter: tc-BPF on the tunnel egress instead of XDP - #9
Merged
Merged
Conversation
Replaces the XDP files with a tc classifier built per watcher at container start (-D defines from env), so plain iproute2 attaches it without bpffs or SYS_ADMIN. The classifier is a stub that passes everything; the harness fails 34 of 44 cases against it.
Hellos and CSNP/PSNP pass. An LSP passes only with the watcher's system id and pseudonode 0, at most one point-to-point neighbour and, as reachability, only the tunnel prefix. Anything malformed, truncated or unknown is dropped. The PDU is read relative to the network header and bounded by its own length and each TLV length, so a trailer is never parsed. Per-reason drop counters replace bpf_printk. All 44 verdict cases of the harness pass.
…LSP to the cases The lab node that brings gre1 up ran in parallel with the one-shot filter node (a node's create stage ends when its container starts), so FRR's first hello and LSP left unfiltered. The attach step now sets the link up itself. Verified on a live gre1: the link came up after the filter was attached.
enable_xdp/disable_xdp become enable_filter/disable_filter (no aliases), the image is vadims06/isis-filter pinned as v1, the answers key and manifest field is enable_filter (on by default for GRE). The node now shares the FRR network namespace with NET_ADMIN, BPF and PERFMON instead of host networking, gets the watcher system id and tunnel subnet from client.py as env, and replaces h2. run_command calls the class method: the enable_filter attribute would shadow it, which already made the old enable_xdp action fail. The veth MTU comment is corrected: FRR needs 1497 on gre1 for its LSP size, with or without a filter.
…dows the enable_filter action Reverts the class-level lookup in run_command, which the rename makes unneeded.
…tcher The prompt and the manifest default are off. cap-add is dropped from the template: containerlab runs nodes privileged, so the list restricted nothing and older Docker or kernels do not know CAP_BPF. Files are announcement_filter.c, attach_filter.sh and filter/test/ like in the OSPF watcher.
h2 is removed when the filter is on, so the watcher's wait-for pointed at a node that no longer exists.
…control PDU lengths A per-TLV neighbour limit let two TLVs each carry a different neighbour, and fragments cannot be correlated, so only fragment 0 of the own LSP leaves and the neighbour count spans all IS-reach TLVs. Hellos and SNPs pass only with the header length of their type and a PDU length that fits the packet.
A PSNP with no TLVs is exactly 17 bytes, so the unconditional 19-byte read dropped a valid one.
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.
Replaces the XDP announcement filter with a tc-BPF program on the egress of
gre1inside the watcher's namespace. Stacked on #8.What changes
network-mode: container:router) instead of the host network, and sees the IS-IS PDU before GRE encapsulation.gre1up after attaching. If it fails, the tunnel stays down and no adjacency forms.--action enable_filter, off with--action disable_filter.xdp/→filter/, imagevadims06/isis-filter:v1(published), answers keyis_filter_enabled.Checked
filter/test/run.sh: 53 PDU cases throughbpftool prog run, including a captured FRR LSP.tests/: 20 passed.gre1: adjacency Up; a loopback8.8.8.8/32in IS-IS on the watcher never reaches the device; a failed filter node leavesgre1down.Known limits
gre1down and the filter containerExited (1).Policy, counters and commands: README, "Listen-only mode".