Thought Leadership

Bit stuffing – an article about network protocols

I am a strong advocate for not “reinventing the wheel”. Doing something from scratch, unless you really have a novel approach that will yield some improvement over what has been done before, is rarely sensible outside of an educational context.

But sometimes it can be useful to understand some of the underlying principles of something that you plan to utilize …

Networking is a specialist subject and I am not such a specialist. That is just one reason why I would advise any embedded developer to consider the purchase of an off the shelf networking stack, instead of an in-house implementation. Apart from the obvious productivity factors, compliance with standards is an enormous overhead; by definition, a networked device needs to talk with other devices and, hence, such compliance is necessary.

nucleus-networking

As I said, it is useful to understand something about how networking protocols function and I recently wrote an article that might be of interest to other developers who are not networking specialists:

Bit stuffing

There are a variety of different circumstances when an embedded system needs to deal with data that is presented as a stream of bits. This is not, in itself, a problem but bits only come in two flavors – 0 and 1. This makes it difficult to manage the flow of data, as there is no easy way to determine the end of a packet or message, for example. When data traffic was controlled by hardware, this was addressed using a “long 1” or “long 0”, but this is rarely an option with modern systems. So, network protocol designers have developed techniques that involve adding extra bits in appropriate ways. This is commonly called “bit stuffing”. This article takes a look at those techniques and how they work.

Colin Walls

I have over thirty years experience in the electronics industry, largely dedicated to embedded software. A frequent presenter at conferences and seminars and author of numerous technical articles and two books on embedded software, I am a member of the marketing team of the Mentor Graphics Embedded Systems Division, and am based in the UK. Away from work, I have a wide range of interests including photography and trying to point my two daughters in the right direction in life. Learn more about Colin, including his go-to karaoke song and the best parts of being British: http://go.mentor.com/3_acv

More from this author

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.stage.sw.siemens.com/embedded-software/2015/04/06/bit-stuffing-an-article-about-network-protocols/