
A CNI is described as "pod networking", which is like describing a bank as "a building with money in it". The interesting work happens after the address is assigned — and it all runs through the same programs.
1. Addresses and interfaces
The CNI binary is invoked by the container runtime on every pod sandbox creation and deletion. Cilium's cilium-cni calls the local agent over /var/run/cilium/cilium.sock, asks for an address from the IPAM pool, creates the veth (or netkit) pair, moves one end into the pod's namespace and returns the result to the runtime. Calico's plugin does the equivalent against Felix and its IPAM blocks.
This is the part everyone knows, and the part that produces the most misleading errors: a CNI that cannot reach its agent looks like a Kubernetes bug. Part 6 walks a case where a stale cilium-cni binary outlived its agent.
2. Policy enforcement
Kubernetes NetworkPolicy is a label selector language with no implementation. The CNI compiles it — plus its own CRDs — into per-endpoint decisions. Cilium derives a numeric security identity from a pod's labels and stores policy in eBPF maps keyed by identity, so the decision does not depend on IP addresses that change when pods restart. Calico computes the same kind of decision in Felix and programs it into the selected dataplane.
The model differs: Cilium evaluates policy in the programs that forward the packet; Calico computes it in an agent and pushes it into whichever engine is underneath.
3. Service load balancing
Both products can replace kube-proxy. Instead of thousands of iptables rules, a service lookup becomes a map lookup in the datapath: ClusterIP to backend selection, NAT, session affinity, and for Cilium direct server return (DSR) modes that let a reply leave from the pod's own address.
This is where XDP enters. Cilium's NodePort and DSR acceleration can attach an XDP program at the driver hook, before the kernel allocates an skb. It is the fastest path available and the most fragile, because the program must be attached to a specific interface and stay attached. Issue #17540 is a story about exactly that attachment disappearing.
4. Observability
Cilium's Hubble turns datapath events into flow records: source identity, destination identity, verdict, and for L7-aware policies, the HTTP method and path. Calico's equivalent is flow logs plus Whisker, with staged policies that let an operator see what a policy would have done before enforcing it.
In a silent-policy-loss scenario, flow verdicts are one of the few signals that distinguish "allowed by policy" from "allowed because no policy was loaded".
5. Encryption and identity
Cilium offers WireGuard or IPsec between nodes, and a newer sidecarless mTLS mode using ztunnel that can encrypt pod-to-pod traffic even on the same node. Calico offers WireGuard and IPsec in its dataplanes. Both tie encryption to the identity model: the thing being authenticated is the workload identity, not the IP.
6. Edge and non-pod networking
Calico's reach extends beyond pods: host endpoints apply policy to the node's own interfaces, and that is the workload whose BPF program grows largest in debug builds. Tiers give policy a precedence order across teams, and Windows nodes are supported. Cilium's edge is Cluster Mesh, Gateway API and a growing set of L2 and BGP announcements.
Why one datapath matters
Every job above shares the same programs, maps and attachment points. That is the design's advantage: one packet traversal can enforce policy, translate a service and emit a flow record, instead of hairpinning through netfilter chains. It is also why a single verifier rejection is not a feature outage. The host-endpoint program that fails to load is not "the host-endpoint feature"; it is the program that carries forwarding, policy and service translation for everything arriving on that interface.
An operator can lose policy while keeping connectivity, or lose both. The next part compares this architecture honestly with the alternatives, including the one advantage Calico has that Cilium does not: a dataplane to fall back to.

Next: Part 4 — no fallback: what you gain by putting policy in the kernel, and what you give up when the kernel says no.

Comments (0)