Facebook Pixel

What is Framing?

At the Physical Layer, data is transmitted as a continuous, unstructured stream of raw electrical bits. If the receiving device simply read this endless stream of 1s and 0s, it would have no idea where a specific message began or ended.

To solve this, the Data Link Layer performs a critical function called framing. Framing takes the continuous stream of bits and systematically divides it into highly structured, manageable units called frames. Each frame carries the actual payload data along with essential control information.

Framing Concept

A visualization showing how a continuous bit stream is divided into distinct, structured frames.

The Purpose of Framing

  • Boundary Definition: It establishes precise start and end points so the receiver can correctly identify distinct blocks of data.
  • Addressing: It encapsulates source and destination physical addresses to ensure accurate point to point delivery.
  • Error Control: It reserves specific fields within the frame to carry error detection codes, maintaining data integrity.
  • Synchronization: It helps perfectly align the timing between the sender and the receiver.

Types of Framing

1. Fixed Size Framing

In fixed size framing, every single frame transmitted over the network has an identical, predefined length. Because the length is constant, no special start or end markers are required.

  • Drawback: If the payload data is smaller than the predefined frame size, the remaining empty space causes internal fragmentation, wasting valuable bandwidth.
  • Solution: To maintain the strict size requirement, useless dummy bits called padding are forcibly added to fill up the unused space.

2. Variable Size Framing

In variable size framing, frames can dynamically change in size depending on the amount of data being sent. Because the size fluctuates, the receiver needs a strict mechanism to know exactly where the frame ends.

  • Length Field Indicator: The frame header includes a dedicated field that explicitly states the total length of the frame. If this field is corrupted by noise, the entire frame is misinterpreted.
  • End Delimiter: A highly unique mathematical pattern of bits is placed at the very end of the frame to mark the boundary.

Resolving Delimiter Ambiguity (Stuffing)

A major problem occurs if the payload data accidentally contains the exact same bit pattern used as the End Delimiter. The receiver would incorrectly assume the frame has ended prematurely. To prevent this fatal error, stuffing techniques are utilized.

  • Character / Byte Stuffing: Whenever the special delimiter character appears naturally within the data payload, a predefined escape character is inserted right before it to tell the receiver to ignore it. For example, if the End Delimiter is $, and the data itself contains $, an escape character like \O is inserted so it becomes \O$. This method has high processing overhead and is largely obsolete.
  • Bit Stuffing: Whenever the specific bit sequence of the delimiter naturally forms within the payload, an extra bit (usually a 0) is artificially inserted to break the pattern. For example, if the delimiter is 0111, and the data is 011100011110, an extra 0 is stuffed to prevent confusion, resulting in 011010001101100. Another example: if the delimiter is 1000, and the data is 110001001, after bit stuffing it becomes 11001010011.

Common Challenges in Framing

  • Start and End Detection: Consistently and accurately identifying boundaries without misinterpreting the payload data.
  • Synchronization: Ensuring the sender and receiver maintain identical clock timing, which is extremely difficult in high speed environments.
  • Error Handling: Detecting corrupted delimiter patterns caused by physical signal noise.
  • Overhead Optimization: Balancing the need for robust control headers against the desire to maximize the actual data payload efficiency.
Please Login.
Please Login.
Please Login.
Please Login.