
identify which part of the data is the header or trailer from the previous layer. This effectivelyhides (encapsulates) the information from lower layers.[1]Encapsulation is thecomputer-networking process of concatenating layer-specificheaders ortrailers with aservice data unit (i.e. apayload) for transmittinginformation over computer networks.[2][3][4]Deencapsulation (orde-encapsulation) is the reverse computer-networking process for receiving information; it removes from theprotocol data unit (PDU) a previously concatenated header or trailer that an underlying communications layer transmitted.[3][5][4]
Encapsulation and deencapsulation allow the design of modularcommunication protocols so to logically separate the function of each communications layer, andabstract the structure of the communicated information over the other communications layers.[2][4] These two processes are common features of the computer-networking models and protocol suites, like in theOSI model andinternet protocol suite.[3] However, encapsulation/deencapsulation processes can also serve as malicious features like in thetunneling protocols.[6]
Thephysical layer is responsible for physical transmission of the data, link encapsulation allowslocal area networking,IP provides global addressing of individual computers, andTCP selects the process or application (i.e., theTCP or UDP port) that specifies the service such as aWeb orTFTP server.[7]
For example, in theIP suite, the contents of a web page are encapsulated with anHTTP header, then by a TCP header, an IP header, and, finally, by a frame header and trailer. The frame is forwarded to the destination node as astream ofbits, where it is decapsulated into the respective PDUs and interpreted at each layer by the receiving node.[8]
The result of encapsulation is that each lower-layer provides a service to the layer or layers above it, while at the same time each layer communicates with its corresponding layer on the receiving node. These are known as adjacent-layer interaction and same-layer interaction, respectively.[8]
In discussions of encapsulation, the more abstract layer is often called the upper-layer protocol while the more specific layer is called the lower-layer protocol. Sometimes, however, the terms upper-layer protocols and lower-layer protocols are used to describe the layers above and below IP.[7]