move to big endian on send-recv, added encoder in send_packet