Encapsulation & Decapsulation
This is the single most important idea in networking. Every protocol on the way down the stack wraps the data in its own header; every protocol on the way up strips one off. If you understand this one mechanism, headers, frames, packets and segments all fall into place.
The core idea
Encapsulation is the process of adding control information (a header, and sometimes a trailer) to data as it travels down the protocol stack. De-encapsulation is the reverse: removing that control information as data travels up the stack at the receiver.
Why encapsulation exists
Layering would be pointless without encapsulation. Each layer is responsible for one job, and it needs to give instructions to the matching layer on the far side. Instead of putting all the information in one giant block, each layer adds only the fields it owns.
- The Transport layer adds port numbers so the right application gets the data.
- The Network layer adds IP addresses so the data reaches the right host across networks.
- The Data Link layer adds MAC addresses so the data reaches the right device on the local link.
- The Physical layer turns everything into signals (bits) for the medium.
Because each header is added by a different layer, the receiving device can peel them off one at a time and hand each to the correct layer. This is what allows a PC running Windows to talk to a Linux web server over a Cisco switch — every vendor implements the same headers in the same order.
PDUs at each layer
The unit of data has a different name at each layer. That name is the Protocol Data Unit (PDU). Exams expect the exact words.
| Layer (OSI) | PDU name | Header added |
|---|---|---|
| Application / upper | Data | Application protocol data |
| Transport (4) | Segment (TCP) / Datagram (UDP) | TCP or UDP header |
| Network (3) | Packet | IPv4 / IPv6 header |
| Data Link (2) | Frame | Ethernet header + FCS trailer |
| Physical (1) | Bits | None (encoded as signals) |
Headers and trailers
A header is metadata placed in front of the data. It never replaces the data; it is added alongside it. A trailer is metadata placed after the data and is used only at the Data Link layer, where it holds the Frame Check Sequence (FCS) — a checksum that lets the receiver detect corruption.
The payload of one layer is simply the entire PDU of the layer above. That nesting is the whole point:
A worked example, hop by hop
You type https://example.com in a browser. Here is what actually happens on the way down, and what each device in the path does with it.
- Application layer builds an HTTP request (data).
- Transport layer (TCP) adds a header with the destination port
443(HTTPS) and a source port. Now it is a segment. - Network layer (IP) adds a header with your source IP and the server’s destination IP. Now it is a packet.
- Data Link layer (Ethernet) adds a header with the MAC addresses of your PC and your router, plus an FCS trailer. Now it is a frame.
- Physical layer converts the frame to electrical, optical or radio signals and puts it on the medium — the bits.
The critical subtlety: headers are added and removed per hop, not just once. A switch forwards within one network and only needs Layer 2. A router forwards between networks and must go up to Layer 3.
Mapping to OSI and TCP/IP, and the common pitfalls
The TCP/IP model collapses OSI’s top three layers into “Application” and its bottom two into “Network Access”. We use the OSI names because exams and engineers do, but the TCP/IP model is what was actually implemented.
| OSI layer | TCP/IP model | PDU | Address type |
|---|---|---|---|
| 7–5 Application, Presentation, Session | Application | Data | Names / URLs |
| 4 Transport | Transport | Segment / Datagram | Port numbers |
| 3 Network | Internet | Packet | IP addresses |
| 2 Data Link | Network Access | Frame | MAC addresses |
| 1 Physical | Network Access | Bits | — |
- Calling everything a “packet”. Use the exact PDU: segment/datagram, packet, frame.
- Thinking headers replace data. Headers are added; the payload stays intact.
- Believing MAC addresses travel end to end. They change at every Layer 3 hop.
- Forgetting the FCS trailer. The Data Link layer adds both a header and a trailer.
- Assuming encapsulation happens once. It happens on every device, every time data moves up or down the stack.
Review
Check what you have learned with these review questions.
| Term | Meaning |
|---|---|
| Encapsulation | Adding control information (headers, and at L2 a trailer) as data moves down the stack. |
| De-encapsulation | Removing that control information as data moves up the stack. |
| PDU | Protocol Data Unit; the name of the data unit at a given layer (data, segment/datagram, packet, frame, bits). |
| Header | Control fields placed before the data. |
| Trailer | Control fields placed after the data; at Layer 2 this is the FCS. |
| FCS | Frame Check Sequence; a checksum used to detect transmission errors. |
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers, Section 1.3.3 (“Terminology”). rfc-editor.org/rfc/rfc1122.
- Socolofsky, T. & Kale, C. RFC 1180: A TCP/IP Tutorial, Section 2.2 (PDU naming). rfc-editor.org/rfc/rfc1180.
- IEEE. IEEE 802.3 (Ethernet frame format, including the FCS). standards.ieee.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Sources & references
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers, Section 1.3.3 (“Terminology”), which defines TCP segment, IP packet, and related PDUs. rfc-editor.org/rfc/rfc1122.
- Socolofsky, T. & Kale, C. RFC 1180: A TCP/IP Tutorial, Section 2.2 (PDU naming). rfc-editor.org/rfc/rfc1180.
- IEEE. IEEE 802.3 (Ethernet frame format, including the FCS). standards.ieee.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals. cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.