This tutorial explains in detail the encapsulation and de-encapsulation of data with examples. Learn how data is encapsulated and de-encapsulated as it crosses layers of the OSI and TCP / IP models.

In the networking model, the terms encapsulation and de-encapsulation refer to a process in which protocol information is added to and removed from the data as it passes through the layers.

Protocol information can be added before and after the data. If information is added before the data, it is called a header. If information is added after the data, it is called a trailer.

The header and end added by a layer in the sending computer can only be deleted by the peer layer of the receiving computer. For example, the header and end added by the transport layer in the sending computer can only be deleted by the transport layer in the receiving computer.

When data encapsulated by a layer on the sending computer is processed by the same layer on the receiving computer, it is called the same layer interaction.

This tutorial is the last part of the article “Networking reference models explained in detail with examples”. This article explains the following CCNA topic.

Compare and contrast OSI and TCP / IP models

Other parts of this article follow.

Explanation of the benefits and the basic purpose of the OSI model

This tutorial is the first part of the article. It briefly explains the reasons why the OSI model was created and the benefits.

The seven-layer OSI model explained with examples

This tutorial is the second part of the article. It explains in detail the seven layers of the OSI model.

Similarities and differences between the OSI and TCP / IP model

This tutorial is the third part of the article. It compares the OSI reference model with the TCP / IP model and lists the similarities and differences between the two models.

Explanation of the TCP / IP reference model

This tutorial is the fourth part of the article. It explains the five layers of the TCP / IP model in detail.

The encapsulation process takes place in the sending computer while the de-encapsulation process takes place in the receiving computer. After encapsulation, each layer uses a specific name or term to represent the encapsulated data.

The following table lists the terms used by the layers in the two models to represent the encapsulated data.

Term OSI layer TCP / IP layer
The data Application Application
The data Presentation
The data Session
Segment Transport Transport
Package Network Network
Frame Data link Data link
Parts Physical Physical

Let’s understand each term in detail through the step-by-step data encapsulation process.

The data

The upper layer (application layer in TCP / IP) or the layers (application, presentation and session layers in OSI) create a data flow and transmit it to the transport layer.

The upper layers do not use the header and the trailer with the data. But if necessary, the application that initiates the connection can add a header and an end with data. For example, browsers use HTTP to retrieve websites from web servers. The HTTP protocol uses a header with data.

Since the use of the header and the trailer in the upper layers is application-specific, in the diagram and the encapsulation terms, the data encapsulated in the upper layers is commonly called data. .

Segment

The transport layer divides the data stream received from the upper layers into smaller pieces. Then, it creates a header for each data item. This header contains all of the necessary element information that the transport layer in the remote host needs to reassemble the data stream from the elements. Once the header is attached, the data item is called a segment. Once the segments are created, they are passed to the network layer for further processing.

Package

The network layer creates a header for each segment received from the transport layer. This header contains the information necessary for addressing and routing, such as the address of the source software and the address of the destination software. Once this header is attached, the segment is called a packet. Packets are forwarded to the data link layer.

In the original TCP / IP model, the term packet is mentioned as the term datagram. The terms packet and datagram refer to the same data packet. This data packet contains a network layer header and an encapsulated segment.

Frame

The data link layer receives packets from the network layer. Unlike the transport layer and the network layer which only create headers, it also creates a trailer with header for each packet received. The header contains the information required for switching, such as the source hardware address and the destination hardware address. The trailer contains the information necessary to detect and remove corrupted data packets at the earliest stage of decapsulation. Once the header and trailer are attached with the package, it is called a frame. The images are transmitted to the physical layer.

Parts

The physical layer receives frames from the data link layer and converts them into a format that attached media can carry. For example, if the host is connected with copper wire, the physical layer will convert the frames into voltages. And if the host is connected to a wireless network, the physical layer will convert them into radio signals.

disencapsulation

The decapsulation takes place in the receiving computer. In the de-encapsulation process, the header and end attached to the encapsulation process are removed.

The physical layer selects the encoded carrier signals and converts them to frames and transmits them to the data link layer.

The data link layer, first, reads the end of the frame to confirm that the received frame is in correct form. It reads the rest of the frame only if the frame is in good condition.

If the frame is correct, it reads the destination hardware address of the frame to determine whether the rename is intended for it or not.

If the frame is not intended for it, it will delete it immediately. If the frame is intended for it, it will remove the header and the trailer from the frame. Once the header and the end of the data link layer are removed from the frame, they become packets. Packets are delivered to the network layer.

The network layer checks the address of the destination software in the header of each packet. If the packet is not intended for it, the network layer will immediately reject this packet. If the package is intended for it, it will delete the header. After removing the network layer header, the packet will become a segment. The segments are returned to the transport layer.

The transport layer receives segments from the network layer. From the segment headers, it collects all the necessary information and, on the basis of this information, it reorganizes all the segments in the correct order. Then it removes the segment header from all segments and collects them in the original data flow. The data flow is transmitted to the upper layers.

The upper layers format the data stream in a format that the target application can understand.

The following figure shows the encapsulation and de-encapsulation in the OSI model.

encapsulation and decapsulation in the osi model

The following figure shows the encapsulation and de-encapsulation in the TCP / IP model.

encapsulation and decapsulation in the tcp / ip model

That’s it for this article. If you have any suggestions, comments, or comments on this article, please email me. If you like this article, don’t forget to share it with your friends via your favorite social site.

Author

Write A Comment