Architectural Invariant Design: Cilium eBPF Host Routing WireGuard MTU Clamping & Encapsulation Invariant
Cilium eBPF Host Routing WireGuard MTU Clamping & Encapsulation Invariant defines an industrial-grade behavioral standard for devops engineering. Mandates explicit encapsulation headroom deduction, eBPF TCP MSS clamping, and interface MTU parity in Cilium deployments running eBPF host routing with transparent WireGuard encryption. This invariant eliminates silent PMTU blackholes, packet drop storms during TLS handshakes, and unrecoverable throughput degradation caused by eBPF bypass of netfilter MSS clamping. Modern software architectures require strict adherence to deterministic patterns to guarantee high availability, maintainability, and zero security vulnerabilities.
Hazard Analysis: What Breaks Without This Rule
The following failure modes have been cataloged from hundreds of hours of production code reviews where AI assistants produced non-compliant implementations:
| Failure Mode | AI Symptom (The Anti-Pattern) | Severity | Production Impact & Remedy |
|---|---|---|---|
| AI Hallucination & Deprecation Drift | Default 1500 MTU with Transparent WireGuard and eBPF Host Routing Bypassing Netfilter Clamping | Critical | Violating this industrial standard introduces regression bugs, security risks, and unexpected runtime failures in production. Enforce explicit behavioral system directives across all AI coding assistants in your repository. |
| Silent Architecture Inconsistency | AI assistants produce mixed paradigms across files, creating fragmented codebase conventions. | Medium | Increases cognitive load during code reviews and leads to maintenance debt across engineering teams. Pin project conventions in .cursor/rules, CLAUDE.md, and AGENTS.md so all team agents follow identical guardrails. |
Step-by-Step Production Directives
Each rule constraint below is injected into the AI agent's system prompt to establish deterministic boundaries:
Engineers MUST ALWAYS calculate and explicitly specify `mtu` in Cilium Helm values by subtracting WireGuard overhead (minimum 60 bytes for IPv4, 80 bytes for IPv6) from the minimum physical underlying fabric interface MTU (e.g., MTU 1440 or 1420 for an underlying 1500 MTU network).
Engineers MUST ALWAYS calculate and explicitly specify `mtu` in Cilium Helm values by subtracting WireGuard overhead (minimum 60 bytes for IPv4, 80 bytes for IPv6) from the minimum physical underlying fabric interface MTU (e.g., MTU 1440 or 1420 for an underlying 1500 MTU network).
Engineers MUST NOT rely on default Linux iptables/netfilter MSS clamping rules (`iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -j TCPMSS`) when `bpf.hostRouting=true` is enabled, as eBPF TC bypasses the netfilter stack entirely.
Engineers MUST NOT rely on default Linux iptables/netfilter MSS clamping rules (`iptables -t mangle -A POSTROUTING -p tcp --tcp-flags SYN,RST SYN -j TCPMSS`) when `bpf.hostRouting=true` is enabled, as eBPF TC bypasses the netfilter stack entirely.
Code SHOULD verify that `bpf.masquerade=true` and explicit device bindings (`devices
Code SHOULD verify that `bpf.masquerade=true` and explicit device bindings (`devices: ["eth+", "en+"]`) are defined alongside WireGuard encryption to guarantee consistent eBPF fib-lookup routing paths.
Services MUST ensure cross-node Pod-to-Pod and Pod-to-External egress traffic automatically negotiates a maximum TCP MSS of `Cilium_MTU - 40` (IPv4) or `Cilium_MTU - 60` (IPv6).
Services MUST ensure cross-node Pod-to-Pod and Pod-to-External egress traffic automatically negotiates a maximum TCP MSS of `Cilium_MTU - 40` (IPv4) or `Cilium_MTU - 60` (IPv6).
Components NEVER deploy transparent WireGuard encryption with implicit MTU auto-detection enabled (`mtu
Components NEVER deploy transparent WireGuard encryption with implicit MTU auto-detection enabled (`mtu: 0` or omitted) in heterogeneous cloud VPC fabrics where underlying MTUs differ between node pools.
Frequently Asked Technical Questions
Common questions developers face when configuring AI coding assistants for this stack:
Q:Why is Cilium eBPF Host Routing WireGuard MTU Clamping & Encapsulation Invariant critical for AI coding assistants?
Mandates explicit encapsulation headroom deduction, eBPF TCP MSS clamping, and interface MTU parity in Cilium deployments running eBPF host routing with transparent WireGuard encryption. This invariant eliminates silent PMTU blackholes, packet drop storms during TLS handshakes, and unrecoverable throughput degradation caused by eBPF bypass of netfilter MSS clamping. Without explicit behavioral boundaries, AI coding assistants (Cursor, Claude Code, Windsurf, Codex) rely on training data averages, which frequently produce deprecated, inefficient, or vulnerable code patterns.
Q:How does adopting this rule prevent AI hallucinations?
This rule explicitly declares what the AI must avoid (Default 1500 MTU with Transparent WireGuard and eBPF Host Routing Bypassing Netfilter Clamping) and prescribes verified positive examples. Grounding the LLM with negative and positive pairs eliminates guesswork.
Q:Which AI coding environments are supported?
This specification is multi-platform compatible: Cursor (.cursor/rules/*.mdc & .cursorrules), Anthropic Claude Code (CLAUDE.md), Windsurf (.windsurfrules), Codex / Cline (AGENTS.md), and GitHub Copilot (.github/copilot-instructions.md).
Q:Can I combine this rule with other technology stacks?
Yes. Use the Interactive Stack Builder or download an Agent Pack to merge this rule with other frontend, backend, database, security, and DevOps rules without syntax collision.