Frame Encapsulation

Frame encapsulation is the process by which data is prepared for transmission across a network. As data travels down the layers of the OSI model at the sending device, each layer adds its own header (and sometimes a trailer) containing control information relevant to that layer’s function. This process of adding information is called encapsulation. At the receiving device, this process is reversed; as the data travels up the OSI model, each layer removes its corresponding header (and trailer), a process called decapsulation.

The Encapsulation Process (Simplified)

Imagine sending a letter. The original message is like the data from the Application Layer.

  • Application Layer: The application creates the data to be sent (e.g., an HTTP request).
  • Presentation Layer: This layer might format, encrypt, or compress the data. A header might be added indicating the format or encryption method.
  • Session Layer: This layer might add information to manage the connection (session), though this is less common in TCP/IP.
  • Transport Layer: The Transport Layer (e.g., TCP) segments the data into smaller units and adds a header containing information for reliable delivery, flow control, and port numbers. This segment, with the Transport Layer header, is passed to the Network Layer.
  • Network Layer: The Network Layer (IP) adds a header containing source and destination IP addresses and routing information. This packet, with the Network Layer header, is passed to the Data Link Layer.
  • Data Link Layer: The Data Link Layer (e.g., Ethernet) adds a header containing source and destination MAC addresses and control information. It also adds a trailer (e.g., Cyclic Redundancy Check – CRC) for error detection. This complete unit is called a frame and is ready for transmission over the physical medium.
  • Physical Layer: The Physical Layer converts the frame into electrical signals, light pulses, or radio waves for transmission.

Decapsulation Process (at the Receiver):

At the receiving device, the process is reversed:

  • Physical Layer: Receives the raw signals and converts them back into a bit stream.
  • Data Link Layer: Reads the header to determine the destination MAC address (to ensure it’s for this device), performs error checking using the trailer, and removes the header and trailer. The resulting packet is passed to the Network Layer.
  • Network Layer: Reads the header to determine the destination IP address (to ensure it’s for this device) and routing information, then removes the header. The resulting segment is passed to the Transport Layer.
  • Transport Layer: Reads the header to determine the destination port number and uses the sequence numbers to reassemble the segments into the original data stream. It also performs flow control and error recovery. The resulting data is passed to the Session Layer.
  • Session Layer: Processes any session management information (if present) and passes the data to the Presentation Layer.
  • Presentation Layer: Reverses any formatting, decryption, or decompression performed at the sending end. The original data is passed to the Application Layer.
  • Application Layer: The receiving application consumes the data.

Wireshark and Encapsulation:

Wireshark plays a crucial role in visualizing this encapsulation process. When you capture a packet, Wireshark dissects it layer by layer, showing you the headers and data at each level of the OSI model (or the TCP/IP model). The Packet Details Pane in Wireshark directly reflects this layered structure, allowing you to examine the information added at each encapsulation stage.

Understanding frame encapsulation is essential for interpreting the different fields within a network packet and for troubleshooting communication issues by identifying where in the layering process a problem might occur.

OSI Model Layers
TCP/IP Essentials

Get industry recognized certification – Contact us

keyboard_arrow_up
Open chat
Need help?
Hello 👋
Can we help you?