Data Encapsulation

Submitted by rayc on Mon, 10/25/2021 - 09:09

Let's start with the basics of how Network engineers explain how data traverses the network. When you click on the browser, or open a web page, or send an email on your PC, data is send over the network medium whether it be via copper, fiber, or wireless. At it's most basic form, all data is sent as little electrical pulses of 1's or 0's. But how does that web page go from words and pictures and CSS etc to those 1's and 0's? The answer of course is Data Encapsulation/Decapsulation. 

In the 1980's, a standardised model was created to explain how data encapsulation/decapsulation works called the Open Systems Interconnect or OSI model. The OSI model is a 7 layered model as below. 

OSI Model

I'll try to explain very briefly a little about each layer and their function.

  • Application layer: As the name indicates, This layer deals with the Applications itself. This layer includes things like your Chrome, or Outlook and is where the end user interacts with the software. 
  • Presentation Layer: This layer is concerned with how the data is presented. Encryption also occurs here.
  • Session Layer: This layer is responsible for establishing, managing and terminating sessions both local and remote. 
  • Transport Layer: This layer is responsible for the transport of your data. This is where the method of data transport is chosen. TCP and UDP are the most common Transport layer protocols these days.
  • Network Layer: This is where the logical network addressing comes in, think IPv4 and IPv6 addresses.
  • Data Link Layer: This layer provides node-to-node data transfer and addressing. Think MAC addressing for hosts on the same segment. PPP and other Layer 2 protocols also sit at this layer.
  • Physical Layer: This layer is responsible for the physical transmission of data over a medium

 

The OSI model has been used for a very long time do explain network concepts and is still referred to today, however there is also another model, the TCP/IP model. The TCP/IP model started out as a 4 Layer model, however has since been updated to separate the lower layer (Link) into two layers (Data Link and Physical). The Internet Layer was also renamed to the Network Layer. 

TCP/IP Model

Both the TCP/IP and OSI models provide the same function in explaining how the Network functions work. This also means that the OSI and TCP/IP model layers correlate to each other. The OSI Upper layers as shown above correlate to the TCP/IP Application layer. The OSI Lower layers also correlate to the TCP/IP lower layers, Transport, Network (was Internet), Data Link and Physical (was Link) Layers and their functions.  

Data Encapsulation

As data is encapsulated through the OSI model layers and is converted from what you see to electrical pulses, each step in the encapsulation process is referred to as a Protocol Data Unit and correlates to the layer it was encapsulated at.  Data that's encapsulated at the Application layer is referred to as a Layer 7 PDU or L7PDU.  Data that's encapsulated at the Session layer would be an L5PDU and so on. The TCP/IP model has a similar naming standard and is more commonly used when talking about data encapsulation today. The TCP/IP Model refers to data encapsulated at the Application Layer (OSI Application, Presentation and Session Layers) simply as Data. As it is encapsulated at the Transport layer, the data is referred to as a Segment, the Network layer is referred to as a packet, Data Link layer a Frames and the Physical Layer as bits. 

Data Encapsulation

At each stage of the Encapsulation process, Headers (and Trailers at the Data Link Layer) are added to the data. These headers contain the required information for the data to be decapsulated at the other end (or on the same PC depending). When the data is decapsulated, the Headers (and Trailers) are removed from the data at each layer and sent up the stack. 

Headers

This layered interaction is referred to as either:

  • Adjacent Layer Interaction: The Process of adjacent layers on the same PC interacting.
  • Same Layer Interaction: The Process of same layers on different PC's interacting.