Repository navigation
ffmuc-ebpf-clat: report the CLAT traffic through respondd - #67
Merged
Merged
Conversation
Count the packets and bytes that the CLAT translates, in a per-CPU array
map (one plain add per packet, no atomic operations). Only translated
packets count; the byte count is the size of the IPv4 packet.
Every 10 s the daemon adds the per-CPU values together and writes them to
/var/run/ebpf-clat/<interface>. A new respondd module adds the files of
all interfaces together and sends them in statistics:
statistics.clat.v4_to_v6.{packets,bytes}
statistics.clat.v6_to_v4.{packets,bytes}
A node without a running CLAT sends no clat key. The daemon now also
stops cleanly on SIGTERM (procd stop) and removes its file.
Closes #62
This was referenced Nov 21, 2026
awlx
added a commit
to freifunkMUC/site-ffm
that referenced
this pull request
Nov 21, 2026
Includes: - freifunkMUC/community-packages#60: tests: fix ShellCheck SC2317 - freifunkMUC/community-packages#61: count the clients of routing nodes - freifunkMUC/community-packages#66: rx traffic as a second liveness check - freifunkMUC/community-packages#67: report the CLAT traffic through respondd
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.
Closes #62
Summary
The CLAT now counts the packets and bytes that it translates, in both directions. respondd sends these counters in
statistics./var/run/ebpf-clat/<interface>./usr/lib/respondd/ffmuc-ebpf-clat.so) adds the files of all interfaces together.respondd fields
statistics.clat.v4_to_v6.packetsstatistics.clat.v4_to_v6.bytesstatistics.clat.v6_to_v4.packetsstatistics.clat.v6_to_v4.bytesclatkey.This PR does not change the map or Grafana.
Tests
sh tests/run.sh(unit test of the stats files, ASan and UBSan): pass. It tests the write and read-back of the largest 64-bit value, the sum of two tunnels, and that bad, temporary and hidden files are skipped.sh tests/e2e.shin a privileged container (clang 20, real kernel, TUN device as for WireGuard): pass.clatkey before the start and after the stop.-Wall -Wextra -Werror: clean.clatkey.Not tested: production nodes.
Known limits (not from this change)
Thank you to the reporter of #62.