Framing in Data Link Layer
Last Updated :
22 Sep, 2025
In computer networks and telecommunications, frames are the fundamental units of digital transmission. A frame consists of a sequence of bits organized into a structured block that conveys data along with control information such as addressing and error detection codes. In the Data Link Layer (DLL) of the OSI model, framing plays a critical role by dividing the continuous stream of bits into manageable, meaningful chunks that can be reliably transmitted and processed by the receiver.
Data Link layer servicesNote: Framing is especially important in processes such as Time Division Multiplexing (TDM), where data is transmitted in discrete time slots. Common data link layer technologies like Ethernet, Token Ring, Frame Relay, and others each define their own specific frame structures.
Purpose of Framing
Framing serves several purposes in the Data Link Layer:
- Provides a clear boundary between frames for the receiver.
- Includes source and destination addresses, enabling point-to-point communication.
- Enables error detection and correction mechanisms to ensure data integrity.
- Allows reliable and organized transmission of data.
Note: The process of dividing data into frames and reassembling it is transparent to the user and fully managed by the data link layer protocol.
Types of Framing
1. Fixed-Size Framing
- Frames have a predefined, fixed size.
- No explicit start or end delimiters are needed; the frame size itself acts as the boundary.
- Drawback: Internal fragmentation occurs when the data is smaller than the frame size, wasting bandwidth.
- Solution: Padding is used to fill the frame to its full size.
DLL - Upper to Lower level2. Variable-Size Framing
This method requires explicit indicators of frame boundaries and includes two popular techniques:
- Length Field: The frame includes a length field that specifies the frame size. Used in Ethernet (802.3). Here, If the length field gets corrupted, the frame cannot be parsed correctly.
- End Delimiter (ED): A unique pattern marks the end of the frame. Used in Token Ring networks. Here, The ED pattern may occur in the data.
To solve this problem, two stuffing techniques are used:
(a) Character/Byte Stuffing
- Used when data is character-based.
- If the data contains the special delimiter character (e.g.,
$
), an escape character (e.g., \O
) is inserted to distinguish it.
Example: If ED = $, and data contains $, it becomes \O$.
Disadvantage: High processing overhead and obsolete in modern systems.
(b) Bit Stuffing
Bit stuffing- ED pattern is a sequence of bits (e.g.,
01111
). - Whenever this pattern appears in data, a
0
is inserted to prevent confusion.
Example Problem: Data = 011100011110, ED = 0111, After bit stuffing -> 011010001101100
Another Example: Data = 110001001, ED = 1000, After bit stuffing -> 11001010011
Problems in Framing
Framing in computer networks faces several challenges:
- Start and End Detection :The receiver must correctly identify frame boundaries using delimiters or flags.
- Synchronization: Sender and receiver must stay aligned on frame timing, especially in high-speed networks.
- Error Handling: Noise can corrupt data or delimiters; error detection methods like CRC or checksums are used.
- Overhead: Headers and trailers add control information but reduce usable bandwidth.
- Efficiency: The goal is to maximize payload while minimizing overhead and processing delays.
- Compatibility: Different devices may use different framing methods, causing misinterpretation.
Explore
Computer Network Basics
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer & Presentation Layer
Application Layer
Advanced Topics
Practice