Encapsulation and demultiplexing are the two complementary processes that move data through the layers of the OSI Model.

Encapsulation (sender side)

When data is sent, each layer takes the data from the layer above, adds its own protocol-specific header (and sometimes footer), and passes the result down to the next lower layer. This is like putting a letter inside an envelope: the outer envelope contains the addressing and delivery information needed by that layer.

Real-world analogy from the text: an employee puts a memo in a yellow interoffice envelope. The mailroom places that envelope inside a postal envelope with a street address. Each layer adds its own addressing information.

Demultiplexing (receiver side)

When data arrives, the receiving process examines the current layer's protocol metadata to determine which higher-layer process should handle it, then removes that layer's header before passing the remaining payload upward. The postal carrier removes the outer envelope, the mailroom removes the inner envelope, and the recipient finally reads the letter.

This layering allows each protocol to focus on its own job while relying on lower layers to handle the details of physical delivery, addressing, and routing.