code: def new_protocol(self, protocol_name):
          
          if self._protocol_in_progress:
              raise Exception('Can not start a new protocol definition in middle of old.')
          if protocol_name in self._protocols:
              raise Exception('Protocol %s already defined' % protocol_name)
          self._init_new_message_stack(Protocol(protocol_name, library=self))
          self._protocol_in_progress = True
docs: Start defining a new protocol template.
  
          All messages sent and received from a connection that uses a protocol
          have to conform to this protocol template.