RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

cpu/nrf52/radio/nrf802154: fix beacon acceptance

Open Lukas-Luger opened this issue 1 year ago • 3 comments

Contribution description

The nrf802154_radio.c file implements a frame filter on the MAC sublayer as mentioned in IEEE 802.15.4-2020 in Section 6.7.2 Reception and rejection. For beacon frames (section e), it should check if source PAN ID matches the PAN ID of the device. This is currently not the case and beacon frames get filtered out.

This PR implements the PAN ID check, while also confirming that source PAN ID is present in the first place.

Testing procedure

Tests provided in the first commit. (requires two nrf52 devices)

Issues/PRs references

Lukas-Luger avatar Nov 13 '24 10:11 Lukas-Luger

It looks like this is your first Pull Request? It looks very good for a first PR :) You probably noticed the failed "static tests", this is due to some coding conventions (like no trailing whitespaces at the end of the line). You can find some more information about that here: https://github.com/RIOT-OS/RIOT/blob/master/CONTRIBUTING.md#coding-conventions

You can perform these static tests on your local machine before publishing a Pull Request (however this is no guarantuee that the tests here won't fail. Sometimes something slips though and that's okay :) ).


I'll try to give this a try next week. However I don't know much about 802.15.4.

For the test program, it might be good to add one or two commands to send frames without PAN ID or with a mismatched PAN ID to see if the code you added will correctly handles these cases (even though they shouldn't occur in the first place).

crasbe avatar Nov 13 '24 19:11 crasbe

I tested the PR today and everything works as expected.

My only two remaining remarks are:

  1. The beacon function in the test program is called send, which doesn't make it super obvious that it'll send a beacon. bcnsnd would follow the "scheme" set by txtsnd or beaconsend, which is a bit nicer to remember. Maybe as a description you could write Send an IEEE 802.15.4 beacon instead of sending Beacon.

  2. While you're at it, you could add a sentence to the About section in the README file to specify for which devices this test works. I first grabbed an nRF52DK with the nRF52832, which does not support IEEE 802.15.4. Something like "Supported are for example nRF52840 based boards."

crasbe avatar Nov 20 '24 14:11 crasbe

Murdock results

:heavy_check_mark: PASSED

a5823397bc4b7044e3f09e53ad87affb0c721f75 cpu/nrf52/radio/nrf802154: fix beacon frame acceptance in _l2filter

Success Failures Total Runtime
10271 0 10271 08m:25s

Artifacts

riot-ci avatar Nov 25 '24 14:11 riot-ci

@crasbe I think your two comments have been addressed, right?

Yes 👍

crasbe avatar Jan 22 '25 10:01 crasbe

Congratz on your first merged PR, @Lukas-Luger :tada:

miri64 avatar Jan 28 '25 20:01 miri64