You deploy a pod in Kubernetes. It gets an IP address and starts talking to other pods, services, and the internet. Underneath, that’s several layers of engineering stacked on top of the Linux kernel.
This post walks through those layers, from iptables up to eBPF, and explains what VXLAN, Calico, and Cilium each do.
The problem
Containers make networking hard in five ways:
- Isolation: each container needs its own network namespace.
- Connectivity: containers must talk to each other, across hosts.
- Services: traffic must be load-balanced across pod replicas.
- Policy: some pods shouldn’t talk to other pods.
- Scale: there are thousands of pods, hundreds of nodes, and millions of connections.
Traditional networking wasn’t built for this, so new layers got built on top.
┌─────────────────────────────────────────────────────────────┐
│ Your Application │
├─────────────────────────────────────────────────────────────┤
│ Kubernetes Services │
├─────────────────────────────────────────────────────────────┤
│ CNI Plugin (Cilium / Calico) │
├─────────────────────────────────────────────────────────────┤
│ Overlay Network (VXLAN) or Direct Routing │
├─────────────────────────────────────────────────────────────┤
│ iptables / nftables / eBPF │
├─────────────────────────────────────────────────────────────┤
│ Linux Kernel │
└─────────────────────────────────────────────────────────────┘
I’ll go bottom-up.
Part 1: iptables and Netfilter
The foundation
Every packet that enters or leaves a Linux machine passes through Netfilter, a framework of hooks inside the kernel’s networking stack.
iptables is the userspace tool for configuring Netfilter rules. The netfilter project started in the late 1990s, and iptables has shipped with the kernel since Linux 2.4 in 2001.
The five hooks
Netfilter provides five points where you can intercept packets:
| Hook | When | Common Use |
|---|---|---|
| PREROUTING | Right after packet arrives | DNAT (change destination) |
| INPUT | Packet destined for this host | Firewall filtering |
| FORWARD | Packet passing through | Router filtering |
| OUTPUT | Locally generated packet | Outbound filtering |
| POSTROUTING | Right before packet leaves | SNAT (change source) |
Tables
Rules are organized into tables by purpose:
# Filter table (default) — accept/drop/reject
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -j DROP
# NAT table — address translation
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.0.0.5:8080
# Mangle table — packet modification
iptables -t mangle -A PREROUTING -p tcp --dport 22 -j TOS --set-tos 0x10
How Kubernetes uses iptables
When you create a Kubernetes Service, kube-proxy creates iptables rules:
# Service ClusterIP: 10.96.0.10 → Pods: 10.244.1.5, 10.244.2.8
# PREROUTING: Intercept traffic to service IP
-A KUBE-SERVICES -d 10.96.0.10/32 -p tcp --dport 80 \
-j KUBE-SVC-XXXX
# Load balance across pods (random probability)
-A KUBE-SVC-XXXX -m statistic --mode random --probability 0.5 \
-j KUBE-SEP-AAAA
-A KUBE-SVC-XXXX \
-j KUBE-SEP-BBBB
# DNAT to actual pod IPs
-A KUBE-SEP-AAAA -p tcp -j DNAT --to-destination 10.244.1.5:80
-A KUBE-SEP-BBBB -p tcp -j DNAT --to-destination 10.244.2.8:80
The problem is that with thousands of services you get tens of thousands of iptables rules. The first packet of every new connection has to be checked against the service rules in order, so the lookup is O(n) in the number of services. The Kubernetes project describes this in its nftables kube-proxy post: as the number of services grows, both the average and the worst-case latency of that first packet grow with it. Updating the rules also gets slow, because kube-proxy has to rewrite a ruleset with tens of thousands of entries.
Part 2: Overlay networks and VXLAN
The multi-host problem
On a single machine, containers can talk through a bridge. Across hosts it gets harder:
Host A (10.0.0.1) Host B (10.0.0.2)
┌─────────────────┐ ┌─────────────────┐
│ Pod 10.244.1.5 │ │ Pod 10.244.2.8 │
│ │ │ │ │ │
│ ┌──┴──┐ │ │ ┌──┴──┐ │
│ │bridge│ │ │ │bridge│ │
│ └──┬──┘ │ │ └──┬──┘ │
│ │ │ │ │ │
│ ┌──┴──┐ │ │ ┌──┴──┐ │
│ │eth0 │ │ │ │eth0 │ │
└────┴──┬──┴──────┘ └────┴──┬──┴──────┘
│ │
└──────── Network ─────────────┘
Pod 10.244.1.5 wants to reach Pod 10.244.2.8, but the physical network only knows about 10.0.0.1 and 10.0.0.2. It has no idea what 10.244.x.x addresses are.
There are two ways to fix that:
- An overlay network, which encapsulates pod traffic inside host traffic
- Direct routing, which teaches the network about pod IPs (BGP)
VXLAN: Virtual Extensible LAN
VXLAN wraps Layer 2 frames inside UDP packets that are routed over the Layer 3 network:
Original Packet (from pod):
┌─────────────────────────────────────────┐
│ Eth │ IP Header │ TCP │ Payload │
│ Hdr │ Src: 10.244.1.5 │
│ │ Dst: 10.244.2.8 │
└─────────────────────────────────────────┘
After VXLAN Encapsulation:
┌────────────────────────────────────────────────────────────────┐
│ Outer │ Outer IP │ UDP │ VXLAN │ Original Packet │
│ Eth │ Src: 10.0.0.1 │ 4789 │ VNI │ (unchanged) │
│ │ Dst: 10.0.0.2 │ │ │ │
└────────────────────────────────────────────────────────────────┘
A VTEP (VXLAN Tunnel Endpoint) handles encapsulation and decapsulation:
Pod A VTEP A VTEP B Pod B
10.244.1.5 10.0.0.1 10.0.0.2 10.244.2.8
│ │ │ │
│ packet to │ │ │
│ 10.244.2.8 │ │ │
│───────────────────>│ │ │
│ │ encapsulate │ │
│ │ UDP to 10.0.0.2:4789 │ │
│ │────────────────────────>│ │
│ │ │ decapsulate │
│ │ │──────────────────>│
│ │ │ │
VXLAN identifier (VNI)
VXLAN uses a 24-bit VNI (VXLAN Network Identifier). A VLAN ID is 12 bits, which gives 4,094 networks. 24 bits gives 16,777,216, and multi-tenant clouds need that headroom.
The overhead
VXLAN adds ~50 bytes of headers:
| Component | Bytes |
|---|---|
| Outer Ethernet | 14 |
| Outer IP | 20 |
| UDP | 8 |
| VXLAN | 8 |
| Total | 50 |
The four outer headers and what they leave for the pod.
If your MTU is 1500, inner packets must be ≤1450 bytes to avoid fragmentation.
# Configure MTU for VXLAN (example with Flannel)
# Pod MTU = Physical MTU - VXLAN overhead
# 1450 = 1500 - 50
Creating VXLAN in Linux
# Create VXLAN interface
# id 42 VNI
# dstport 4789 standard VXLAN port
# local 10.0.0.1 this host's IP
# group 239.1.1.1 multicast group for discovery
ip link add vxlan0 type vxlan \
id 42 \
dstport 4789 \
local 10.0.0.1 \
group 239.1.1.1 \
dev eth0
ip link set vxlan0 up
ip addr add 10.244.1.1/24 dev vxlan0
# Or with unicast (flood-and-learn)
bridge fdb append 00:00:00:00:00:00 dev vxlan0 dst 10.0.0.2
Part 3: eBPF
What is eBPF?
eBPF (extended Berkeley Packet Filter) lets you run sandboxed programs inside the Linux kernel without changing kernel code or loading kernel modules.
┌─────────────────────────────────────────────────────────────┐
│ User Space │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Your eBPF Program (C) │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ LLVM Compiler │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ eBPF Bytecode │ │
│ └──────────────────────┼───────────────────────────────┘ │
│ │ bpf() syscall │
└─────────────────────────┼───────────────────────────────────┘
│
┌─────────────────────────┼───────────────────────────────────┐
│ ▼ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ eBPF Verifier │ │
│ │ • No infinite loops │ │
│ │ • No out-of-bounds memory access │ │
│ │ • No dangerous kernel functions │ │
│ └──────────────────────┬───────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ JIT Compiler │ │
│ │ (Bytecode → Native Machine Code) │ │
│ └──────────────────────┬───────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Attached to Kernel Hook │ │
│ │ (XDP, tc, kprobe, tracepoint, etc.) │ │
│ └──────────────────────────────────────────────────────┘ │
│ Kernel Space │
└─────────────────────────────────────────────────────────────┘
Why eBPF is powerful
- The code runs in the kernel, so there are no context switches and no user/kernel boundary crossing.
- It’s programmable: you write custom logic instead of only configuring rules.
- It’s safe, because the verifier makes sure programs can’t crash the kernel.
- It’s fast, because programs are JIT-compiled to native machine code.
- It’s dynamic: you load and unload programs without rebooting.
eBPF networking hooks
Packet arrives
│
▼
┌─────────────┐
│ XDP │ ← Earliest possible hook, before SKB allocation
│ (eXpress │ Can DROP, PASS, TX, REDIRECT, or ABORTED
│ Data Path) │ Runs at driver level, ~10M packets/sec possible
└──────┬──────┘
│
▼
┌─────────────┐
│ tc ingress │ ← After SKB (socket buffer) allocation
│ (Traffic │ Full packet parsing available
│ Control) │ Can modify, redirect, or drop
└──────┬──────┘
│
▼
Netfilter/iptables
│
▼
Routing decision
│
▼
┌─────────────┐
│ tc egress │ ← Before packet leaves
└──────┬──────┘
│
▼
Packet sent
XDP: maximum performance
In native mode, XDP (eXpress Data Path) runs inside the network driver, before the kernel allocates an SKB for the packet. That makes it the fastest hook available in software.
// Simple XDP program: drop all UDP traffic
#include <linux/bpf.h>
#include <linux/if_ether.h>
#include <linux/ip.h>
#include <linux/in.h>
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_endian.h>
SEC("xdp")
int xdp_drop_udp(struct xdp_md *ctx) {
void *data = (void *)(long)ctx->data;
void *data_end = (void *)(long)ctx->data_end;
// Parse Ethernet header
struct ethhdr *eth = data;
if ((void *)(eth + 1) > data_end)
return XDP_PASS;
// Only handle IPv4
if (eth->h_proto != bpf_htons(ETH_P_IP))
return XDP_PASS;
// Parse IP header
struct iphdr *ip = (void *)(eth + 1);
if ((void *)(ip + 1) > data_end)
return XDP_PASS;
// Drop UDP packets
if (ip->protocol == IPPROTO_UDP)
return XDP_DROP;
return XDP_PASS;
}
char _license[] SEC("license") = "GPL";
Load it:
# Compile
clang -O2 -target bpf -c xdp_drop_udp.c -o xdp_drop_udp.o
# Load onto interface (native mode if the driver supports it)
ip link set dev eth0 xdp obj xdp_drop_udp.o sec xdp
If the driver has no native XDP support, xdpgeneric in place of xdp forces generic mode. Generic XDP runs later in the stack, after the SKB is allocated, so it works everywhere but loses most of the speed advantage.
eBPF maps: state between calls
eBPF programs are stateless by default. Maps give them shared storage:
// Define a hash map: IP address → packet count
struct {
__uint(type, BPF_MAP_TYPE_HASH);
__uint(max_entries, 10000);
__type(key, __u32); // IP address
__type(value, __u64); // Counter
} packet_count SEC(".maps");
SEC("xdp")
int count_packets(struct xdp_md *ctx) {
// ... parse packet to get source IP ...
__u32 src_ip = ip->saddr;
__u64 *count = bpf_map_lookup_elem(&packet_count, &src_ip);
if (count) {
(*count)++;
} else {
__u64 init = 1;
bpf_map_update_elem(&packet_count, &src_ip, &init, BPF_ANY);
}
return XDP_PASS;
}
Map types include:
BPF_MAP_TYPE_HASH: hash tableBPF_MAP_TYPE_ARRAY: arrayBPF_MAP_TYPE_LRU_HASH: LRU cacheBPF_MAP_TYPE_RINGBUF: ring buffer for eventsBPF_MAP_TYPE_LPM_TRIE: longest prefix match (for routing)
eBPF vs iptables performance
iptables does O(n) rule traversal, a linear scan through the service rules. eBPF does O(1) map lookups: a hash table lookup costs about the same regardless of how many services there are.
How much that matters depends on cluster size. In one published test, Azure reported about 30% lower service routing latency for Azure CNI powered by Cilium than for a kube-proxy cluster at 16,000 pods.
Part 4: Calico and BGP-based networking
What is Calico?
Calico is a CNI (Container Network Interface) plugin that provides networking and security for containers. It takes a “Layer 3” approach and treats every pod as a first-class citizen with a routable IP.
How Calico works
Instead of overlays, Calico uses BGP (Border Gateway Protocol) to distribute pod routes:
┌─────────────────────────────────────────────────────────────┐
│ Physical Network / Router │
│ │
│ "10.244.1.0/24 via 10.0.0.1" │
│ "10.244.2.0/24 via 10.0.0.2" │
└──────────────────────────┬──────────────────────────────────┘
│
┌────────────────┴────────────────┐
│ │
┌─────────┴─────────┐ ┌─────────┴─────────┐
│ Host A │ │ Host B │
│ 10.0.0.1 │ │ 10.0.0.2 │
│ │ │ │
│ ┌───────────────┐ │ │ ┌───────────────┐ │
│ │ BIRD (BGP) │ │◄───BGP────►│ │ BIRD (BGP) │ │
│ │ │ │ │ │ │ │
│ │ Announces: │ │ │ │ Announces: │ │
│ │ 10.244.1.0/24 │ │ │ │ 10.244.2.0/24 │ │
│ └───────────────┘ │ │ └───────────────┘ │
│ │ │ │
│ Pod │ │ Pod │
│ 10.244.1.5 │ │ 10.244.2.8 │
└───────────────────┘ └───────────────────┘
Each node runs BIRD, a BGP daemon that:
- Announces its pod CIDR to peers
- Learns other nodes’ pod CIDRs
- Programs routes in the Linux routing table
# Routes on Host A
$ ip route
10.244.1.5 dev cali12ab34cd56e scope link # ← Local pod, one route per pod
10.244.2.0/24 via 10.0.0.2 dev eth0 proto bird # ← Learned from Host B
The /24 per node keeps the example simple. By default Calico’s IPAM hands out /26 blocks (64 addresses), and a node can hold several of them.
Calico architecture
┌─────────────────────────────────────────────────────────────┐
│ Kubernetes API │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────┴──────────────────────────────────┐
│ calico/kube-controllers │
│ Syncs network policies from K8s to Calico │
└──────────────────────────┬──────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌─────────┴────────┐ ┌─────┴──────┐ ┌───────┴──────┐
│ Felix │ │ Felix │ │ Felix │
│ (per node) │ │ │ │ │
│ │ │ │ │ │
│ • Programs routes│ │ │ │ │
│ • Programs │ │ │ │ │
│ iptables/eBPF │ │ │ │ │
│ • Enforces │ │ │ │ │
│ policies │ │ │ │ │
└─────────┬────────┘ └─────┬──────┘ └───────┬──────┘
│ │ │
┌─────────┴────────┐ ┌─────┴──────┐ ┌───────┴──────┐
│ BIRD (BGP) │ │ BIRD │ │ BIRD │
│ Daemon │ │ │ │ │
└──────────────────┘ └────────────┘ └──────────────┘
Felix is the agent on each node. It watches for NetworkPolicy changes, programs iptables/eBPF rules, and manages routes. BIRD is the BGP daemon that distributes the routes.
Calico network policies
Calico extends Kubernetes NetworkPolicy:
# Calico GlobalNetworkPolicy
apiVersion: projectcalico.org/v3
kind: GlobalNetworkPolicy
metadata:
name: deny-external-egress
spec:
selector: app == 'backend'
types:
- Egress
egress:
# Allow traffic to other pods
- action: Allow
destination:
selector: all()
# Allow DNS
- action: Allow
protocol: UDP
destination:
ports:
- 53
# Deny everything else (implicit with Calico)
Calico data planes
Calico supports multiple data planes:
| Data Plane | Pros | Cons |
|---|---|---|
| iptables (default) | Mature, widely understood | O(n) scaling |
| eBPF | O(1) lookups, lower latency | Linux 5.10+, less mature |
| Windows HNS | Windows support | Windows only |
| VPP | Very high performance | Complex |
Enable eBPF mode:
# Switch to eBPF data plane
calicoctl patch felixconfiguration default \
--patch='{"spec": {"bpfEnabled": true}}'
Part 5: Cilium and eBPF-native networking
What is Cilium?
Cilium is a CNI plugin built from the ground up on eBPF. Calico added eBPF as an option, while Cilium was designed for it from day one. It’s widely used across managed Kubernetes offerings (for example, GKE Dataplane V2 uses Cilium), though it isn’t the default in every cloud Kubernetes service.
Cilium architecture
┌─────────────────────────────────────────────────────────────┐
│ Kubernetes API │
└──────────────────────────┬──────────────────────────────────┘
│
┌──────────────────────────┴──────────────────────────────────┐
│ Cilium Operator │
│ • Manages CiliumNode CRDs │
│ • IPAM allocation │
│ • Garbage collection │
└──────────────────────────┬──────────────────────────────────┘
│
┌────────────────┼────────────────┐
│ │ │
┌─────────┴────────┐ ┌─────┴──────┐ ┌───────┴──────┐
│ Cilium Agent │ │ Agent │ │ Agent │
│ (per node) │ │ │ │ │
│ │ │ │ │ │
│ • Loads eBPF │ │ │ │ │
│ programs │ │ │ │ │
│ • Manages eBPF │ │ │ │ │
│ maps │ │ │ │ │
│ • Identity │ │ │ │ │
│ management │ │ │ │ │
└─────────┬────────┘ └─────┬──────┘ └───────┬──────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────┐
│ eBPF Programs in Kernel │
│ │
│ XDP ──► tc ingress ──► Routing ──► tc egress │
│ │
│ eBPF Maps: │
│ • Endpoint map (pod identity → IP) │
│ • Policy map (identity → allowed identities) │
│ • NAT map (service VIP → backend pods) │
│ • Connection tracking map │
└─────────────────────────────────────────────────────────────┘
Identity-based security
Cilium’s security model uses identities instead of IP addresses. Each pod gets an identity based on its labels:
Pod Labels Cilium Identity
─────────────────────────────────────────────
app=frontend, env=prod → Identity 12345
app=backend, env=prod → Identity 12346
app=frontend, env=dev → Identity 12347
When a packet arrives, Cilium:
- Looks up source identity in eBPF map
- Looks up destination identity
- Checks policy map: is (src_identity → dst_identity) allowed?
┌──────────────┐ ┌──────────────┐
│ frontend │ │ backend │
│ ID: 12345 │────────►│ ID: 12346 │
└──────────────┘ └──────────────┘
│
▼
Policy Map: {12345 → 12346: ALLOW}
This holds up better than IP-based rules. IP addresses change constantly (pod restarts, scaling), while labels are stable and semantic, so policy doesn’t break when pods move.
L7 (application layer) policies
Cilium can inspect HTTP, gRPC, Kafka, and more:
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: api-access
spec:
endpointSelector:
matchLabels:
app: backend
ingress:
- fromEndpoints:
- matchLabels:
app: frontend
toPorts:
- ports:
- port: "80"
protocol: TCP
rules:
http:
- method: "GET"
path: "/api/v1/users"
- method: "POST"
path: "/api/v1/orders"
With this policy:
GET /api/v1/usersfrom frontend to backend is allowedPOST /api/v1/ordersfrom frontend to backend is allowedDELETE /api/v1/usersfrom frontend to backend is denied
Hubble: observability
Hubble is Cilium’s observability layer. It uses eBPF to show traffic flows in real time:
# Watch all flows
hubble observe
# Filter by pod
hubble observe --pod frontend-xxx
# Filter by verdict
hubble observe --verdict DROPPED
# Metrics for Prometheus/Grafana are enabled in the Helm chart
# (hubble.metrics.enabled)
TIMESTAMP SOURCE DESTINATION VERDICT
12:34:56.789 frontend/pod-abc backend/pod-xyz FORWARDED
12:34:56.790 frontend/pod-abc database/pod-123 DROPPED (policy)
12:34:56.791 backend/pod-xyz external/1.2.3.4 FORWARDED
Cilium service mesh
Cilium can replace sidecar proxies (like Envoy in Istio):
Traditional Service Mesh:
┌─────────────────────────────────┐
│ Pod │
│ ┌───────────┐ ┌───────────┐ │
│ │ App │──│ Envoy │──│──► Network
│ │ │ │ Sidecar │ │
│ └───────────┘ └───────────┘ │
└─────────────────────────────────┘
Extra container, extra latency, extra memory
Cilium Service Mesh:
┌─────────────────────────────────┐
│ Pod │
│ ┌───────────┐ │
│ │ App │─────────────────│──► Network
│ └───────────┘ │ │
└─────────────────────────────────┘ │
│
eBPF handles L3/L4 │
in kernel, one Envoy │
per node handles L7 │
▼
You don’t need a sidecar in every pod. eBPF handles L3/L4 in the kernel. HTTP and gRPC traffic that needs L7 handling is redirected to an Envoy proxy that Cilium runs once per node.
Part 6: Comparison and when to use what
Feature comparison
| Feature | iptables | Calico (iptables) | Calico (eBPF) | Cilium |
|---|---|---|---|---|
| Scalability | Poor | Moderate | Good | Excellent |
| L3/L4 Policy | Yes | Yes | Yes | Yes |
| L7 Policy | No | Limited | Limited | Yes |
| Observability | tcpdump | Basic | Better | Hubble |
| Windows | No | Yes | No | No |
| Kernel version | Any | Any | 5.10+ | 5.10+ |
| Learning curve | High | Moderate | Moderate | Higher |
Performance comparison
Cilium publishes its own CNI performance benchmark, run with netperf between pods on two bare-metal nodes with 100 Gbit/s NICs (Cilium 1.9.6, Calico 3.17.3, Linux 5.10). The results are charts of throughput, request/response rate and connection rate. Its main conclusion is that eBPF on a modern kernel gets close to the node-to-node baseline. It is a vendor benchmark, so read it as such.
That benchmark doesn’t vary the number of services. The service-count scaling problem from Part 1 is separate: at small scale the differences are negligible, and they grow with the number of services.
When to choose each
Choose iptables (kube-proxy) when:
- the cluster is simple, with <100 services
- you need maximum compatibility
- the team knows iptables well
- you don’t need advanced policies
Choose Calico when:
- you need BGP integration with the physical network
- you’re running on-premises with existing network infrastructure
- you need Windows node support
- you want flexibility (you can switch data planes)
- you need GlobalNetworkPolicy across namespaces
Choose Cilium when:
- you’re running at scale (1000+ pods)
- you need L7 visibility and policy
- you want a service mesh without sidecars
- you’re running on GKE or AKS (native support)
- you need advanced observability (Hubble)
- you’re building a zero-trust network
Migration path
A common path looks like this:
iptables/kube-proxy
│
│ Scale issues, need policies
▼
Calico (iptables)
│
│ Need better performance, observability
▼
Calico (eBPF) or Cilium
│
│ Need L7 policies, service mesh
▼
Cilium
Quick reference
Commands cheat sheet
# iptables
iptables -L -n -v # List all rules
iptables -t nat -L -n -v # List NAT rules
iptables-save > backup.rules # Backup
iptables-restore < backup.rules # Restore
# VXLAN
ip link show type vxlan # Show VXLAN interfaces
bridge fdb show dev vxlan0 # Show forwarding database
# eBPF
bpftool prog list # List loaded programs
bpftool map list # List maps
bpftool net list # List network attachments
# Calico
calicoctl get nodes # List nodes
calicoctl get networkpolicies -A # List policies
calicoctl node status # Check BGP status
# Cilium
cilium status # Cluster status (cilium CLI)
cilium-dbg endpoint list # List endpoints (inside the agent pod)
cilium-dbg policy get # Get policies (inside the agent pod)
hubble observe # Watch traffic flows
MTU quick reference
| Encapsulation | Overhead | Inner MTU (if outer=1500) |
|---|---|---|
| None (native) | 0 | 1500 |
| VXLAN | 50 | 1450 |
| Geneve | 50 | 1450 |
| WireGuard | 60 | 1440 |
| IPsec (AES) | 73 | 1427 |
Summary
Container networking is a stack of technologies:
- Netfilter/iptables is the original Linux firewall. It still works, but it doesn’t scale.
- VXLAN is an overlay network that tunnels L2 over L3, which solves multi-host networking.
- eBPF makes the kernel programmable and gives O(1) lookups. Modern CNIs are built on it.
- Calico does BGP-based networking with flexible data planes, and it’s great for hybrid environments.
- Cilium is eBPF-native, with identity-based security, L7 policies, and the best observability of the lot.
Choose based on your scale, your requirements, and what your team knows. Start simple with Calico and move to Cilium when you need it.