Data Encapsulation Process


Basics of data encapsulation process

In a computer network, 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.  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.


Here in this Computer Science Study Material for Gate we have explained data encapsulation and de-encapsulation process in more detail.

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.

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.

OSI Reference Model and PDU


The seven layer of OSI model are basically defined to red the ce complexity  of the networking. 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 process

Figure: Header Added in Data Encapsulation Process

              

Encapsulation Process:

 Process of data encapuslation 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 stram 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 Encapsuation


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.

Data De-Encapsulation


De- Encapsulation 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 De Encapsulation in the destination it means on the receiver side data de-encapsulation 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 De- Encapsulation.

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

Summary :


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 connectionless 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. 

Keywords: data encapsulation definition, data encapsulation introduction, protocol data unit definition, protocol data unit introduction, header definition, dta de encapsulation process