Message protocol + read function