introduce msgpack protocol, some protocol refactoring