Skip to content
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

[tester] IEEE 802.15.4 SubMAC on top of IEEE 802.15.4 Radio HAL #14787

Closed
wants to merge 31 commits into from

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Aug 19, 2020

Contribution description

This draft provides a very rough implementation of #13376. In a nutshell, this module provides a uniform layer to send and receive IEEE 802.15.4 MAC frames with retransmissions and CSMA-CA. The SubMAC emulates in software hardware features (CSMA-CA, Retransmissions, etc) missing on a given radio.

Besides that, I added a a netdev_ieee802154_submac as a transition layer. With this, default and gnrc_networking are indirectly working on top on the Radio HAL (#13943 ).

I hope this server as a proof for the Radio HAL API :)

I had to include the work by @miri64 from #11263. Since the radios are asynchronous now, there are some lost fragments when the radio returns -EBUSY during the TX process.

Testing procedure

Check tests/ieee802154_submac for the "raw SubMAC API" calls. This example supports sending and receiving data with retransmissions and CSMA-CA.
A more interesting test is running default or gnrc_networking with netdev_ieee802154_submac. With that, all radios from #14655 (CC2538, nrf802154, at86rf2xx) are working with full CSMA-CA/retransmissions support!! :)
Try adding some noise and pinging between nodes.

Issues/PRs references

#13943
#13376
#14655 (base)
#11263

@jia200x
Copy link
Member Author

jia200x commented Aug 19, 2020

Here is an example of ping (300 ms interval, 1024 kb payload) between the nrf802154 and cc2538, without retransmissions:

2020-08-19 11:46:29,504 # --- fe80::2068:3123:fe42:2e25 PING statistics ---
2020-08-19 11:46:29,509 # 100 packets transmitted, 60 packets received, 40% packet loss
2020-08-19 11:46:29,514 # round-trip min/avg/max = 117.895/123.418/129.290 ms

Same example with retransmissions:

2020-08-19 11:47:12,495 # --- fe80::2068:3123:fe42:2e25 PING statistics ---
2020-08-19 11:47:12,501 # 100 packets transmitted, 100 packets received, 0% packet loss
2020-08-19 11:47:12,506 # round-trip min/avg/max = 123.342/131.136/141.767 ms

Both motes are next to me in my office. But I consistently get ~40% packet losses when I disable retransmissions (this is what we have in current master using these radios).
When I activate the SubMAC retransmissions, I consistently get ~1% packet losses.

Note the nrf52840 doesn't support Auto ACK (it's provided by the driver implementation) nor CSMA-CA/Retransmissions. The cc2538 supports Auto ACK and CSMA-CA, but no retransmissions. The SubMAC is handling the retransmission procedure for both radios and CSMA-CA for the nrf52840

@jia200x
Copy link
Member Author

jia200x commented Sep 1, 2020

note: ACK request is disabled by default here. To enable it, use the ifconfig <pid> ack_req command

@jia200x jia200x force-pushed the pr/ieee802154_submac branch 2 times, most recently from ec6e7f4 to 82e0d5a Compare September 2, 2020 14:13
@jia200x
Copy link
Member Author

jia200x commented Oct 1, 2020

the SubMAC got merged. We can close this PoC now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants