Byte Stuffing Strategy

Duration: 4 min

This video lesson is available to enrolled students.

Enroll to watch — ISRO Scientist/Engineer 'SC'

AI Summary

An AI-generated summary of this video lecture.

This lecture segment explains the byte-stuffing technique used in character-oriented framing to resolve the issue of data bytes matching the flag byte pattern. The instructor details how an escape character (ESC) is inserted before any data byte that resembles the flag, ensuring the receiver can distinguish between data and control signals. The process involves the sender adding an extra byte and the receiver removing it to restore the original data.

Chapters

  1. 0:00 2:00 00:00-02:00

    The instructor begins by defining byte stuffing as a strategy to fix framing problems in character-oriented protocols. He points to the slide text stating, 'a special byte is added to the data section of the frame when there is a character with the same pattern as the flag.' He illustrates this with a diagram where a 'Flag' byte in the data stream is prefixed with an 'ESC' byte. He explains that the ESC character has a predefined bit pattern and acts as a signal to the receiver that the following byte is data, not a delimiter. The visual aid shows the 'Data from upper layer' containing a 'Flag' byte, which is then transformed into an 'ESC Flag' sequence in the 'Stuffed' section.

  2. 2:00 4:03 02:00-04:03

    The explanation shifts to the receiver's perspective and the limitations of the protocol. The instructor points to the 'Sent frame' and 'Received frame' diagrams, showing how the 'ESC Flag' sequence is transmitted and then how the receiver processes it. He highlights the 'Unstuffed' section where the ESC is removed, leaving the original 'Flag' byte as data. The slide text confirms this: 'Whenever the receiver encounters the ESC character, it removes it from the data section and treats the next character as data, not a delimiting flag.' Finally, he discusses the conflict between 8-bit character protocols and modern 16-bit or 32-bit Unicode systems, noting the industry trend toward bit-oriented protocols.

The lesson effectively demonstrates the byte-stuffing mechanism as a solution to flag byte collision in character-oriented framing. By inserting an escape character before data bytes that match the flag pattern, the protocol ensures data integrity. The receiver then strips the escape character to recover the original data. However, the lecture concludes by noting that this 8-bit approach is becoming obsolete due to the rise of Unicode, signaling a shift toward bit-oriented protocols.