The Wayback Machine - https://web.archive.org/web/20240921222537/https://www.geeksforgeeks.org/how-data-encapsulation-de-encapsulation-works/
Open In App

How Data Encapsulation and De-encapsulation Works?

Last Updated : 01 May, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Data encapsulation and de-encapsulation are fundamental concepts in computer networking and communication protocols. These processes are essential for transferring data across networks efficiently and securely.

What is Data Encapsulation?

Encapsulation is the process of adding additional information when data is traveling in an OSI or TCP/IP model. The information has been added on the sender’s side, from the Application layer to the Physical layer.

OSI Model and Working of Encapsulation

  • No additional information will be added to the user’s data in the Application layer in the TCP/IP model or the Application, Presentation, or Session layers in the OSI model.
  • The Session layer sends data to the Transport layer.
  • In the Transport layer, the data is broken up into different pieces. It adds the header in each of the broken data, which contains information like source port, destination port, sequence number, etc. Now, everything is combined into a new form.
  • The encapsulated data in the Transport layer is called Segments or Datagrams. If the transmission uses TCP, then it is called Segments, or UDP is called Datagrams.

Encapsulation

  • Now, the data will travel down and reach the Network layer. Here, layer 3 header is added. That contains information like source IP, destination IP, and so on. This information combines into a new form. The encapsulated data in the network layer is called Packets.

Encapsulation

  • Now, the network layer sends the packet to the Data Link layer When it enters into the data link layer, a new header(Layer 2) is added.
  • Also, a trailer is added. It contains information like source MAC address, destination MAC address, and so on. The trailer is used for error checking. The encapsulated data in the data link layer is called Frames.

Encapsulation

  • The physical layer takes frames from Data Link layer. The encapsulated data in the physical layer is called Bits.
  • That is how encapsulation takes place.

Protocol Data Unit (PDU)

The encapsulated data is called by different names when it travels down following layers. Those names are called Protocol Data Unit. The following table shows the name of encapsulated data in each layer.

Protocol Data Unit

Protocol Data Unit (PDU)

The TCP/IP model and Encapsulation

The Internet Protocol suite, also known as TCP/IP, contains the most extensively used network protocols and was created by the United States Department of Defence. The TCP/IP model was designed to work on a wide range of computer types. While the TCP/IP and OSI models share design concepts, but they are differ. The key distinction is that the TCP/IP model combines Layers 5–7 of the OSI model into a single application layer. It is also widely used to integrate the physical and data link layers, which are also known as the network interface or network access layer. The encapsulation and decapsulation operations of TCP/IP follow the same layer progression as in the OSI model.

What is De-Encapsulation?

De-encapsulation is the exact reverse process of encapsulation. The additional information added on the sender’s side(during encapsulation) gets removed when it travels on the receiver’s side from the Physical layer to the Application layer.

OSI Model and Working of De-encapsulation

  • The Physical layer gets the bits and de-encapsulates them into frames and sends them to the upper layer.
  • The Data Link layer receives the frames and checks MAC address whether it is matching or not. If everything matched and also no error is found. Then layer 2 header and layer 2 trailer are removed. It de-encapsulates the data and packet sent to upper layer.
  • The Network layer receives the packet from Data Link layer. It checks for IP addresses. If it matched then, the header in layer 3 is removed. Now the de-encapsulated data packet is delivered to the Transport layer.
  • Now, the Transport layer gets the data segments/ datagrams from the Network layer and removes the layer 4 header.
  • After traveling through Session, Presentation, and Application layer, the de-encapsulated data is sent to the receiver.
  • That is how the de-encapsulation takes place.
Working of De-Encapsulation

Encapsulation & De-encapsulation

Frequently Asked Question on Encapsulation and De-Encapsulation – FAQs

In which layer does Encapsulation occur?

Data Encapsulation starts from Transport Layer.

What is the difference between Abstraction and Encapsulation?

Abstraction is a design-level procedure that reduces complexity during the design stage of a project. Encapsulation is an implementation-level procedure that is used to give privacy while maintaining control over data transparency.

What happens if a header is lost during De-Encapsulation?

If a header is lost or corrupted during de-encapsulation, the receiving device may not be able to properly interpret the data or may discard it as invalid.

Is Encapsulation reversible?

Yes, encapsulation and de-encapsulation are reversible processes. Encapsulation adds headers to data for transmission, while de-encapsulation removes these headers to extract the original data.


Previous Article
Next Article

Similar Reads

What is Data Encapsulation and de-encapsulation in networking?
This article is all about Data Encapsulation and Decapsulation in Networking. Both encapsulation and decapsulation processes are simultaneously running over a network in order to make effective communication possible. Encapsulation is the process which is executed on the sender's side whereas decapsulation occurs on the receiver's side. Now, let's
3 min read
High-Level Data Link Control (HDLC) Encapsulation
High-Level Data Link Control (HDLC) basically provides reliable delivery of data frames over a network or communication link. HDLC provides various operations such as framing, data transparency, error detection, and correction, and even flow control. Primary stations simply transmit commands that contain address of secondary stations. The secondary
4 min read
Difference between encapsulation and decapsulation
In data communication there are two concept involves in transmission namely encapsulation and decapsulation. Encapsulation adds addition information to a send packet as it travels to its destination,and Decapsulation is the reverse process of encapsulation, So a receiver node can read the original send data/information. This article will make you a
5 min read
Generic Routing Encapsulation (GRE) Tunnel
Generic Routing Encapsulation is a method of encapsulation of IP packet in a GRE header which hides the original IP packet. Also a new header named delivery header is added above GRE header which contains new source and destination address. GRE header act as new IP header with Delivery header containing new source and destination address. Only rout
2 min read
Point-to-Point Protocol (PPP) Encapsulation
Point-to-Point Protocol (PPP) is basically a Wide Area Network (WAN) protocol that performs or works at layer 2 by simply encapsulating frames for transmission or transferring over different physical links or connections like serial cables, cell phones, fiber optic cable among others, etc. Encapsulation is basically a process in which lower-layer p
3 min read
IP-in-IP Encapsulation
In this article, we will discuss the overview of IP-in-IP Encapsulation and then will discuss the working and its process of encapsulation, and then finally conclude and will discuss the Logical and Physical views of the IP-in-IP encapsulation process. Let's discuss it one by one. Encapsulation :In simple terminology, Encapsulation is basically the
4 min read
What Is a Bait-And-Switch Scam? How it Works and Examples?
Bait and Switch is an unfair sales practice involving trapping customers with an item's attractive preferences and coercing or deceiving them into buying another item that is in large amounts or a more costly one. They influence consumers by claiming to offer relatively low prices and are found in traditional and new media. Such fraudulent activiti
9 min read
Ransomware Explained: How It Works And How To Prevent It
According to Cybersecurity Ventures, the rise in ransomware attacks is expected to cost companies $20 billion by 2021. Nowadays, ransomware attacks are on the rise, and the most common type of attack is phishing. Ransomware attackers can infect victims' PCs with viruses through email phishing and other methods, resulting in data encryption and subs
6 min read
How BPDU is Generated and How BPDU Works?
Before starting our topic we have to know about some basic things about computer networks and the role of BPDU in computer networks: What is Computer Networks?Types of Computer Networks.What is BPDU?Computer networks are a procedure of connecting devices such as laptops, desktops, smartphones, servers, and various IoT devices such as cameras, doorb
4 min read
What is Network Hub and How it Works?
Hub in networking plays a vital role in data transmission and broadcasting. A hub is a hardware device used at the physical layer to connect multiple devices in the network. Hubs are widely used to connect LANs. A hub has multiple ports. Unlike a switch, a hub cannot filter the data, i.e. it cannot identify the destination of the packet, So it broa
6 min read
How does Symmetric and Asymmetric Key Cryptography Works Together?
While using the symmetric and the asymmetric key cryptography the secure communication system can take advantage of all the parameters and the outcomes of both. As for the second type of key, the areas of application of symmetric key cryptography are high efficiency and the speed at which operations are carried out, therefore, it is advisable to us
9 min read
What is VPN and How It Works?
VPN is a mechanism of employing encryption, authentication, and integrity protection so that we can use a public network as if it is a private network. It offers a high amount of security and allows users to remotely access private networks. In this article, we will cover every point about virtual private networks. What is a VPN?A virtual private n
12 min read
How message authentication code works?
Prerequisite - Message authentication codes Apart from intruders, the transfer of message between two people also faces other external problems like noise, which may alter the original message constructed by the sender. To ensure that the message is not altered there's this cool method MAC. MAC stands for Message Authentication Code. Here in MAC, s
2 min read
How DORA Works?
Dynamic Host Configuration Protocol(DHCP) uses the DORA. Dynamic Host Configuration Protocol is the protocol of the application layer. It is used to provide Subnet Mask, Router Address, DNS Address, and Vendor Class Identifier. In fact, DHCP provides an automatic IP address to Hosts which want to connect to a network. DORA is the process that is us
4 min read
How Does BOOTP Works?
Prerequisite: Bootstrap Protocol The BOOTP protocol is a networking protocol, the main goal of BOOTP is to find IP addresses from a server. It was developed to replace the RARP. BOOTP was designed to let systems discover what they need to function correctly after booting up. It uses a relay agent which listens to port 68 of UDP, which lets the loca
3 min read
How does FTP Server Works?
Answer: An FTP server works by listening on a network for connection requests from FTP clients, allowing users to upload, download, and manage files on the server.An FTP (File Transfer Protocol) server operates as a central file storage location that can be accessed over a network using FTP, a standard network protocol: Listening for Connections: T
2 min read
How Does Concept of "Redirection" Works in ICMP?
Answer: ICMP redirection is used to inform a host to update its routing table to send packets through a more efficient route for a given destination.TriggerWhen a host sends a packet to a destination, but the router identifies a better route through another router, it triggers the redirection process. ICMP Redirection MessageThe router sends an ICM
1 min read
How the Domain Name System (DNS) Works?
Answer: DNS translates human-readable domain names like www.example.com, into IP addresses like 192.0.2.1, that computers use to identify each other on the network.Query Initiation When you enter a domain name (e.g., www.example.com) in your web browser, it initiates a DNS query to translate the domain into an IP address. Recursive ResolverThe quer
1 min read
How Point To Point Protocol Works?
Answer: Point to Point Protocol also known as (PPP), it is a protocol that operated at data link layer to connect network devices. Point to point protocol makes use of CHAP, LCP and NCP protocol.Below is the working of Point to Point protocol: Step 1: Initiation and Physical ConnectionOne node in the communication, initiates a connection request to
2 min read
How OSI Model Works in Real Life Example?
Answer: The OSI model is defined as a framework that helps to understand the network architecture and communication protocols. It provides with the systematic approach for transmission and communication of between the devices connected in the network. Below are the Real life examples: Example 1: Ethernet and Local Area Networks Ethernet is defined
2 min read
How TCP Sequence Number Works?
Answer: TCP sequence numbers are 32-bit numbers used to uniquely identify each byte of data in a TCP connection, starting with an initial sequence number (ISN) and incremented for each byte sent.Working of TCP Sequence Number1. Numbering the sequence: Just like the parts of your letter, each data segment sent over TCP is numbered. This ensures all
1 min read
How DNS Works Step by Step?
Answer: DNS stands for Domain Name System and is the important element of internet that is used to match the domain names provided by users to a IP address of that domain. Below is the working of DNSStep 1: Query from client to DNS ServerWhen the client sends the request with the target domain name, the browser finds the website that is connected t
2 min read
How Supernetting Works?
Answer: Supernetting is the opposite of subnetting, it is also known as route summarization, in subnetting there is a single network that is large in capacity and it's divided into smaller multiple networks that act as a subnetwork.Subnetting is useful when combining more than a few networks into a bigger is known as subnetting. similarly when we c
1 min read
How Telephone System Works?
Telephone Network is a system that allows people to make voice calls to each other across different locations. It connects telephones using a mix of wires, cables, and switches to route calls from one phone to another, whether they are next door or on the other side of the world. Telephone Network uses Circuit Switching. Originally, the entire netw
5 min read
How Address Resolution Protocol (ARP) Works?
When computer programs send or get messages, they usually use something called an IP address, which is like a virtual address. But underneath, the real talk happens using another type of address called a MAC address, which is like a device's actual home address. So, our goal is to find out the MAC address of where we want to talk to. That's where A
11 min read
What is a Side-Channel Attack? How it Works
A side-channel attack is a method used by hackers to exploit unintended signals emitted by electronic devices, such as power consumption patterns, electromagnetic emissions, or even sound these attacks leverage the physical characteristics of the devices to gather clandestine data, posing a significant security threat to modern computer systems. Wh
3 min read
Difference between Data Security and Data Integrity
Data protection and integrity have become very important in this modern world for organizations, companies, and even for the people. Unique, basic, and important to the theme here are two concepts Data Security and Data Integrity. Although both oversee separate ideas in the sector of data management they are commonly referred to. Out of these two,
6 min read
Difference Between Data Privacy and Data Security
Data Privacy and Data Security are the two buzzwords that have become very crucial in modern society, especially in the current world the majority of organizations rely on the use of information. Even though these two concepts are interrelated, they differ in that one focuses on protecting information while the other deals with individuals' rights
7 min read
Difference Between Data Encryption and Data Compression
Data Compression and Data Encryption are two important methods of protecting and managing data. While both of these processes can help protect your data, they work in different ways. In this article, we’ll discuss the key differences between data encryption and data compression, and explain how each can help you protect your data. What is Data Encr
5 min read
Difference between Traditional Data Center and Software Defined Data Center
Data centers vary a lot in design, and there has been much development in the lifetime of this project. Originally, data centers were structures that provided facilities for computer systems, storage, and other networking equipment. However, with the rapid evolution of virtualization, autopilot and cloud technologies Software Defined Data Centers (
5 min read
Article Tags :