-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nrf802154: Add ACK handling capabilities #11150
Conversation
There once was #4795 which proposed a generic mechanism outside the driver which seems reasonable IMO, as it is a MAC feature. However, I can imagine it was timing issues that lead to your decision to implement the feature next to the hardware. Can you give short feedback? |
@jia200x wanna have a look at this too? |
@PeterKietzmann Timing was one of the issues, although that matters more for answering a frame with ack requests set than receiving ack. Assuming I understand the architecture proposed with #4795 the low level driver still has to handle ACK timeouts and signal ACK_TIMEOUT back to the retransmission code. Including the code to configure and handle retransmissions wasn't a lot of extra effort here. Being able to work directly on top of the low level driver code was a definite advantage here. I agree that in the future, it might be possible to refactor the retransmission and maybe even the ack handling to a different module |
else { | ||
else if (_state == NRF802154_STATE_ACKWAIT) { | ||
/* Check if this is the expected ACK frame */ | ||
if (txbuf[3] == ieee802154_get_seq(&rxbuf[1]) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also validate the psdu length
This commit restructures the nrf802154 radio driver to allow for automatically acking frames with the ack request bit set
8c64a74
to
4200db1
Compare
rebased and added additional checks to the ack reception handling |
I just tested it and had some issues. I tested with samr21xpro and nrf5284dk all 16 combinations of ack_req, autoack, -ack_req and -autoack sending with both boards (multiple times) and wrote the results into a table. Something that always worked was -ack_req on both boards. Also I found some interesting bug with ping when sending from samr to nrf with combination [samr with autoack and -ack_req] and [nrf with autoack and ack_req]: |
I know this will be annoying, but can you split this PR? I think it is easier to debug the modules independently and also it will probably go in much faster that way. |
Nah, you're totally right, should have splitted this from the start. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
@benpicco you are not wrong, but maybe we should wait until nrf802154 is marked obsolete and is going to be removed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Since the module is still default for some boards, this PR is not completely obsolete - even though it would need a lot of work to revive. |
Which boards are that? |
I think we should go forward with with the HAL/SubMac and add the features on top of it whenever possible if it benefits other drivers too. See also #15886
The ACK handling is still implemented on driver though, only for |
Sorry, that I am not up to date. From what you say and what I see in https://github.com/RIOT-OS/RIOT/blob/master/cpu/nrf52/radio/nrf802154/nrf802154_radio.c there is a working implementation of ACK for the SubMac of nrf52 CPUs and it's set as default radio. In that case I'd suggest closing this PR with no further ado. |
obsoleted by #16630 |
Contribution description
This PR adds ack handling to the nrf802154 radio driver. Both ACKing incoming frames and ACK requests with retransmissions are supported. The number of retransmissions is configurable, but within the bounds specified by IEEE 802.15.4.
I can split this PR into the autoack and ack_req parts if preferred.
with this PR having +246 lines of code I took the liberty of adding myself to the authors list.
Testing procedure
Manual testing with a sniffer and another node is preferred here:
autoack
is disabledack_req
bit set is not retransmitted when a proper ack is receivedack_req
is disabled.ack_req
flag set whileack_req
is set in the interface settingsAnd not immediately critical, but nice to have tested:
NETDEV_EVENT_TX_NOACK
when no ack received.NETDEV_EVENT_TX_COMPLETE
whenack_req
is disabled.Issues/PRs references
depends on #11146