Data Encapsulation and De-encapsulation Explained
A networking model describes how devices communicate in a network. It breaks the entire communication process into layers. Each layer provides certain functions using various protocols. Protocols attach information to the data on the sending device and remove it on the receiving device. The process of adding information to the data is called encapsulation. The term de-encapsulation refers to the process of removing information added during encapsulation.
A protocol can add information before and after the data. If it adds information before the data, it is called a header. If it adds information after the data, it is called a trailer. The header and trailer added by a layer on the sending computer can only be removed by the peer layer on the receiving computer. For example, the header and trailer added by the Transport layer on the sending computer can only be removed by the Transport layer on the receiving computer. Data encapsulated by a layer on the sending computer is de-encapsulated by the same layer on the receiving computer. This process is known as the same-layer interaction.

The encapsulation process takes place on the sending computer. The de-encapsulation process takes place on the receiving computer. After doing the 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 both models to represent the encapsulated data.
| Term | OSI layer | TCP/IP layer |
| Data | Application | Application |
| Data | Presentation | |
| Data | Session | |
| Segment | Transport | Transport |
| Packet | Network | Network |
| Frame | Data Link | Data Link |
| Bits | Physical | Physical |
Data
The upper layer (the Application layer in the TCP/IP model) or the layers (the Application, Presentation, and Session layers in the OSI model) create a data stream and transfer it to the Transport layer. The upper layers do not attach headers and trailers to the data. But if required, the application that initiates the connection can add a header and trailer to the data. For example, browsers use the HTTP protocol to fetch webpages from web servers. The HTTP protocol uses a header to transfer the data.
The encapsulation process describes the headers and trailers that are added by the layers. It does not describe application-specific headers and trailers. Since the upper layers do not add a header or trailer to the data, the encapsulation process does not use a specific term for the encapsulated data.
Segment
The Transport layer receives the data stream from the upper layers. It breaks the received data stream into smaller pieces. This process is known as segmentation. After segmentation, it creates a header for each data piece and attaches that header to the data piece. Headers contain the information that the remote host needs to reassemble all data pieces. Once the header is attached, the data piece is called the segment. The Transport layer transfers segments to the Network layer for further processing.
Packet
The Network layer creates a header for each received segment from the Transport layer. This header contains the information required for addressing and routing, such as the source and destination software addresses. Once the header is attached, the resulting unit is called a packet. Packets are handed down to the Data Link layer. In the original TCP/IP model, the term "packet" is used instead of "datagram." Both terms are identical and interchangeable. A packet or datagram contains a network-layer header and an encapsulated segment.
Frame
The Data link layer receives packets from the Network layer. Unlike the Transport and Network layers, which add only a header, the Data Link layer attaches a header and a trailer to each received packet. The header contains information required for switching, such as the source and destination hardware addresses. The trailer contains information required to detect and drop corrupt data packages at the earliest stage of de-encapsulation. Once the header and trailer are attached, the resulting unit is called a frame. Frames are passed down to the Physical layer.
Bits
The Physical layer receives frames from the Data link layer and converts them into a format that the attached media can carry. For example, if the host is connected through a copper wire, the Physical layer converts frames into voltages. And if the host is connected through a wireless network, the physical layer converts them into radio signals.
De-encapsulation
Decapsulation occurs on the receiving computer. The de-encapsulation process is the opposite of the encapsulation process. In this process, the headers and trailers added during encapsulation are removed.
- The Physical layer extracts encoded signals from the media, converts them into frames, and passes them to the Data link layer.
- The Data-link layer reads the frame's trailer and confirms that the received frame is in the correct shape. If the frame is in the correct shape, it reads the destination hardware address to determine whether it is intended for that device.
- If the frame is not intended for it, it will discard the frame. If the frame is intended for it, it will remove the header and the trailer from the frame. Once the data link layer’s header and trailer are removed from the frame, the result is a packet. Packets are handed over to the Network layer.
- The Network layer checks the destination software address in each packet's header. If the packet is not intended for it, it will discard the packet. If the packet is intended for it, it will remove the header. Once the network layer’s header is removed, the packet becomes the segment. Segments are handed over to the Transport layer.
- The Transport layer receives segments from the Network layer. From the segment headers, it collects all necessary information and, based on that information, arranges all segments back to the correct order. Next, it removes the segment header from all segments and reassembles them in the original data stream. The data stream is handed over to the upper layers.
- Upper layers convert the data stream into such a format that the target application can understand.
The following figure shows the encapsulation and de-encapsulation process in the OSI model.

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

This tutorial is part of the tutorial series "Networking reference models explained in detail with examples". Other parts of this series are the following.
Chapter 1 What is a Networking Model Explained
Chapter 2 OSI Model Advantages and Basic Purpose Explained
Chapter 3 Difference between original and modern TCP/IP models
Chapter 4 Similarities and Differences between the OSI and TCP/IP models
Chapter 5 Adjacent-layer and same-layer interactions
Chapter 6 Data Encapsulation and De-encapsulation Explained
Chapter 7 OSI Seven Layers Model Explained with Examples
Chapter 8 TCP/IP Reference Model Explained
Chapter 9 Application layer in the OSI and TCP IP layers models
Chapter 10 Presentation layer and Session layer of the OSI model
Chapter 11 The Transport Layer Explained
Chapter 12 Segmentation Explained with TCP and UDP Headers
Chapter 13 Connection Multiplexing Explained with Examples
Chapter 14 TCP Features and Functions Explained with Examples
Chapter 15 The Network Layer Explained
Chapter 16 The Data Link and Physical layers Explained
Conclusion
Encapsulation and de-encapsulation describe how the OSI and TCP/IP models handle data transmission across networks. Encapsulation ensures that data is properly packaged with the necessary headers and trailers as it moves down the layers on the sending device. At the same time, de-encapsulation systematically removes this information on the receiving device to deliver data to the appropriate application. Understanding these processes helps you understand how network communication remains organized, reliable, and efficient.
By ComputerNetworkingNotes Updated on 2026-02-24