Subscribe by Email

Monday, March 15, 2010

Concept of Bit stuffing

Bit stuffing is the insertion of one or more bits into a transmission unit as a way to provide signaling information to a receiver. The receiver knows how to detect and remove or disregard the stuffed bits.

Bit stuffing is required by many network and communications protocols for the following reasons:
- To prevent data being interpreted as control information. For example, many frame-based protocols, such as X.25, signal the beginning and end of a frame with six consecutive 1 bits. Therefore, if the actual data being transmitted has six 1 bits in a row, a zero is inserted after the first 5 so that the dat is not interpreted as a frame delimiter. Of course, on the receiving end, the stuffed bits must be discarded.
- For protocols that require a fixed-size frame, bits are sometimes inserted to make the frame size equal to this set size.
- For protocols that required a continuous stream of data, zero bits are sometimes inserted to ensure that the stream is not broken.

Bit stuffing in Data Link layer

Each frame begins and ends with a special bit pattern, 01111110, called a flag byte. When the sender's data link layer encounters five consecutive ones in the data, it automatically stuffs a 0 bit in the outgoing bit stream. When the receiver sees five consecutive 1 bits, followed by 0 bit, it automatically destuffs the 0 bit. Bit stuffing is completely transparent to the network layer.
With bit stuffing, the boundary between two frames can be unambiguously recognized by the flag pattern. If the receiver loses track, all it has to do is scan the input for flag sequences.

No comments:

Facebook activity