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>