Implement and test msg processing for the protocol