Overlay networking is a method of creating a virtual network layer that operates independently of the underlying physical network. This abstraction enables flexible communication between devices or systems, regardless of their physical location or the topology of the underlying network.
VPN as a form of Overlay networking
VPNs are a specialized type of overlay network:
- VPNs typically encrypt data, whereas not all overlay networks do (e.g., VXLAN or GRE may operate without encryption).
- VPNs prioritize secure communication, while overlay networking’s primary focus is network abstraction and scalability.
How Overlay Networking Works
Overlay networks encapsulate data packets using an additional protocol layer. This encapsulation allows packets to traverse the physical network while appearing to the endpoints as if they are on the same virtual network. Common encapsulation methods include:
- VXLAN (Virtual Extensible LAN): Encapsulates Layer 2 frames into Layer 3 packets, extending networks across physical boundaries.
- GRE (Generic Routing Encapsulation): Encapsulates packets with minimal overhead, often used for tunneling protocols.
- IP-in-IP: Encapsulates IP packets within another IP packet.
Tip
There are various levels of overlay networking (at level 2, at level 3) of the ISO stack
When a packet is sent over an overlay network:
- Encapsulation: The source node wraps the original packet with additional headers to route it through the physical network.
- Transmission: The encapsulated packet traverses the physical network like a regular packet.
- Decapsulation: The destination node removes the encapsulation, restoring the original packet for delivery.
Benefits of Overlay Networking
- Network Abstraction: Simplifies the network design by decoupling the logical topology from the physical infrastructure.
- Portability: Ideal for connecting systems across different physical networks, such as in multi-cloud or hybrid cloud setups.
- Scalability: Easily extends virtual networks to accommodate new systems or services without altering the physical network.
- Cross-Boundary Communication: Enables communication between systems across subnets, regions, or even entirely different data centers.
Drawbacks of Overlay Networking
- Performance Overhead:
- Encapsulation and decapsulation consume additional CPU and memory resources.
- Adds latency compared to native networking.
- Complexity:
- Troubleshooting network issues can be more challenging due to the additional abstraction layer.
- Requires careful configuration to avoid packet loss or fragmentation.
- Bandwidth Utilization:
- Encapsulation increases packet size, consuming more bandwidth.
Use Cases for Overlay Networking
- Data Center Virtualization:
- Extends VLANs across data centers using protocols like VXLAN.
- Supports dynamic scaling of virtualized environments.
- Cloud Networking:
- Used in multi-cloud or hybrid cloud setups to unify network communication.
- Allows virtual private networks (VPNs) to connect on-premises and cloud environments.
- Container Orchestration (e.g., Kubernetes):
- Overlay networks are often used to enable pod-to-pod communication across nodes in Kubernetes clusters.
- Tools like Flannel or Calico implement overlay networking in Kubernetes.
- Software-Defined Networking (SDN):
- Forms the backbone of SDN by separating the control and data planes and abstracting networking into software-defined policies.
Examples of Overlay Networking Protocols
- VXLAN:
- Widely used in modern data centers for scalable Layer 2 overlays over Layer 3 networks.
- GRE:
- A lightweight tunneling protocol for encapsulation and routing across networks.
- IPSec:
- Adds encryption to overlay networks for secure communication.