Serialization and deserialization of the getheaders and headers messages