Skip to content
We areTOP 1%

What is encapsulation, and what is the data unit called at each layer?

MediumConceptOSI & TCP/IP Models
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

Encapsulation means that each layer wraps the data it receives from the layer above with its own header (and sometimes a trailer) before passing it down. The receiver does the reverse, called decapsulation: each layer reads and removes its own header and hands the rest up. The unit of data at each layer is called a PDU (protocol data unit).

LayerPDU nameHeader adds
Applicationdata (message)for example an HTTP request line
Transportsegment (TCP) or datagram (UDP)source and destination ports
Networkpacketsource and destination IP addresses, TTL
Data LinkframeMAC addresses, plus a CRC trailer for error detection
Physicalbitsnone
  • Each layer reads only its own header, which keeps the layers independent.
  • A router decapsulates up to the network layer, chooses the next hop, then builds a new frame, so MAC addresses change at every hop while IP addresses stay the same.

Example: A browser sends GET /index.html over plain HTTP:

[HTTP GET /index.html]                                      data
[TCP 51000 -> 80][HTTP ...]                                 segment
[IP 192.168.1.5 -> 203.0.113.10][TCP ...][HTTP ...]         packet
[Eth laptop MAC -> router MAC][IP ...][TCP ...][HTTP ...][CRC]   frame

More in OSI & TCP/IP Models

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account