OpenCyphal / libudpard

A compact implementation of the Cyphal/UDP protocol in C for high-integrity real-time embedded systems
MIT License
10 stars 8 forks source link

Support out-of-order multiframe transfers #26

Closed lydia-at-amazon closed 1 year ago

lydia-at-amazon commented 1 year ago

Libudpard needs to be able to support reassembling out-of-order packets that are part of a multiframe transfer

pavel-kirienko commented 1 year ago

https://matrix.to/#/!iIoEluFjwtvXWxhOJg:matrix.org/$ahlEFUemvSgNtW7e-8-nj0PuDXEq9GpM--mgP9I-aF8?via=matrix.org&via=lenfesty.ca&via=stratum0.org

/// Consider the following examples, where A and B denote distinct transfers of three frames each:
///
///     A0 A1 A2 B0 B1 B2  -- two transfers without OOO frames; both accepted.
///     A2 A0 A1 B0 B2 B1  -- two transfers with OOO frames; both accepted.
///     A0 A1 B0 A2 B1 B2  -- two transfers with interleaved frames; both accepted (this is why we need 2 buffers).
///
/// It is assumed that interleaved frames spanning more than two transfers are not possible.