Saturday, January 5, 2008

Character stuffing

Character stuffing:

Same idea as bit-stuffing, but operates on bytes instead of bits.

Use reserved characters to indicate the start and end of a frame. For instance, use the two-character sequence DLE STX (Data-Link Escape, Start of TeXt) to signal the beginning of a frame, and the sequence DLE ETX (End of TeXt) to flag the frame's end.

Problem: What happens if the two-character sequence DLE ETX happens to appear in the frame itself?

Solution: Use character stuffing; within the frame, replace every occurrence of DLE with the two-character sequence DLE DLE. The receiver reverses the processes, replacing every occurrence of DLE DLE with a single DLE.

Example: If the frame contained ``A B DLE D E DLE'', the characters transmitted over the channel would be ``DLE STX A B DLE DLE D E DLE DLE DLE ETX''.

Disadvantage: character is the smallest unit that can be operated on; not all architectures are byte oriented.

9 comments:

Unknown said...

Okay, now please explain to me how a frame like this:

"A B DLE D E DLE ETX"

would look like after sending.

Anonymous said...
This comment has been removed by the author.
Anonymous said...

sorry correction:
DLE STX A B DLE DLE D E DLE DLE ETX ETX DLE ETX

Unknown said...

The Correct sequence should be:
DLE STX A B DLE DLE D E DLE DLE DLE ETX DLE ETX

Unknown said...

DLR STX A B DLE DLE D E DLE DLE ETX DLE ETX

Arshan Reddy said...

The correct sequence is
DLE STX A B DLE D E DLE DLE ETX DLE ETX

Unknown said...

I'll understanding better here compared to my collage teaching, super sir I m also E&C engineering student

Unknown said...

I'll understanding better here compared to my collage teaching, super sir I m also E&C engineering student

Sachin Gyandor said...

See this
DLE STXA B DLEDLE D E DLEDLE ETXDLE ETX