c++ code

logging still unfinished, and network level ack~