Encapsulation is the computer-networking process of concatenating layer-specific headers or trailers with a service data unit (i.e. a payload) for transmitting information over computer networks. Deencapsulation (or de-encapsulation) is the reverse computer-networking process for receiving information; it removes from the protocol data unit (PDU) a previously concatenated header or trailer that an underlying communications layer transmitted.
Encapsulation and deencapsulation allow the design of modular communication protocols so to logically separate the function of each communications layer, and abstract the structure of the communicated information over the other communications layers. These two processes are common features of the computer-networking models and protocol suites, like in the OSI model and internet protocol suite. However, encapsulation/deencapsulation processes can also serve as malicious features like in the tunneling protocols.