Skip to content
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.

DLESTXETX Framing Decoder Encoder

pfisterer edited this page Apr 14, 2011 · 6 revisions

DLESTXETX Framing Decoder/Encoder

This framing decoder extracts packets from a stream of bytes. Imagine a TCP stream of bytes coming in in arbitrary chunks. The received byte chunks are not necessarily of the same size as they have been sent. For instance, a sender might send the following packets (separated by spaces): aaaa bb cccccccc ddd. The sequence of bytes transmitted could be received as follows: a aa abbcc ccc cccd dd. A frequent task is hence to split a stream of bytes into a sequence of packets.

A very robust, simple and self-resynchronizing framing is byte stuffing. This (de-)framing mechanism has for instance been used by HDLC (http://en.wikipedia.org/wiki/High-Level_Data_Link_Control)

DLE = Data Link Escape (ASCII Value 0x10) STX = Start of Text (ASCII Value 0x02) ETX = End of Text (ASCII Value 0x03)