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


Return to: Chapter 2