sys/net/link_layer/ieee802154/submac: move ack transmission#21973
sys/net/link_layer/ieee802154/submac: move ack transmission#21973Lukas-Luger wants to merge 2 commits into
Conversation
mguetschow
left a comment
There was a problem hiding this comment.
Thanks for doing this!
Using the radio without The test mimics the |
|
For my use-case it makes more sense to use SubMAC directly rather than hacking 802.15.4 features into the netdev. I am told, that netdev should abstract various media types into a uniform API, therefore adding 802.15.4 specific stuff is questionable. This also allows for less overhead (netdev will typically run in a separate thread). |
|
I get the point that
This is still an assumption to me. In my opinion it should be coded in a way that a frame is read at only one place (submac then and no longer netdev_ieee802154_submac). Because the |
Maybe @jia200x as the original author of the radio HAL has some comments on this? In any case I would expect documentation in https://doc.riot-os.org/structieee802154__radio__ops.html#a99394547c65c7872bff808bba1d69c46 to establish a clear API contract of when calling this function returns correct results. Edit: it actually states
which probably translates to "the data could be overwritten" |
|
Alright. I just implemented an |
Many of us require to work with the radios directly without In cases where a component is certain that it's interacting with an IEEE 802.15.4 radio (such as with Zigbee, openDSME, OpenWSN, etc.), the This challenge has existed for quite some time, at least since the first attempts to port OpenWSN, and the rework was designed to allow us to use netdev as a "network interface" and not as a "radio interface." For more context, check out this year's RIOT Summit presentation on the Radio HAL and SubMAC
I agree that the test could be improved, but it was intended as an entry point for testing the Radio HAL. We've encountered cases where broken network tests were actually due to incomplete or inconsistent Radio HAL implementations. Testing the Radio HAL using the netdev API doesn't allow us to test key aspects like compliance with the Abstract State Machine, timing issues, and so on. In general, I’d suggest we avoid adding more workarounds on top of netdev. It has taken significant effort to create a more consistent experience across radios, and this has required careful attention to the layering. Continuing to refine this will help maintain long-term stability and flexibility. |
Based on previous experience working with other radios, it’s difficult to guarantee that this will work across all radios. In many cases, modifying states inside the read function may violate the assumptions of the Abstract State Machine. For this issue, I see two potential solutions: First solution (likely simpler): Allow peeking into the framebuffer by modifying the Radio HAL API. This would allow the upper layer (e.g., SubMAC) to access the SQN or any other frame section. We could make this a requirement for radios that don’t support AutoACK, such as the AT86RF2xx in Basic Mode or NRF52, which usually offer a mechanism to peek into the framebuffer. These radios typically expect the driver to handle the ACK logic. Second solution (a bit more controversial): Modify the drivers or SubMAC to handle the framebuffer directly, potentially changing the receive logic from a "pull" model (calling a read function) to a "push" model (subscribing to a framebuffer). This would decouple the state-changing logic from the read function and allow for better control. |
|
I've added an if-statement to not call |
|
Oh, something went wrong during your This is not the workflow that I think most people follow. |
5016369 to
2426229
Compare
8ccfd08 to
6a3ffa4
Compare
fabian18
left a comment
There was a problem hiding this comment.
@mguetschow have all your change requests been addressed?
Contribution description
The transmission of IEEE802.15.4 Acknowledgements should be handled by the SubMAC-Layer itself, rather than the SubMAC-netdev. This will allow applications using SubMAC directly, to reduce redundant code.
Testing procedure
Flash
tests/net/ieee802154_submaconto two devices which do not contain theIEEE802154_CAP_AUTO_ACKcapability.Send a message using
txtsndfrom one device to the other. Notice, thatNo ACKwill appear in the terminal, because SubMAC does not send Acks.Issues/PRs references
#13376
#14950