Data Encapsulation & De-encapsulation in the OSI Model

Data Encapsulation

In the previous article, we have learned various layers of the OSI reference model. We have discussed the function of each layer and relationship with other layers as well as with remote end. For example, the session layer at the source will interact with the session layer of the destination. For this interaction, each layer adds a header in front of the data from the earlier layer. This header contains control information related to the protocol uses at that layer. This process is the encapsulation Process. The steps of the encapsulation process are:

  1. Upper layers (Application layer, Presentation layer and Session layer) convert the message to data and send it to the Transport layer which is the heart of the OSI Model.
  2. The Transport layer converts the data to segments and sends it to the Network layer.
  3. The Network layer converts the segments to packets and sends these packets to the Data Link layer.
  4. The Data Link layer converts the packets to frames and then sends frames to the Physical layer.
  5. The Physical layer converts the frames to binary 1’s and 0’s in the shape of electrical or light signals and sends them across the network.

The figure below illustrates the data encapsulation process at each layer; where header information is added.

Data Encapsulation & De-encapsulation in the OSI Model 3

Data De-Encapsulation Process

At the receiving end, the process is reversed, with headers being stripped off at each layer. This reverse process is known as de-encapsulation. As shown in the figure below when Layer 1 takes the data and sends it to Layer 2. Here the Layer 2 header, as well as the trailer, examined and removed.

The resulting Layer 3 PDU, then sent to Layer 3. Layer 3, in turn, examines the header in the PDU and removes it. The resulting PDU sent to Layer 4. Similarly, each layer removes the header added by the corresponding layer at the source before sending the data to the upper layer. Finally, the Application layer removes the Layer 7 header and sends the data to the application.

Data Encapsulation & De-encapsulation in the OSI Model 4