docs: update CLAUDE.md for per-flow metrics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Davíð Steinn Geirsson 2026-02-13 18:24:06 +00:00
parent a093e398d9
commit 281f12f8c0
2 changed files with 2 additions and 2 deletions

View file

@ -242,7 +242,7 @@ Messages serialized with `postcard`. FDs passed via ancillary data.
- On child exit (child sends `MetricsReport` before exiting)
- On shutdown (final collection from all children)
Per-peer metrics: packets, bytes, dropped_packets, dropped_bytes, codel_drops, tail_drops, fq_sojourn_us (Stats), queue_depth_bytes (Stats), flow_count (Stats), sojourn_us (Stats), arp_requests.
Per-peer metrics: packets, bytes, dropped_packets, dropped_bytes, codel_drops, tail_drops, fq_sojourn_us (Stats), queue_depth_bytes (Stats), flow_count (Stats), sojourn_us (Stats), arp_requests. Per-peer flow snapshots: top 50 active flows by packet count, each with identities (Vec of 5-tuples for hash collision grouping), packets, bytes, codel_drops, sojourn_us (Stats). `metrics.json` is written atomically to the config directory every 15 seconds for live inspection.
**L3 IP-based forwarding**: The forwarder routes packets by destination IP rather than MAC address. Each worker maintains an `ip_to_peer` map (Ipv4Addr -> peer name) for egress routing. TX processing: ARP requests are answered locally with the target peer's MAC (proxy ARP, returns `ForwardResult::ArpReply`); IPv4 unicast is classified by flow, enqueued into FQ-CoDel, dequeued, and pushed to the ring; IPv4 broadcast (255.255.255.255) goes directly to all broadcast-enabled peers (bypasses FQ-CoDel); other ethertypes are dropped. Ingress validation: source MAC must match expected peer, and IPv4 source IP must match peer's configured IP (anti-spoofing). `forward_tx()` returns `ForwardResult` enum (Forwarded, Dropped, ArpReply).

View file

@ -45,7 +45,7 @@ pub use args::{init_logging, Args, LogLevel};
pub use config::{ConfigEvent, VmConfig, VmRole};
pub use control::{ChildToMain, ControlChannel, ControlError, MainToChild, MAX_FDS, MAX_MESSAGE_SIZE};
pub use fq_codel::FqCodelConfig;
pub use metrics::{ChildMetrics, PeerMetrics, Stats, SwitchMetrics};
pub use metrics::{ChildMetrics, FlowIdentity, FlowMetrics, PeerMetrics, Stats, SwitchMetrics};
pub use metrics_store::MetricsStore;
pub use mac::Mac;
pub use manager::{BackendManager, ChildMessage};