>

Encapsulation Protocols: Wrapping Your Packets in Layers Like a Networking Onion

Scott MorrisonNovember 15, 2025 0 views
MPLS VXLAN Geneve encapsulation network tunneling traffic engineering GRE QUIC network protocols packet overhead
From MPLS to VXLAN to the experimental chaos of tunneling over QUIC, encapsulation protocols let us pretend the network is whatever we need it to be. Just because you can wrap packets in seventeen layers of headers doesn't mean you should, but sometimes you absolutely must.

At its core, networking is about getting packets from Point A to Point B. But sometimes the path between those points doesn't speak the right language, doesn't provide the features you need, or simply doesn't care about your requirements. That's where encapsulation comes in, the art of wrapping your packet in another packet and pretending the underlying network is whatever you need it to be.

It's turtles all the way down, except the turtles are packets and they're nested inside each other like a networking Russian doll.

MPLS: The King That Refuses to Abdicate

Multi-Protocol Label Switching (MPLS) has been declared dead so many times that it's achieved zombie status. SD-WAN was supposed to kill it. The cloud was supposed to kill it. The internet was supposed to kill it. Yet here we are in 2025, and MPLS remains the top choice in provider networks for one simple reason: it still does traffic engineering better than anything else.

MPLS works by attaching labels to packets at the network edge. Core routers then forward packets based on these labels rather than IP addresses, which is faster and more flexible than traditional IP routing. But the real magic is in how those labels enable traffic engineering.

With traditional IP routing, packets follow the shortest path as determined by routing protocols. If that shortest path is congested, too bad, the packets go that way anyway. MPLS changes the game by letting operators explicitly define paths through the network based on bandwidth availability, latency requirements, or business policy.

Need to send high-priority traffic over the expensive but low-latency link while routing bulk traffic over the cheap but slower path? MPLS can do that. Want to guarantee bandwidth for specific applications? MPLS handles it. Need to reroute traffic around a congested link before it becomes a problem? MPLS makes it tractable.

RSVP-TE and the Art of Path Reservation

RSVP-TE (Resource Reservation Protocol, Traffic Engineering) is MPLS's traffic cop. It establishes Label Switched Paths (LSPs) with specific bandwidth guarantees and explicit routes through the network. When you request an RSVP-TE path, you're essentially calling ahead to reserve your lane on the network highway.

The protocol walks through the network hop by hop, asking each router "can you give me X bandwidth on this link?" If every router along the path says yes, the path is established and bandwidth is reserved. If any router can't commit, the path establishment fails and you try an alternate route.

This is powerful but also complex. RSVP-TE requires state at every hop, needs to handle path re-optimization when network conditions change, and must deal with failure scenarios gracefully. It's sophisticated traffic management at the cost of operational overhead.

Modern implementations have added features like auto-bandwidth (automatically adjusting reservations based on actual usage) and Fast Reroute (pre-computing backup paths for sub-50ms failover). These enhancements keep MPLS relevant even as newer technologies emerge.

QoS and Bandwidth Guarantees: MPLS's Killer Feature

Quality of Service in MPLS isn't an afterthought, it's fundamental to the architecture. The EXP bits in the MPLS label (now called Traffic Class bits, though everyone still calls them EXP bits) provide eight classes of service. Combined with DiffServ, this enables sophisticated traffic prioritization.

Voice traffic gets strict priority queuing with guaranteed bandwidth. Video gets weighted fair queuing with latency bounds. Bulk data gets whatever's left. This isn't theoretical, service providers run real-time voice and video services over MPLS with carrier-grade reliability because the QoS actually works.

The bandwidth reservation capabilities matter immensely for service providers selling VPN services. When a customer pays for 100 Mbps of guaranteed bandwidth, RSVP-TE ensures that bandwidth actually exists through the network. It's not best-effort, it's contractual commitment backed by protocol-level reservations.

This is why MPLS persists in provider networks despite being "old" technology. Nothing else provides this level of deterministic QoS and traffic engineering at scale. SD-WAN vendors will tell you their AI-powered path selection is better, but when you actually need guaranteed bandwidth for real-time applications, MPLS still delivers.

MPLSoUDP: Teaching Old Dogs New Tricks

MPLS over UDP solves a specific but important problem: load balancing. Traditional MPLS doesn't play nicely with ECMP (Equal-Cost Multi-Path) load balancing because the MPLS label is below the IP header. Routers performing ECMP hash the IP header fields, and since all packets in an MPLS LSP have the same source and destination IP, they all hash to the same path. Your carefully provisioned multi-path network becomes a single path bottleneck.

MPLSoUDP encapsulates MPLS packets in UDP to enable fine-grained load balancing across ECMP paths and link aggregation groups by using UDP port numbers as entropy fields (IETFRFC Editor). The source UDP port is computed from a hash of the inner packet, providing the entropy that ECMP needs to distribute traffic across multiple paths.

The high entropy from the variable source UDP port enables better distribution of traffic across ECMP paths and NIC receive queues, improving throughput and CPU utilization (IoSonoUnRouter). This matters particularly for high-bandwidth applications where saturating a single path while other paths sit idle wastes expensive network capacity.

The catch is that MPLSoUDP should only be deployed in managed networks, not over the public internet. UDP has no congestion control, so if you send MPLSoUDP traffic into congested networks, you're being a bad internet citizen. But within a single provider network or between cooperating providers, it's a pragmatic solution to the ECMP problem.

VXLAN: When You Need Layer 2 Over Layer 3

Virtual Extensible LAN (VXLAN) was born from necessity. Data centers needed to stretch Layer 2 networks across Layer 3 boundaries for virtual machine mobility. Traditional VLANs were limited to 4,096 identifiers, nowhere near enough for multi-tenant cloud environments. VXLAN solved both problems.

VXLAN encapsulates Ethernet frames in UDP packets, using a 24-bit VXLAN Network Identifier (VNI) to provide 16 million possible network segments. The UDP encapsulation lets VXLAN packets traverse any IP network, and the VNI provides sufficient scale for massive multi-tenant environments.

The protocol is simple: take an Ethernet frame, add a VXLAN header with the VNI, wrap it in UDP, add IP headers, and send it. The receiving end strips the headers and delivers the original Ethernet frame. Virtual machines in different physical locations appear to be on the same Layer 2 network.

VXLAN became the de facto standard for data center network virtualization. VMware NSX uses it. OpenStack uses it. Most cloud providers use it. It works, it's well-understood, and hardware vendors have built extensive ASIC support for VXLAN encapsulation and decapsulation.

But VXLAN has limitations. The header format is fixed, offering no room for additional metadata. The protocol assumes Ethernet payloads. And as network virtualization evolved, people wanted to carry more information in the encapsulation, things like security group IDs, telemetry data, or service chain identifiers. VXLAN couldn't accommodate these needs.

Geneve: VXLAN's Flexible Younger Sibling

Geneve (Generic Network Virtualization Encapsulation) was created by Intel, Microsoft, Red Hat, and VMware to combine the best of current network virtualization encapsulations (VXLAN, NVGRE, and STT) into a single extensible protocol (Vmware). The key innovation is the TLV (Type-Length-Value) structure for optional metadata.

Unlike VXLAN's fixed header, Geneve supports variable-length options in TLV format, making it more scalable and flexible (IP With Ease). Want to carry security policy information? Add a TLV. Need telemetry data for network monitoring? Add a TLV. Implementing service chaining? Add TLVs for that too. The protocol can evolve without breaking existing implementations because endpoints can skip TLVs they don't understand.

The TLV structure makes it easy for hardware to skip metadata types it cannot or does not need to understand, allowing independent evolution of software and hardware endpoint capabilities (Vmware). This is crucial for long-term viability, VXLAN's limitations became apparent only after deployment at scale, and the protocol couldn't adapt. Geneve's extensibility means new use cases don't require new protocols.

Geneve also includes a protocol type field, unlike VXLAN which assumes Ethernet payloads. This lets Geneve encapsulate any protocol, not just Ethernet frames. It's genuinely generic network virtualization.

Performance testing shows Geneve using less CPU than VXLAN in some scenarios despite VXLAN-specific hardware offloads, due to optimizations in recent Linux kernels (Russellbryant). The flexibility doesn't come at a performance cost.

The challenge is adoption. VXLAN has a massive installed base. Changing encapsulation protocols in production networks is complex and risky. Geneve is seeing adoption in newer deployments, especially where its extensibility provides clear value, but VXLAN isn't disappearing anytime soon. Both protocols will coexist for years.

GRE: The Swiss Army Knife of Tunneling

Generic Routing Encapsulation (GRE) predates most of these protocols. It's the original "wrap anything in anything" protocol. GRE can encapsulate any network-layer protocol inside any other network-layer protocol. Need to tunnel IPv6 over IPv4? GRE. Want to send MPLS over IP? GRE can do it (though MPLSoUDP is better for load balancing). Multicast traffic across networks that don't support multicast? GRE's got you covered.

The simplicity is both GRE's strength and weakness. It's easy to implement, widely supported, and flexible. But it's also basic, no fancy features, no built-in security, no quality of service mechanisms beyond what the underlying network provides. It's a tunnel, nothing more.

GRE still has its place. Point-to-point tunnels between sites where you just need basic connectivity work fine with GRE. It's the duct tape of network protocols, not elegant, but it gets the job done.

Combining Encapsulations: Turtles All The Way Down

Here's where things get interesting: you can stack encapsulations. An application sends a packet over a VPN (IPsec encapsulation). The VPN endpoint places it in a VXLAN tunnel (VXLAN encapsulation). The data center gateway sends it over an MPLS WAN (MPLS encapsulation). The MPLS provider core uses MPLSoUDP for load balancing (UDP encapsulation of MPLS).

Your original IP packet is now wrapped in IPsec, inside VXLAN, inside MPLS, inside UDP, inside IP. Five layers of encapsulation. The MTU implications are horrifying (more on that in our MTU article), but it works.

This layering is often necessary. Each encapsulation solves a different problem at a different network boundary. VXLAN provides multi-tenancy in the data center. MPLS provides traffic engineering across the WAN. UDP enables load balancing in the provider core. IPsec provides end-to-end security. You can't skip layers just because they add overhead, each serves a purpose.

The art is knowing when you're over-engineering. Three layers of encapsulation might be necessary. Seven layers is probably excessive unless you're demonstrating a proof of concept for a research paper or actively trolling your network operations team.

Encryption and Encapsulation: The Missing Link

Most encapsulation protocols don't include encryption. MPLS? Unencrypted. VXLAN? Unencrypted. Geneve? Unencrypted. GRE? Unencrypted. If you want encryption, you layer another protocol on top, typically IPsec.

The problem is that IPsec has performance issues and operational complexity (we covered this in detail here). It works, but it's not ideal for high-throughput, low-latency applications at scale.

The future likely involves native encryption in encapsulation protocols. Some vendors are experimenting with encrypted VXLAN and encrypted Geneve. MACsec can provide encryption at Layer 2. WireGuard offers a simpler VPN alternative to IPsec. The technology exists, adoption is the challenge.

What we don't want is another layer of encapsulation just to add encryption. Packets are already bloated enough. Integrating encryption into existing encapsulation protocols or using lightweight encryption protocols that don't add excessive overhead should be the goal.

QUIC Tunneling: The Experimental Frontier

QUIC (Quick UDP Internet Connections) is a transport protocol developed by Google, now standardized by the IETF. It provides reliable, encrypted, multiplexed connections over UDP. Some adventurous souls have asked: could we tunnel other protocols over QUIC?

The theoretical advantages are compelling. QUIC provides encryption by default, better connection migration support than TCP, and improved performance in lossy networks. It handles packet loss better than TCP VPNs. The multiplexing could allow multiple tunnels over a single QUIC connection.

The practical challenges are significant. QUIC is designed as a transport protocol for application-layer data, not as a tunneling substrate. Using it for encapsulation means running an entire QUIC connection state machine for tunnel management. The overhead is substantial: QUIC's own headers, encryption, acknowledgments, and congestion control all add processing requirements and latency.

Performance testing of QUIC VPNs shows mixed results. In high-loss networks, QUIC performs better than TCP-based VPNs. In clean networks, the overhead makes it slower than simpler encapsulation methods. The encryption is nice, but if you need encryption, there are more efficient ways to get it than running QUIC.

QUIC tunneling is best viewed as experimental. It might make sense for specific use cases, mobile networks with high packet loss, or situations where connection migration is critical. For general-purpose encapsulation, stick with proven protocols. The added complexity of QUIC isn't justified by the benefits for most scenarios.

The MTU Problem

Every layer of encapsulation adds headers. IP adds 20 bytes minimum. UDP adds 8 bytes. VXLAN adds 8 bytes. MPLS adds 4 bytes per label. Before you know it, your 1500-byte packet needs 1560 bytes to traverse the network.

If your underlying network has a 1500-byte MTU, you're fragmenting or dropping packets. If you reduce the payload size to avoid fragmentation, you're wasting bandwidth on headers. Either way, encapsulation overhead creates pain.

The solution involves increasing MTU on the transport network (jumbo frames), using Path MTU Discovery properly, or accepting the fragmentation penalty. We covered this extensively in our MTU article, so we won't rehash it here. Just remember: every encapsulation layer you add makes the MTU problem worse.

NAT and Encapsulation: Anything Is Possible

With enough encapsulation and enough NAT, you can make almost anything work. Need to connect two IPv6 networks over an IPv4-only core? Tunnel IPv6 in IPv4. Want to bridge two private address spaces with overlapping ranges? Encapsulate and NAT. Need to connect networks behind nested NAT? Chain enough tunnels together.

Just because you can doesn't mean you should.

NAT breaks end-to-end connectivity. Nested NAT breaks it worse. Add multiple layers of encapsulation, and you've created a troubleshooting nightmare where traceroute lies, MTU discovery fails, and nobody can figure out why packets are being dropped somewhere in the middle of your nested tunnel stack.

Sometimes these elaborate constructions are necessary. Legacy networks, organizational boundaries, or security requirements force compromises. But they should be temporary solutions with a plan to simplify. Complexity is technical debt, and encapsulation complexity is particularly expensive to service.

The Bottom Line: Choose the Right Tool

Encapsulation protocols are tools, each designed for specific problems. MPLS excels at traffic engineering and QoS in provider networks. MPLSoUDP adds load balancing to MPLS. VXLAN provides data center network virtualization. Geneve offers flexibility for evolving requirements. GRE handles simple tunneling needs.

Use the simplest encapsulation that meets your requirements. Don't add layers just because you can. Don't use MPLS for a simple site-to-site VPN. Don't deploy Geneve if VXLAN does everything you need. Don't tunnel over QUIC because it sounds cool.

Do use MPLS if you need deterministic QoS and traffic engineering. Do use VXLAN or Geneve for multi-tenant data centers. Do use GRE for straightforward tunneling. Do consider MPLSoUDP if load balancing across ECMP matters. Do add encryption where security requires it, but choose efficient encryption mechanisms.

And remember: the network underneath your encapsulation still exists. It still has bandwidth limits, latency characteristics, and failure modes. Encapsulation doesn't solve those problems, it just hides them. Build resilient networks with solid fundamentals, then use encapsulation to add the features you need on top of that foundation.

The best encapsulation is often the one you don't notice, the one that just works, transparently providing the required functionality without adding operational complexity or performance overhead. Strive for that simplicity even as you leverage sophisticated encapsulation technologies.

Because yes, you can wrap packets in seventeen layers of encapsulation and route them through nested NAT across six different address families. But your future self, troubleshooting a production outage at 3 AM, will not thank you for that architectural decision.