Open In App

How Data Encapsulation and De-encapsulation Works?

Last Updated : 01 May, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Data encapsulation and de-encapsulation are fundamental concepts in computer networking and communication protocols. These processes are essential for transferring data across networks efficiently and securely.

What is Data Encapsulation?

Encapsulation is the process of adding additional information when data is traveling in an OSI or TCP/IP model. The information has been added on the sender’s side, from the Application layer to the Physical layer.

OSI Model and Working of Encapsulation

  • No additional information will be added to the user’s data in the Application layer in the TCP/IP model or the Application, Presentation, or Session layers in the OSI model.
  • The Session layer sends data to the Transport layer.
  • In the Transport layer, the data is broken up into different pieces. It adds the header in each of the broken data, which contains information like source port, destination port, sequence number, etc. Now, everything is combined into a new form.
  • The encapsulated data in the Transport layer is called Segments or Datagrams. If the transmission uses TCP, then it is called Segments, or UDP is called Datagrams.

Encapsulation

  • Now, the data will travel down and reach the Network layer. Here, layer 3 header is added. That contains information like source IP, destination IP, and so on. This information combines into a new form. The encapsulated data in the network layer is called Packets.

Encapsulation

  • Now, the network layer sends the packet to the Data Link layer When it enters into the data link layer, a new header(Layer 2) is added.
  • Also, a trailer is added. It contains information like source MAC address, destination MAC address, and so on. The trailer is used for error checking. The encapsulated data in the data link layer is called Frames.

Encapsulation

  • The physical layer takes frames from Data Link layer. The encapsulated data in the physical layer is called Bits.
  • That is how encapsulation takes place.

Protocol Data Unit (PDU)

The encapsulated data is called by different names when it travels down following layers. Those names are called Protocol Data Unit. The following table shows the name of encapsulated data in each layer.

Protocol Data Unit

Protocol Data Unit (PDU)

The TCP/IP model and Encapsulation

The Internet Protocol suite, also known as TCP/IP, contains the most extensively used network protocols and was created by the United States Department of Defence. The TCP/IP model was designed to work on a wide range of computer types. While the TCP/IP and OSI models share design concepts, but they are differ. The key distinction is that the TCP/IP model combines Layers 5–7 of the OSI model into a single application layer. It is also widely used to integrate the physical and data link layers, which are also known as the network interface or network access layer. The encapsulation and decapsulation operations of TCP/IP follow the same layer progression as in the OSI model.

What is De-Encapsulation?

De-encapsulation is the exact reverse process of encapsulation. The additional information added on the sender’s side(during encapsulation) gets removed when it travels on the receiver’s side from the Physical layer to the Application layer.

OSI Model and Working of De-encapsulation

  • The Physical layer gets the bits and de-encapsulates them into frames and sends them to the upper layer.
  • The Data Link layer receives the frames and checks MAC address whether it is matching or not. If everything matched and also no error is found. Then layer 2 header and layer 2 trailer are removed. It de-encapsulates the data and packet sent to upper layer.
  • The Network layer receives the packet from Data Link layer. It checks for IP addresses. If it matched then, the header in layer 3 is removed. Now the de-encapsulated data packet is delivered to the Transport layer.
  • Now, the Transport layer gets the data segments/ datagrams from the Network layer and removes the layer 4 header.
  • After traveling through Session, Presentation, and Application layer, the de-encapsulated data is sent to the receiver.
  • That is how the de-encapsulation takes place.
Working of De-Encapsulation

Encapsulation & De-encapsulation

Frequently Asked Question on Encapsulation and De-Encapsulation – FAQs

In which layer does Encapsulation occur?

Data Encapsulation starts from Transport Layer.

What is the difference between Abstraction and Encapsulation?

Abstraction is a design-level procedure that reduces complexity during the design stage of a project. Encapsulation is an implementation-level procedure that is used to give privacy while maintaining control over data transparency.

What happens if a header is lost during De-Encapsulation?

If a header is lost or corrupted during de-encapsulation, the receiving device may not be able to properly interpret the data or may discard it as invalid.

Is Encapsulation reversible?

Yes, encapsulation and de-encapsulation are reversible processes. Encapsulation adds headers to data for transmission, while de-encapsulation removes these headers to extract the original data.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads