{"id":7341,"date":"2015-04-06T08:00:15","date_gmt":"2015-04-06T07:00:15","guid":{"rendered":"https:\/\/blogs.mentor.com\/colinwalls\/?p=7341"},"modified":"2026-03-26T16:45:39","modified_gmt":"2026-03-26T20:45:39","slug":"bit-stuffing-an-article-about-network-protocols","status":"publish","type":"post","link":"https:\/\/blogs.sw.siemens.com\/embedded-software\/2015\/04\/06\/bit-stuffing-an-article-about-network-protocols\/","title":{"rendered":"Bit stuffing &#8211; an article about network protocols"},"content":{"rendered":"<p>I am a strong advocate for not &#8220;reinventing the wheel&#8221;. 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.<\/p>\n<p>But sometimes it can be useful to understand some of the underlying principles of something that you plan to utilize &#8230;<!--more--><\/p>\n<p>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 <a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/networking\" target=\"_blank\" rel=\"noopener noreferrer\">off the shelf networking stack<\/a>, 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.<\/p>\n<p><a href=\"http:\/\/www.mentor.com\/embedded-software\/nucleus\/networking\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-7342 size-medium\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2015\/04\/nucleus-networking-520x319.png\" alt=\"nucleus-networking\" width=\"520\" height=\"319\" \/><\/a><\/p>\n<p>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:<\/p>\n<p><a href=\"http:\/\/www.embedded.com\/design\/connectivity\/4439070\/Bit-stuffing\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Bit stuffing<\/strong><\/a><\/p>\n<p>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 &#8211; 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 &#8220;long 1&#8221; or &#8220;long 0&#8221;, 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 &#8220;bit stuffing&#8221;. This article takes a look at those techniques and how they work.<\/p>\n<p><a href=\"http:\/\/www.linkedin.com\/in\/colinwalls\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6579\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/linkedin.png\" alt=\"\" width=\"40\" height=\"40\" \/><\/a><a href=\"https:\/\/twitter.com\/colin_walls\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6583\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/twitter.png\" alt=\"\" width=\"40\" height=\"40\" \/><\/a><a href=\"https:\/\/www.facebook.com\/colinwalls.author\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6591\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/facebook.png\" alt=\"\" width=\"40\" height=\"40\" \/><\/a><a href=\"https:\/\/plus.google.com\/116301748426290440139\/posts?hl=en%3Fhl=en\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6587\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/google.png\" alt=\"\" width=\"40\" height=\"40\" \/><\/a><a href=\"http:\/\/www.slideshare.net\/ColinWalls\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6595\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/slideshare.jpg\" alt=\"\" width=\"41\" height=\"41\" \/><\/a><a href=\"https:\/\/blogs.mentor.com\/colinwalls\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-6599\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/51\/2014\/01\/wordpress.jpg\" alt=\"\" width=\"44\" height=\"44\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am a strong advocate for not &#8220;reinventing the wheel&#8221;. Doing something from scratch, unless you really have a novel&#8230;<\/p>\n","protected":false},"author":71677,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[1],"tags":[300,310,304],"industry":[],"product":[],"coauthors":[],"class_list":["post-7341","post","type-post","status-publish","format-standard","hentry","category-news","tag-embedded-software","tag-networking","tag-nucleus"],"_links":{"self":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7341","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/users\/71677"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/comments?post=7341"}],"version-history":[{"count":1,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7341\/revisions"}],"predecessor-version":[{"id":10352,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/posts\/7341\/revisions\/10352"}],"wp:attachment":[{"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/media?parent=7341"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/categories?post=7341"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/tags?post=7341"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/industry?post=7341"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/product?post=7341"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.sw.siemens.com\/embedded-software\/wp-json\/wp\/v2\/coauthors?post=7341"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}