title: How to build a protocol on top of tcp?
body: <p>I was searching a lot but I could not find any resources which go through the building of an own protocol which uses TCP as a transport layer.
  What are the necessary steps?
  The protocol should be some kind of "Control protocol" for devices. So I can send commands to devices and control them and get information back.</p>
  
  <p>So how would one implement a custom protocol? Is it all about defininig <code>what</code> commands can be sent and <code>how</code> the receiver reacts to different commands? Say I am defining some custom commands with <code>xml</code> send them over the wire/air, using tcp, and have some logic there which reacts to the sent command and replies. Is this a way one could implement a "protocol" ? Is this even called a "protocol"? </p>
  
  <p>kind regards.</p>