Zero-bit Insertion
Zero-bit insertion is a particular type of bit stuffing (in the latter sense) used in some data transmission protocols. It was popularized by IBM's SDLC (later renamed HDLC), to ensure that the Frame Sync Sequence (FSS) never appears in a data frame. An FSS is the method of frame synchronization used by HDLC to indicate the beginning and/or end of a frame.
The name relates to the insertion of only 0 bits. No 1 bits are inserted to limit sequences of 0 bits.
The bit sequence "01111110" containing six adjacent 1 bits is commonly used as a "Flag byte" or FSS.
To ensure that this pattern never appears in normal data, a 0 bit is stuffed after every five 1 bits in the data. This typically adds 1 stuffed bit to every 32 random payload bits, on average. Note that this stuffed bit is added even if the following data bit is 0, which could not be mistaken for a sync sequence, so that the receiver can unambiguously distinguish stuffed bits from normal bits.
A similar scheme is used in the Universal Serial Bus, but for a different reason: to ensure sufficient clock edges. Low- and full-speed USB data is sent NRZI encoded: a 0 bit causes a signal transition, while a 1 bit causes no change. The receiver must count the time between transitions to determine the number of 1 bits, and if that time is too long, the receiver can lose count. USB stuffs a 0 bit (causing a transition) after every 6 consecutive 1 bits; this guarantees at least one transition every 7 bit times. (A (0,6) RLL code.)
The main disadvantage of this form of bit-stuffing is that the code rate is unpredictable; it depends on the data being transmitted.
Read more about this topic: Bit Stuffing