Serialization and deserialization of the getaddr and addr messages