Encapsulation Explained - buaamer81/IT130-Networking-Wiki GitHub Wiki
Encapsulation Explained
π What is Encapsulation?
Encapsulation is the process of wrapping data with protocol-specific headers (and sometimes trailers) as it moves down the OSI or TCP/IP layers before being sent across the network.
Each layer adds its own control information to the data β forming whatβs called a Protocol Data Unit (PDU).
Think of it as:
βPacking a message in multiple labeled envelopes β one inside the other β each with special instructions.β
π¦ The Encapsulation Flow (OSI to Physical)
OSI Layer | PDU | Whatβs Added |
---|---|---|
7β5 (App/Pres/Session) | Data | Original content (email, webpage, etc.) |
4 β Transport | Segment | TCP/UDP headers (source/dest ports, reliability) |
3 β Network | Packet | IP header (source/dest IPs) |
2 β Data Link | Frame | MAC addresses, FCS |
1 β Physical | Bits | Transmission as 1s and 0s (electrical/light/radio) |
π Decapsulation (Receiving Side)
At the receiving end, decapsulation occurs β each layer reads and removes the corresponding header (or trailer), eventually delivering raw data to the application.
π Encapsulation Visual Flow
[Application Data] β [Transport Header + Data] β Segment β [IP Header + Segment] β Packet β [MAC Header + Packet + FCS] β Frame β [Electrical/Radio/Optical Signal] β Bits on the wire
lua Copy Edit
Each layer encapsulates the data it receives from the layer above.
π Why Encapsulation Matters
- Enables layer independence (each layer doesnβt need to understand all others)
- Helps protocol modularity and extensibility
- Simplifies troubleshooting (Wireshark shows headers from each layer)
- Enables secure transmission with encryption layers
π§ Tools to See Encapsulation in Action
- Wireshark β Captures and visualizes packet headers at each layer
ping
,tracert
,nslookup
β Show Layer 3-4 data exchange- Router/switch logs β Show encapsulated frame forwarding
π Related Pages
- OSI Model Overview
- TCP/IP Model Overview
- PDU at Each Layer
- Ethernet Frame Structure
- IP Packet Structure
- MAC Address
- Segment vs Packet vs Frame
Return to: Chapter 2