Data Encapsulation Decapsulation

What is data encapsulation ?
What is decapsulation ?
Protocol data unit and OSI Reference Model.
 This tutorial cover the data encapsulation and decapsulation process in networking. Concept of encapsulate meaning , payload , osi model layer explanation , osi layer functions and encapsulation example  are discussed in detailed in this tutorial.

(A) Basics of data encapsulation process

In a computer network data encapsulation is required when we send the data from source computer to destination computer. In a computer network sending and receiving of data from one device to another is possible with the help of networking protocols when data is encapsulated at sender’s side. 

In order to understand the encapsulate meaning in computer network let us see when data is encapsulated along with protocols information at each layer of OSI reference model when it is transmitted from sender to a receiver across the network. In general data encapsulation is a process of each layer at sending machine adding its Header information. This header information just works as metadata.
As a part of osi layer functions each layer communicates with its neighbor at the destination. Each layer use Protocol Data unit to communicate and exchange information. The primary objective of data encapsulation is to provide communication between peers layers of sending and receiving the machine.


data decapsulation in networking

 

(B) Protocol Data Unit

 Protocol data unit contains control information attached to data at each layer. The information is attached to data field’s header but at the end of data field or trailer. Pdus are encapsulated by attaching them to the data at each layer of OSI reference model.
Each pdu has a name depending on the information each header has. Only the neighbor layer at the destination can read the information which I then stripped off and data is handed to next layer.

(C) OSI Reference Model and PDU

In OSI model osi model layer explanation at each layer data unit is known by a specific name. Each data flow layer has protocol data unit.
It is defined as follows:
Transport Layer : Segment is PDU
Network Layer: Packet is PDU
Data Link Layer: Frame is PDU.
Physical Layer: Bit is the PDU.
data encapsulation decapsulation in networking
Figure: Header Added in Data Encapsulation Process     

(D) Encapsulation Process:

 Process of data encapsulation as shown in above figure is as follow:
During the data encapsulation process when the data is transmitted from sending machine to the destination then adding header control information at each layer as follows:

TCP Header Encapsulation

The application layer data is converted for transmission. Data stream is then handed down to transport layer which set up a virtual circuit to the destination.  Data stream is then broken up and  Transport layer header called Segment is created.
The header control information is attached to the data field’s of transport layer header. Each segment has a sequence number and sequenced properly so that data stream can put back together on destination and the exact message can be obtained or transmitted.

IP Header Encapsulation

At sender side after transport layer each segment is then handed to network layer for the logical addressing and routing through a routing protocol for example IP, IPX etc.
The network layer protocol add a header to the the packet handed down to the data link layer.

MAC Header Encapsulation

The data link layer receive the packet from the network layer and place them on the network medium such as cable or wireless medium.  After that data link layer encapsulate each packet into frame and add a MAC header to the packet which carry the the mac address of source and destination. If the sending and receiving devices are on the different network then frame is sent to a router to be routed through a internetwork.

Physical Layer Encapsulation

Once the frame get to the destination network a new frame is used to get the packet at the destination hist.  To put this frame on the network it must be first put on the digital signal. Since a frame is a logical group of 1’s and 0’s , the OSI model’s physical layer is responsible for encapsulating this digits into a digital signal.

(E) Data Decapsulation

Decapsulation is just reverse process of Data Encapsulation where in each layer at the receiving machine, its interprets the header information sent by its peer layer and it  takes the required action based on the information and after that removes the header, before passing on the data to the next higher layer at the receiver side. You can think this process just as analogous to removing the letter from the envelope by the receiver.
In the whole process of data Encapsulation and Decapsulation in the destination it means on the receiver side data decapsulation is performed. Receiving node or computer synchronize on the digital signal and extract the 1’s and 0’s from the signals.

At this point receiving node build the frame and run a cycle redundancy check ( CRC Check) and check their output against the output in data frame’s  Frame Check Sequence Field. If the information is the match then the packet is pulled from the frame and the frame is discarded. This process is known as Decapsulation.
The packet then transferred to the network layer where the IP Address is checked. If the IP address is matched then Segment is pulled from the packet and packet is discarded. After that data is processed at the transport layer that rebuilds the data stream and acknowledges to transmitting station that it received each segment. After that transport layer transfer the data to the upper layer application layer

(F) Conclusion

At the transmitting devices, data encapsulation method works as follows
User information is converted into the data transmission on the network. Data is converted into segments and a reliable and unreliable connection is set up between the source and destination devices with connection-oriented and connection less protocol.
Segment are converted into packets with a logical address such as IP datagram using an IP Address.
Packets are converted into a frame for transmission on the local network.
Media access protocol ( MAC Address) or Ethernet Address are commonly used to identify the host on a local network segment.
Frame are converted int Bytes and bits and a digital encoding or clocking or signaling method is used.
Also, encapsulation information would normally be pretended to the payload. The only exception to this rule may happen in the data link and physical layers, where apart from a header, a trailer also may be added after the payload. At the receiving end, the corresponding data link layer removes both the header and the trailer, after interpreting the values inside them.
I hope this gate study material for computer science will be beneficial for the reader to enhance their knowledge. You may ask your query or feedback in the comment.
 
 
 

Leave a Reply

Your email address will not be published. Required fields are marked *

x