ION-DTN icon indicating copy to clipboard operation
ION-DTN copied to clipboard

SF: John Huff: Primary block is mutated due to incomplete CRC support

Open iondev33 opened this issue 1 year ago • 2 comments

Currently, the primary block serialization function assumes that the same CRC type is always used (CRC16 defined by default in ION). This becomes an issue for interoperability, as when a bundle is forwarded, the primary block CRC type can be changed. For example, if ION forwards a bundle that is using a 4 byte CRC32 for the primary block, when ION goes to (re)serialize the primary block this will be modified to 2 byte CRC16. According to the BPv7 spec, the primary block cannot be modified between creation and delivery. While this doesn't typically cause bundle delivery to fail, it can cause bpsec integrity to fail.

Suggestion is to store the primary block crcType in the Bundle structure during creation and acquisition, and use this to properly encode the CRC type and value in the primary block during serialization.

It might also be nice to add the ability to change the primary block CRC type either for individual bundles as an argument in the bp_send function, or as a bp database setting that can be set in bpadmin and gets applied to all created bundles.

-John

iondev33 avatar Dec 20 '23 23:12 iondev33