Overlay vs Underlay Networking
Underlay = real physical/cloud network that carries actual packets (routers, switches, data center, cloud VPC). Overlay = virtual network built on top using encapsulation/tunnels (VXLAN, Geneve, GRE). Kubernetes CNI uses overlay (VXLAN) to connect pods across nodes without changing physical network. Both work together: overlay needs healthy underlay.
Overview
Two networks, one packet
Every modern cloud and Kubernetes networking stack uses the overlay-underlay model. It explains how pods on different nodes communicate, why a packet trace shows two IP headers, and what happens when VXLAN breaks.
The whole model fits in one trip between two pods on different nodes. The CNI agent on each node, the Container Network Interface plugin that wires up pod networking, does the work at both ends.
- Pod A, which has an overlay IP such as 10.244.x, sends a packet to Pod B.
- The source node's CNI agent encapsulates it: it wraps the pod's packet inside a new outer header addressed from its own node to Pod B's node.
- The underlay routes that outer packet from node IP to node IP, like any other traffic.
- The destination node's CNI agent strips the outer header and hands the original packet to Pod B.
The rest of this chapter takes the two networks one at a time, starting at the bottom.
Key concepts
- Underlay
- Overlay
- VXLAN
- MTU (Maximum Transmission Unit)
- Encapsulation
- BGP underlay mode (no overlay)
Interview questions
- Explain the difference between overlay and underlay networking in Kubernetes.
- How does VXLAN encapsulation work and what can go wrong?
Sign up free to read the full topic
More DevOps topics
- Native Debugging — gdb, Core Dumps and Symbols
- Node and Scaling Errors — NotReady, Scale-Up, Drain, Terminating and HPA
- Notifications, Alerts and Webhooks
- OpenFeature & Feature Flag Governance
- OpenTelemetry
- OpenTelemetry Collector — Pipelines & Deployment
- PCI-DSS and SOC 2 for Kubernetes
- Perl and PowerShell for Build Automation
- Pipeline-as-Code
- Platform Engineering
- Platform Engineering & IDP Design
- Platform Engineering Maturity Model
Start free on Cariara · Coding problems · System design studio