title: Implementation communication protocols in C/C++
body: <p>I am in the process of starting to implement some proprietary communication protocol stack in software but not sure where to start. It is the kind of work I have not done before and I am looking for help in terms of resources for best/recommended approaches.</p>
  
  <p>I will be using c/c++ and I am free to use use libraries (BSD/BOOST/Apache) but no GPL. I have used C++ extensively so using the features of C++ is not a problem.</p>
  
  <p>The protocol stack has three layers and it is already fully specified and formally verified. So all I need to do is implemented and test it fully in the specified languages. Should also mention that protocol is very simple but can run on different devices over a reliable physical transport layer. I know the events, inputs, outputs, side effects and the behaviour of the protocol state machine(s). Generally, an interrupt is received to read the message received from the physical layer to read it and send to the waiting device. The receiving device can process and pass the response message to the protocol layer to send out on the physical layer.</p>
  
  <p>Any help with references/recommendations will be appreciated. I am willing to use a different language if only to help me understand how to implement them but I will have to eventually resort to the language of choice.</p>
  
  <p><strong>Update:</strong> An example protocol I wish to implement is something like <a href="http://dl.dropbox.com/u/882753/NFC%20Simple%20NDEF%20Exchange%20Protocol%20Specification%201.0.pdf" rel="noreferrer">SNEP</a>.</p>
  
  <p>I do not need to worry about connection management. We can assume the connection is already establish and I the protocol does is data exchange where the protocol messages are already well defined in specifications</p>