Free tech learning for everyone, from basics to pro

Network ArchitectureNetworking SecurityIntermediate

Overlay networks explained: underlay, tunnels, VXLAN, LISP and when to use them

In short: An overlay is a virtual network built on top of a physical one by wrapping traffic in tunnels. The underlay only has to move packets between tunnel endpoints, while the overlay gives each tenant or application its own network. VXLAN, GRE, IPsec, DMVPN, LISP and SD-WAN are all overlays. They add flexibility and scale, but also header overhead and an extra layer to troubleshoot.

Two networks in one

An underlay is the physical network: switches, routers and links running an ordinary routing protocol such as OSPF, IS-IS or BGP. Its only job is to get IP packets reliably from one point to another. An overlay is a logical network built on top by encapsulation: a device at the edge wraps the original packet or frame inside a new header addressed to another edge device, the underlay carries it, and the far end unwraps it.

Underlay and overlayOverlayvirtual networks for tenants and appsTunnel encapsulationVXLAN, GRE, IPsecUnderlayphysical routed network
Figure 1. The overlay rides on the underlay. The underlay only needs to deliver packets between tunnel endpoints.

Because the underlay only sees the outer headers, the overlay can use any addresses and segments it likes, and you can change the overlay without touching the physical network. This decoupling is the main reason overlays are so popular in data centres, campus fabrics and WANs.

Common overlay technologies

TechnologyWhat it carriesWhere you meet it
GREAlmost any protocol inside IP, no encryptionSimple router-to-router tunnels
IPsec VPNEncrypted IP trafficSite-to-site links over the internet
DMVPNDynamic GRE over IPsec between many sitesCisco hub-and-spoke WANs
VXLANEthernet frames inside UDPData centre and campus fabrics
LISPSeparates who a host is from where it isCampus fabrics such as Cisco SD-Access
SD-WANEncrypted tunnels managed by a controllerBranch WANs over several transports

VLANs are sometimes listed alongside these because they also create virtual networks on shared hardware, but they work by tagging frames rather than tunnelling them, and they stop at the first router.

VXLAN in a little more detail

A VXLAN packet on its wayHost frameoriginalEthernetIngress VTEPadds VXLAN +UDP + IPUnderlayroutes byouter IPEgress VTEPremoves outerheadersHost framedelivered assent
Figure 2. A VTEP wraps the original frame in new headers, so the routed underlay never sees the tenant's addresses.

Virtual Extensible LAN (VXLAN), defined in RFC 7348, carries Layer 2 frames across a routed Layer 3 network. The devices that wrap and unwrap traffic are VXLAN tunnel endpoints (VTEPs), usually the leaf switches of a spine-leaf fabric. Each virtual segment has a 24-bit VXLAN network identifier (VNI), giving around 16 million segments compared with about 4,000 VLANs. The outer packet uses UDP destination port 4789.

VTEPs need to learn which hosts sit behind which other VTEP. Early designs used flooding through multicast; modern fabrics use BGP EVPN as a control plane, so VTEPs advertise MAC and IP addresses to each other like routes.

interface nve1
 source-interface loopback1
 host-reachability protocol bgp
 member vni 10100
  ingress-replication protocol bgp

This NX-OS style snippet shows the idea: the VTEP interface, its loopback source, and BGP learning for one VNI. Exact syntax differs between platforms.

Benefits and costs

  • Benefits: decoupling (change the virtual network without recabling), agility (new segments in minutes, often through a controller), scale (millions of segments, any-to-any reach across a routed fabric with no spanning tree) and mobility (a virtual machine keeps its address when it moves).
  • Overhead: every encapsulation adds bytes. VXLAN adds about 50 bytes, so the underlay MTU must be raised (data centres often use 9,000-byte jumbo frames) or packets will be fragmented or dropped.
  • Complexity: there are now two networks to design, document and monitor, plus a control plane such as EVPN or LISP.
  • Troubleshooting: a capture on the underlay shows outer headers only; you need tools that understand the overlay, and you must check both layers when something fails.

Real-world example: two hospital data halls

A fictional hospital trust had two data halls on the same site. Clinical applications needed some servers to sit in the same Layer 2 segment in both halls for clustering, and the old design stretched VLANs with spanning tree, which caused an outage when a loop formed during maintenance. The network team rebuilt both halls as one routed spine-leaf underlay running OSPF, and added a VXLAN overlay with a BGP EVPN control plane. The clustered servers kept their shared segment, but now as a VNI carried across routed links with no spanning tree between the halls. The team raised the underlay MTU to 9,216 bytes before migration, after a test showed large database transfers failing at the default 1,500.

Practice

What is the job of the underlay in an overlay design?
To deliver IP packets reliably between tunnel endpoints. It does not need to know about the virtual networks carried inside.
Why might a new VXLAN fabric drop large packets?
VXLAN adds about 50 bytes of headers. If the underlay MTU was not raised, full-size frames no longer fit and are dropped or fragmented.
How many segments can VXLAN identify, and why?
About 16 million, because the VNI is 24 bits long, compared with the 12-bit VLAN ID that allows about 4,000.

Key takeaways

  • An overlay is a virtual network carried in tunnels over a physical underlay.
  • GRE, IPsec, DMVPN, VXLAN, LISP and SD-WAN are all overlays.
  • VXLAN carries Layer 2 over Layer 3 using VTEPs, 24-bit VNIs and UDP 4789.
  • BGP EVPN is the usual control plane for modern VXLAN fabrics.
  • Plan for header overhead (MTU), extra complexity and two-layer troubleshooting.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.