Encapsulation


Encapsulation is how layering manifests in data representation.

Layer N data is payload to layer N-1

The way this works is each protocol layer has some headers, followed by its payload, followed by some footers.

Hardware: first bit on right

Hardware: first bit on right

Software: first bit on left

Software: first bit on left

Flexibility


Encapsulation allows you to layer recursively

<aside> 📖 Example

Virtual Private Network (VPN):

▶ HTTP (web) application payload in

▶ a TCP transport segment in

▶ an IP network packet in

▶ a secured TLS presentation message in

▶ a TCP transport segment in

▶ an IP network packet in

▶ an Ethernet link frame.

</aside>