Latest Updates

Data encapsulation and decapsulation - Tutorial 3

Data encapsulation can be defined as the data flow process from OSI top layer to bottom layer. When data is flowing across the network from one computer to another, some values are adding to data by the OSI layers. Data decapsulation is the opposite of what we defined about encapsulation. In data decapsulation, we will discuss how the user views the data which flows from the bottom layer to the upper layer in the OSI model. Let's see how the data encapsulation happens in OSI layers.


7. Application Layer
Clicking and typing (in relation to data being sent) through the user's desktop is what this layer applies to in Data Encapsulation. That means all user interactions.

6. Presentation Layer
In this layer, data is compressed, encrypted and each data flows to the correct format (text, jpg, mpg)

5. Session Layer
Depending on what happened in the top two layers, you can send that data over the network. 

4. Transport Layer
This is where the Encapsulation game starts. Add a segment header to the data which has come from the session layer and convert the data into a segment. The source and destination ports numbers have consisted in the segment. (Hope you remember in the 2nd tutorial we discussed ports). In host to host communication, port numbers can identify which data is being sent through which protocol. We have mentioned several popular protocols and port numbers below. Keep them in mind. It will help a lot in your certification exams.
  • TCP (HTTP-80, FTP-20/21, TELNET-23, HTTPS-443)
  • UDP (DHCP-67/68, SNMP-161, TFTP-69)
3. Network Layer
This layer adds the source IP address (sender computer IP address) and destination IP address (data receiver IP addresses) to the segment sent from the transport layer and creates a packet. This packet is called a Datagram.

2. Data Link Layer
Layer header (source and destination MAC addresses) and layer trailer (FCS-Frame Check Sequence) is added to the packet which has come from the network layer and makes a frame. FCS verified that the frame is fully created. FCS has a number that is calculated by the data of the source computer's frame. This is very important in data decapsulation. 

1. Physical Layer
Finally, the frame comes from the data link layer converted to a bit and transmits it to another computer through a cable. Ultimately, the frame converts into the bits and sends it to the final destination. Thus, the data encapsulation process can be defined as sending Data > Segment > Packet > Frame > Bit to the final destination from the source computer. 

Now let's see data decapsulation which is the opposite side of data encapsulation whatever happens here. 

1. Physical Layer
The source computer takes the bit from the destination computer's physical layer and sends it to the data link layer.

2. Data Link Layer
Now the bit that came from the top layer has become a frame in this layer. The layer header and layer tailer added to the frame is checked in the source computer to see whether the destination is correct. That means the return frame was sent to the correct computer. It can be verified by the MAC address of the layer header. After verifying the layer header and trailer, the layer header and trailer will cut off from the frame. Let's see how the layer trailer check. If the amount of the layer tailer's FCS doesn't match with destination computer FCS, the entire frame will drop and request a new frame.

3. Network Layer
After removing the L/H and L/T from the data link layer, the frame is received to the network layer as a packet. Then after verifying the IP header from the packet, the IP/H also deducted and send the packet to the next layer.

4. Transport Layer
After removing the IP/H of the packet, it converted to a segment and received it to the transport layer. Then check the port number of TCP/UDP header and send only the data to other layers.

5. Session Layer
Here, the connection is sent to other layers.

6. Presentation Layer
Data decryption and uncompress happens in this layer.

7. Application Layer
Users can view the data. As a summary note, we can say the flows as Bit > Frame > Packet > Segment > Data. This can be simply called as data decapsulation.

If you have any doubts, please don't hesitate to let us know. The comment section is open for everyone. Let's see you in the next lesson >> Network Devices Behavior

Cheers!

No comments