add version control and encode iteration and comm type info to bytes