What Process Involves Placing One PDU Inside Of Another PDU? You’ll Never Guess The Answer

9 min read

What if I told you the secret sauce behind every VPN tunnel, every Docker container, and even the way your phone talks to a Wi‑Fi router is a simple idea: put one packet inside another packet. Sounds like Russian nesting dolls, right? Think about it: that’s exactly what network engineers call encapsulation. It’s the process that lets a Protocol Data Unit (PDU) hide inside a bigger PDU so different layers can do their jobs without stepping on each other’s toes.


What Is Encapsulation

In plain English, encapsulation is the act of taking a piece of data—say, a TCP segment—and wrapping it in another piece of data—a IP packet—so it can travel across a network. Each layer of the OSI or TCP/IP model adds its own header (and sometimes a trailer) around the payload it received from the layer above. The result is a stack of PDUs, each one a little envelope inside a bigger envelope Still holds up..

The OSI View

  • Layer 7 (Application) creates the application data PDU.
  • Layer 6 (Presentation) might add encryption or compression.
  • Layer 5 (Session) can insert session‑control info.
  • Layer 4 (Transport) builds a segment (TCP) or datagram (UDP) and sticks a transport header on the front.
  • Layer 3 (Network) wraps that segment in an IP packet with its own header (source/destination IP, TTL, etc.).
  • Layer 2 (Data Link) adds a frame header and trailer (MAC addresses, CRC).
  • Layer 1 (Physical) finally translates the bits into electrical, optical, or radio signals.

When the packet hits the wire, the outermost PDU is the one the hardware actually sends. The inner PDUs stay hidden until each receiving device peels away a layer, a process known as decapsulation.

Real‑World Analogy

Think of a birthday present. The gift (your application data) is first wrapped in tissue paper (transport header), then placed in a box (network header), then sealed with tape (data‑link header). The courier only cares about the box; the recipient opens the box, then the tissue, and finally enjoys the gift. Each wrapper serves a purpose, and none of them interfere with the actual present.


Why It Matters / Why People Care

If you’ve ever tried to set up a VPN and wondered why the traffic looks different on each side, you’ve bumped into encapsulation. Here’s why the concept is worth knowing:

  • Interoperability: Different networks speak different “languages.” Encapsulation translates your data into the language each network expects, letting a Wi‑Fi LAN talk to a cellular 5G network without a hiccup.
  • Security: VPNs encapsulate your original IP packet inside another IP packet (often with IPsec or SSL/TLS). The outer layer hides the inner one from prying eyes, acting like a secure envelope.
  • Scalability: Data‑center fabrics use VXLAN or NVGRE to encapsulate Ethernet frames inside UDP packets, allowing millions of virtual networks to coexist on a single physical infrastructure.
  • Troubleshooting: Knowing where a problem lives—whether it’s a broken Ethernet frame or a malformed TCP segment—means you can look at the right PDU layer instead of guessing.

In practice, forgetting that encapsulation exists leads to “mystery drops” where packets disappear because a firewall is looking at the wrong header, or MTU mismatches where the outer wrapper makes the packet too big for the link It's one of those things that adds up. Simple as that..


How It Works

Let’s walk through a classic example: a web browser requesting a page from a remote server. We’ll follow the data from the moment you type a URL to the moment the server’s response lands back in your browser.

1. Application Layer – The HTTP Request

Your browser creates an HTTP GET message:

GET /index.html HTTP/1.1
Host: example.com

That string is the application PDU. No headers yet, just raw data.

2. Transport Layer – TCP Segment

TCP takes the HTTP string and adds its own header: source port, destination port (80 for HTTP), sequence number, flags, checksum, etc. The result is a TCP segment Most people skip this — try not to..

[TCP Header][HTTP GET]

Now we have a transport‑layer PDU ready to be handed down.

3. Network Layer – IP Packet

The IP layer grabs the whole TCP segment and sandwiches it inside an IP header: source IP, destination IP, TTL, protocol number (6 for TCP).

[IP Header][TCP Header][HTTP GET]

That’s the IP packet. It’s the first “outer” PDU that routers will actually see Small thing, real impact..

4. Data Link Layer – Ethernet Frame

Your NIC (network interface card) puts the IP packet into an Ethernet frame. The frame adds source and destination MAC addresses, an EtherType field (0x0800 for IPv4), and a CRC trailer for error checking.

[Ethernet Header][IP Header][TCP Header][HTTP GET][CRC]

Now the packet is ready for the physical medium.

5. Physical Layer – Bits on the Wire

Finally, the NIC translates the frame into a series of voltage changes (copper), light pulses (fiber), or radio waves (Wi‑Fi). The physical PDU is just a stream of 0s and 1s Small thing, real impact. Worth knowing..

When the packet reaches a router, the router reads the Ethernet header, strips it off (decapsulation), examines the IP header to decide where to forward, possibly changes the MAC addresses, re‑adds a new Ethernet header, and sends it on. Each hop repeats the same peel‑and‑wrap routine.


Encapsulation in VPNs

A VPN tunnel adds an extra layer of encapsulation on top of the normal stack:

  1. Original packet – IP packet from your laptop to the internet.
  2. Tunnel header – IPsec ESP header (or GRE, or OpenVPN’s TLS).
  3. Outer IP header – The IP address of the VPN gateway on each side.

So the VPN packet looks like this:

[Outer IP][Tunnel Header][Inner IP][TCP][HTTP]

The outer IP gets routed across the public Internet; the inner IP stays hidden, preserving your private addressing scheme That's the whole idea..


Container Networking – VXLAN

In modern data centers, a virtual machine’s Ethernet frame often gets encapsulated in a UDP packet, then sent across a physical fabric:

[Outer Ethernet][UDP][VXLAN Header][Inner Ethernet][Inner Payload]

VXLAN’s 24‑bit segment ID lets you run up to 16 million isolated L2 networks on a single physical backbone. That’s a direct consequence of nesting PDUs That's the part that actually makes a difference. But it adds up..


Common Mistakes / What Most People Get Wrong

  • Thinking encapsulation is optional. In reality, every packet that traverses a network stack is encapsulated at least once. Skipping a layer isn’t a “shortcut,” it’s a different protocol stack altogether.
  • Confusing “header” with “payload.” People often say “the payload is the data,” then forget the payload itself can be an entire PDU. The TCP segment is the payload for the IP layer, even though it contains its own header.
  • Assuming MTU only matters at the physical layer. The outermost PDU determines the maximum size that can travel over a link. If you add an extra encapsulation (like a VPN) without adjusting the MTU, you’ll hit “packet too big” errors and see ICMP “Fragmentation needed” messages.
  • Treating encapsulation as a one‑time thing. In real networks, packets can be encapsulated multiple times—think of a VPN inside a GRE tunnel inside an MPLS label‑switched path. Each extra wrapper adds overhead and latency.
  • Believing decapsulation is automatic. Some middleboxes (firewalls, NAT devices) need explicit configuration to strip certain headers. Forgetting to allow the outer protocol can cause traffic to be dropped silently.

Practical Tips / What Actually Works

  1. Check MTU Before Adding Tunnels
    Run ping -M do -s 1472 <dest> (adjust size) to see the largest packet that passes without fragmentation. Add a safety margin for any extra headers you plan to introduce.

  2. Use “show” Commands to Peek Inside
    On Cisco, show ip route and show interfaces reveal outer headers. On Linux, tcpdump -e -vvv prints both Ethernet and IP layers, letting you verify encapsulation is happening as expected.

  3. Label Your Encapsulation Layers
    When designing a network diagram, draw each PDU as a nested box with clear labels (e.g., “IPsec ESP → IP”). It prevents confusion later when you troubleshoot Not complicated — just consistent. Surprisingly effective..

  4. Don’t Over‑Encapsulate
    Every extra header eats bandwidth and CPU cycles. If you can achieve the same goal with a single encapsulation (e.g., use IPsec directly instead of GRE over IPsec), you’ll get better performance.

  5. Keep Firmware Updated
    Some older switches mishandle VXLAN or MPLS encapsulation, leading to dropped packets. A quick firmware bump often fixes obscure “black‑hole” issues.

  6. Test End‑to‑End With Traceroute
    Use traceroute -I (ICMP) or traceroute -T (TCP) to see the outer IP hops. If you see unexpected hops, you may be hitting a tunnel endpoint you didn’t plan for.


FAQ

Q: Is encapsulation the same as tunneling?
A: Not exactly. Encapsulation is the generic act of wrapping one PDU inside another. Tunneling is a specific use‑case where you encapsulate an entire packet to send it through a different network, like a VPN.

Q: Can encapsulation happen at the application layer?
A: Yes. Application‑level protocols like SSH or TLS add their own headers (handshake, encryption metadata) around the data before handing it to the transport layer. It’s just another layer of encapsulation.

Q: Why do I see “GRE” or “VXLAN” in packet captures?
A: Those are names of specific encapsulation protocols. GRE (Generic Routing Encapsulation) adds a simple header to carry any protocol. VXLAN adds a 24‑bit segment ID to virtualize L2 networks over UDP.

Q: Does encapsulation affect latency?
A: Slightly. Each extra header means more bits to transmit and more processing to add/remove the headers. In high‑performance environments, engineers try to keep the encapsulation depth to three or four layers max.

Q: How does NAT interact with encapsulation?
A: NAT rewrites the outer IP header (source or destination). If the inner packet contains the original IP address (as in some VPNs), the NAT device must be configured to allow the encapsulated payload to pass unchanged, or you’ll get asymmetric routing problems And it works..


Encapsulation might sound like a dry textbook term, but it’s the invisible glue that lets the internet work, lets your phone roam between Wi‑Fi and LTE, and lets cloud providers spin up thousands of isolated networks on a single rack of switches. The next time you see a packet capture with a dozen headers stacked like a Russian doll, you’ll know exactly why they’re there—and how to peel them back when something goes wrong. Happy layering!

What's New

Fresh Out

Worth Exploring Next

Along the Same Lines

Thank you for reading about What Process Involves Placing One PDU Inside Of Another PDU? You’ll Never Guess The Answer. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home