dnode protocol implementation in python