Suggestions for fragmentation and reliability

(Cem Karan) #1

I’m signal boosting what I said in this issue.

Summary: Use the raptorq crate; it’ll solve a lot of issues that laminar is facing.

Raptorq is an implementation of RFC 6330. The RFC outlines a method of fragmenting and encoding large byte strings such that if you lose a (user selectable) fraction of them, you can still reconstruct the original byte string. The encoding is extremely efficient; reconstruction probability after receiving K + h packets = 1 - 1/256^(h + 1), where K is the number of packets in the original message, and h is the number of additional packets received.

This doesn’t guarantee reliable delivery (only acknowledgements will do that), but it does significantly increase the chances of messages getting through. Moreover, since raptorq deals with fragmentation and reassembly for you (even in the face of repeated packets), quite a bit of work will already have been done.

If you have further questions, ping me; I’m using the crate in my own research, and am quite pleased with it so far.