Encapsulation is the process where each protocol layer “wraps” the data it receives with its own header (and sometimes a trailer) before handing it to the layer below. This modular approach lets each layer focus solely on its responsibility—port addressing, routing, framing, error checks, etc. without worrying about the rest of the stack.
| Layer | PDU Name | What’s Added |
|---|---|---|
| Application | Data | Application‑specific formatting (e.g., HTTP headers) |
| Transport | Segment (TCP)Datagram (UDP) | Source/destination ports,sequence numbers, flags |
| Network | Packet | Source/destination IP addresses,TTL, protocol field |
| Data Link | Frame | Source/destination MACs,frame check sequence (FCS) trailer |

Note: Frames often include both a header (addresses, type) and a trailer (error‑check sequence).

On the receiving side, each layer strips off its header/trailer and passes the remaining PDU up to the layer above: