# Multi-frame reception

**URL:** <https://forum.opencyphal.org/t/multi-frame-reception/1488>\
**Category:** Applications & Usage\
**Created:** [October 14, 2021, 12:24am UTC](https://forum.opencyphal.org/t/multi-frame-reception/1488 "2021-10-14T00:24:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andres\_R8](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/andres_r8/32/1004_2.png) [@andres\_R8](https://forum.opencyphal.org/u/andres_R8)\
**Post date:** [October 14, 2021, 12:24am UTC](https://forum.opencyphal.org/t/multi-frame-reception/1488/1 "2021-10-14T00:24:50Z")

</div>

I’m confused about how the multi-frame reception works. Specifically what happens if in between two contiguous multi-frame messages with the same CANID (i.e file Write) appears another message with a different CANID ( i.e the heartbeat of another node ). How should I handle the transfer object?

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 14, 2021, 8:38am UTC](https://forum.opencyphal.org/t/multi-frame-reception/1488/2 "2021-10-14T08:38:34Z")

</div>

Each RX session holds an independent state which makes the protocol immune to transfer preemption. I don’t think there is any other sensible way to design a real-time protocol, really.

> [@andres\_R8](#):
>
> How should I handle the transfer object?

Are you building a custom implementation of a UAVCAN transport?

---

<div class="post-metadata">

**Author:** ![andres\_R8](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/andres_r8/32/1004_2.png) [@andres\_R8](https://forum.opencyphal.org/u/andres_R8)\
**Post date:** [November 4, 2021, 11:25pm UTC](https://forum.opencyphal.org/t/multi-frame-reception/1488/3 "2021-11-04T23:25:31Z")

</div>

I’m working with the file write uavcan.file.Write service. It works most of the time, however, the RX session suddenly restarts in between two consecutive messages, so the full payload is never received. The solution is to retry the message a few times or change the Transfer ID, but I don’t understand why.

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [November 5, 2021, 12:30am UTC](https://forum.opencyphal.org/t/multi-frame-reception/1488/4 "2021-11-05T00:30:58Z")

</div>

Make sure the CAN driver does not alter the ordering of the frames. Details here: [UAVCAN/CAN: tx buffer management in CAN (FD) controllers](https://forum.opencyphal.org/t/uavcan-can-tx-buffer-management-in-can-fd-controllers/1215)

Transfer-ID shall always be different for consecutive transfers. Reusing the same value is an error until the counter is wrapped over.
