Encapsulation and Protocol Data Units
Learn how data is wrapped at each OSI layer, what Protocol Data Units are called at each layer, and why encapsulation is essential for communication.
In this lesson, you will learn to:
- By the end of this lesson, learners will be able to define encapsulation and decapsulation, name the Protocol Data Unit at each OSI layer, and explain how peer layers communicate logically across devices.
Encapsulation and Protocol Data Units
This lesson explains the mechanics of encapsulation and decapsulation. Learners will discover how each layer adds a header, what the resulting data unit is called at each layer, and how peers at the same layer on different devices logically communicate.
What Is Encapsulation?
Encapsulation is the process of wrapping data with the control information needed to move it through the network. As data travels down the OSI stack on the sending device, each layer adds its own header, and in some cases a trailer. The original data, sometimes called the payload, is still there. It has simply been wrapped in additional layers of information.
Think of a set of nested boxes. You put a gift in a small box. You place that small box in a larger box with padding. You place the larger box in a shipping crate with a label. The gift never changes. The packaging around it changes at each step.
Why add headers?
Each layer needs different information to do its job:
- The Transport layer may add a header with port numbers so the receiving device knows which application should get the data.
- The Network layer adds source and destination logical addresses so routers can forward the packet.
- The Data Link layer adds physical addresses and error-checking information so the frame can cross the local link.
- The Physical layer does not add a header; it converts bits into signals.
When the data reaches the receiving device, each layer reads only the header it needs and then removes it. That reverse process is decapsulation. By the time the data reaches the Application layer, all of the network packaging has been removed and only the original payload remains.
Headers and trailers
Most layers add a header in front of the payload. The Data Link layer also commonly adds a trailer after the payload. The trailer often contains a frame check sequence used to detect corruption. This is like a shipping label and a seal on a box. The label helps it arrive; the seal helps verify it was not damaged.
Protocol Data Units at Each Layer
As data moves through the layers, its unit of measurement changes. The data plus the control information at a given layer is called a Protocol Data Unit, or PDU. Network professionals use a different name for the PDU at different layers. These names help everyone understand exactly which layer is being discussed.
PDU names by layer
The following table shows the common PDU name at each layer, starting from the top:
| OSI Layer | Common PDU Name |
|---|---|
| Application | Data |
| Presentation | Data |
| Session | Data |
| Transport | Segment (TCP) or Datagram (UDP) |
| Network | Packet |
| Data Link | Frame |
| Physical | Bits |
The upper three layers usually deal with the original user data. The Transport layer often creates segments or datagrams. The Network layer creates packets. The Data Link layer creates frames. The Physical layer places individual bits on the medium.
Why PDU names matter
PDU names are not just trivia. They make troubleshooting conversations precise. If an engineer says “the frames are being dropped,” you know the issue is at the Data Link layer, probably on a local link. If they say “packets are being routed incorrectly,” the issue is at the Network layer. If they say “segments are being retransmitted,” the issue is at the Transport layer.
Using the correct PDU name is one of the fastest ways to sound like an experienced network professional. It signals that you understand where in the stack an event is happening, not just that something went wrong.
Peer-to-Peer Communication
When people talk about communication between two devices, it is useful to think of each layer as talking to the same layer on the other device. This is called peer-to-peer or logical communication.
For example, the Transport layer on the sending device adds a segment header with port information. The Transport layer on the receiving device reads that header. From a logical point of view, the two Transport layers are communicating with each other. In reality, the segment travels all the way down the sender’s stack, across the physical medium, and back up the receiver’s stack. But the Transport layer on the receiver does not need to understand the frame or the electrical signals that carried the segment. It only needs to understand its own header.
A useful mental model
Imagine two company presidents exchanging letters. The presidents do not speak directly. One president writes a letter and gives it to an assistant. The assistant puts it in an envelope. The mailroom sends it. At the other company, the mailroom receives it, the assistant opens the envelope, and the president reads the letter. The two presidents are the real peers in the conversation. The assistants and mailrooms provide lower-layer services.
In the same way, the Application layers on two devices are peers. So are the Transport layers, the Network layers, and so on. Each peer pair uses its own header to coordinate its work.
Why this matters for troubleshooting
Understanding peer communication helps you isolate problems. If a web page will not load, you can ask focused questions:
- Can the physical link carry a signal? (Physical)
- Are frames reaching the next device? (Data Link)
- Are packets being routed correctly? (Network)
- Are segments arriving in order? (Transport)
- Is the application responding? (Application)
Each question corresponds to a peer relationship at a specific layer. When you know the layer, you know what kind of tool to use next. This is the practical payoff of learning the OSI model.