Bit stuffing and unstuffing:
- Allows frame to contain arbitrary number of bits and arbitrary character size.
- The frames are separated by separating flag.Each frame begins and ends with a special bit pattern, 01111110 called a flag byte.
- When five consecutive l's are encountered in the data, it automatically stuffs a '0' bit into outgoing bit stream.
- In this method, frames contain an arbitrary number of bits and allow character codes with an arbitrary number of bits per character.
- In his case, each frame starts and ends with a special bit pattern, 01111110.
- In the data a 0 bit is automatically stuffed into the outgoing bit stream whenever the sender's data link layer finds five consecutive 1s.
- This bit stuffing is similar to byte stuffing, in which an escape byte is stuffed into the outgoing character stream before a flag byte in the data.
- When the receiver sees five consecutive incoming i bits, followed by a 0 bit, it automatically destuffs (i.e., deletes) the 0 bit. This is called as bit unstuffing.
- Bit Stuffing is completely transparent to network layer as byte stuffing. The figure1 below gives an example of bit stuffing.
- This method of framing finds its application in networks in which the change of data into code on the physical medium contains some repeated or duplicate data.
- For example, some LANs encodes bit of data by using 2 physical bits.