cover image

Encapsulation (networking)

Communication protocol design method / From Wikipedia, the free encyclopedia

In computer networking, encapsulation is a method of designing modular communication protocols in which logically separate functions in the network are abstracted from their underlying structures by inclusion or information hiding within higher-level objects. In other words, encapsulation "takes information from a higher layer and adds a header to it, treating the higher layer information as data".[2]

Encapsulation of user data in the Unix-style UDP stack, in which each new layer includes the data from the previous layer, but without being able to identify which part of the data is the header or trailer from the previous layer. This effectively hides (encapsulates) the information from lower layers.[1]

The physical layer is responsible for physical transmission of the data, link encapsulation allows local area networking, IP provides global addressing of individual computers, and TCP selects the process or application (i.e., the TCP or UDP port) that specifies the service such as a Web or TFTP server.[3]

During encapsulation, each layer builds a protocol data unit (PDU) by adding a header and optionally a trailer, both of which contain control information to the PDU from the layer above.

For example, in the IP suite, the contents of a web page are encapsulated with an HTTP 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 a stream of bits, where it is decapsulated (or de-encapsulated) into the respective PDUs and interpreted at each layer by the receiving node.[4]

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.[4]

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.[3]

Encapsulation is a characteristic feature of most networking models, including both the OSI model and TCP/IP suite of protocols.

Nevertheless, encapsulation is also used[5] for malicious purposes, such as tunneling.