Data Encapsulation Decapsulation
Data Encapsulation Decapsulation
Data encapsulation is to map service data to the payload of an encapsulation protocol, fill in the packet header of the
corresponding protocol to form the data packet of the encapsulation protocol and implement rate adaptation. Decapsulation is
the reverse process of encapsulation. Decapsulating the protocol packet, processing the information in the packet header, and
extracting the service information from the payload is a reverse process. Data encapsulation is the process of encapsulating a
protocol data unit (PDU) into a set of protocol headers and trailers. In the OSI 7-layer reference model, each layer is primarily
responsible for communicating with its peers on other machines. This process is implemented in a "protocol data unit" (PDU).
The PDU at each layer generally consists of the protocol header, protocol tail, and data encapsulation of the layer.
Extended materials:
When a data packet is transmitted between different devices through a network, to reliably and accurately send the data packet
to the destination and efficiently use the transmission resources (transmission devices and transmission lines), the data packet
needs to be split and packaged in advance, and the destination address and local address are attached to the sent data packet. and
some bytes used for error correction. When the security and reliability are high, encryption processing is required. These
operations are called data encapsulation. When processing data packets, the protocol is the rule that the communication parties
follow and negotiate. In contrast to mailed items, packets themselves are like items, encapsulation is like filling in various
mailings, and protocols are rules on how to fill in the information.
Principle
Data encapsulation is the process of encapsulating a protocol data unit (PDU) into a set of protocol headers and trailers. In the
OSI 7-layer reference model, each layer is primarily responsible for communicating with its peers on other machines. This
process is implemented in a "protocol data unit" (PDU). The PDU at each layer generally consists of the protocol header,
protocol tail, and data encapsulation of the layer.
Each layer can add a protocol header and a trailer to its corresponding PDU. The protocol header contains information related to
the communication between layers. The protocol header, protocol tail, and data are three relative concepts, which depend on the
layers at which information unit analysis is performed. For example, a transport header (TH) contains information visible only
to the transport layer, while all other layers below the transport layer transmit the transport header as the data portion of each
layer.
At the network layer, an information unit consists of a Layer 3 protocol header (NH) and data. At the data link layer, all
information transmitted by the network layer (Layer 3 protocol headers and data) is considered data. In other words, the data
portion of an information unit in a particular OSI layer may include a protocol header, a protocol trailer, and data transmitted by
an upper layer.
For example, if computer A wants to send some data from an application to the application layer of computer B. The application
layer of computer A communicates with the application layer of any computer B by adding a protocol header to the data in
advance. The result information element, which contains a protocol header, data, and possibly a protocol tail, is sent to the
1 of 3 03/08/2022, 8:51 am
Firefox https://forum.huawei.com/enterprise/en/data-encapsulation-and-decapsu...
presentation layer, which in turn adds a protocol header of the control information understood by the presentation layer of
computer B. The size of the information unit increases with the addition of protocol headers and trailers at each layer, which
contains the control information to be used by the corresponding layer of computer B. At the physical layer, the entire unit of
information is transmitted over a network medium. the physical layer in computer B receives the information element and
transmits it to the data link layer; The data link layer in B then reads the control information pre-added in the protocol header at
the data link layer of computer A; Next, the protocol header and protocol tail are removed, and the rest is transmitted to the
network layer. Each layer performs the same action: reads the protocol header and protocol tail from the corresponding layer,
removes the protocol header and protocol tail, and sends the remaining information to the higher layer. After the application
layer is executed, the data is sent to the application receiver on computer B, and the data is sent from the application on
computer A. Network layering and data encapsulation may seem complex, but they are important architectures that make
network communications modular and easy to manage. Decapsulation is the reverse operation of encapsulation, which restores
the encapsulated packet to data.
There are multiple encapsulation protocols on an SDH network, including PPP/HDLC, LAPS, and GFP. Proprietary
encapsulation protocol of some device vendors.
1. PPP/HDLC protocol
This is a point-to-point protocol. It uses the HDLC protocol to encapsulate frames and maps HDLC frames into SDH VCs in
byte synchronization mode. The HDLC frames become payloads of the VCs.
In the POS system, it can be used to carry IP data. In an SDH system, it is used to carry Ethernet frames.
2. LAPS protocol
Link access protocol. This mode is especially applicable to SDH links to carry Ethernet frames. It is similar to HDLC.
G3 and FP protocols is a universal frame protocols and are link-layer standards. This encapsulation protocol can carry all data
services. It is a technology that transparently encapsulates various data signals into an existing network. It can replace various
encapsulation methods and facilitates interconnection between devices of different vendors.
The GFP encapsulates different service data by using different service data encapsulation methods. There are two modes: frame
mapping (GFP-F) and transparent transmission (GFP-T).
2. The data is converted into segments and a reliable connection is established between the sender and receiver hosts.
3. Segments are converted into packets or datagrams and logical addresses are placed in the header so that each packet can be
transmitted across the Internet.
4. Packets or datagrams are converted into frames for transmission on the local network. On the local network segment, a
hardware address is used to uniquely identify each host.
5. Frames are converted to bitstreams and digital coding and clocking schemes are used.
The OSI model is still used as an example to describe the data decapsulation process. The receiving end of data starts from the
physical layer and performs an operation opposite to that of the transmitting end, which is called decapsulation, as shown in the
following figure. Finally, the application layer program obtains data information and completes one-way communication
between two points.
It should be noted that the most widely used TCP/IP protocol can be regarded as a simplification of the OSI protocol layer. It is
divided into four layers: data link layer, network layer, transport layer, and application layer. Data encapsulation corresponding
to each layer is similar to that of OSI.
2 of 3 03/08/2022, 8:51 am
Firefox https://forum.huawei.com/enterprise/en/data-encapsulation-and-decapsu...
Note:
1. The MAC address is valid only locally. During transmission through the router, the MAC address changes.
2. The router identifies the network segment of the destination IP address based on the routing table and determines whether the
router can forward or discard the data packet.
3 of 3 03/08/2022, 8:51 am