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

contikimac: a ContikiMAC compatible netdev layer #9478

Closed
wants to merge 23 commits into from

Conversation

jnohlgard
Copy link
Member

@jnohlgard jnohlgard commented Jul 2, 2018

Contribution description

Introduce a ContikiMAC compatible radio duty cycling MAC layer as a netdev layer.
The implementation uses netdev layers to wrap an underlying netdev transceiver, which means that from the gnrc_netif module the ContikiMAC layer looks and behaves as if it were a normal netdev transceiver driver.
The primary goal is to reduce power consumption, and as a proof of concept for the idea of implementing MAC layer as a netdev layer.
The module documentation is quite extensive, see contikimac.h for details.

Limitations

The implementation has a few minor direct dependencies/interactions against gnrc_netif, but this situation can be improved as the netdev layer implementation is evolved (#7736, #9417 etc)
Not yet verified against other implementations due to lack of time. Only tested against itself between samr21-xpro and frdm-kw41z.
The implementation uses the event queue introduced in #9326 to handle events from timers and handle feedback from the underlying device. The send method hijacks the event loop internally to avoid races between the IPC messages and the frame transmit algorithm.

TODO add some more text from the module documentation.

Comparison to lwmac, gomach implementations

This is implemented as a netdev layer and therefore is less intrusive and does not require modifications to the network stack (gnrc). The only requirement is a netdev compatible transceiver and a working xtimer configuration. For better power savings, the platform should be configured to use a low power timer with xtimer. This is the default for frdm-kw41z, but most other boards need a configuration modification. This should only affect CPU power consumption, it should not affect communications in any way.

Issues/PRs references

Depends on #9469, #9470, #9471, #9326
Also useful #7577
Description of the algorithm: http://dunkels.com/adam/dunkels11contikimac.pdf

@jnohlgard jnohlgard added Area: network Area: Networking Type: new feature The issue requests / The PR implemements a new feature for RIOT Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: waiting for other PR State: The PR requires another PR to be merged first labels Jul 2, 2018
@jnohlgard jnohlgard added this to the Release 2018.10 milestone Jul 2, 2018
@miri64
Copy link
Member

miri64 commented Jul 3, 2018

I will have a look at it, but it might take some time.

@jnohlgard
Copy link
Member Author

@miri64 no rush, I realize that there is so much work happening in the netdev and netif_ieee802154 modules so this may need to be refactored a few times before it can be merged.

@jnohlgard jnohlgard force-pushed the pr/netdev-contikimac branch 2 times, most recently from 1e321c7 to 1b5f63f Compare August 24, 2018 10:15
@RIOT-OS RIOT-OS deleted a comment Aug 24, 2018
@RIOT-OS RIOT-OS deleted a comment Aug 24, 2018
@jnohlgard jnohlgard force-pushed the pr/netdev-contikimac branch from 1b5f63f to f09f664 Compare August 25, 2018 13:51
@jnohlgard
Copy link
Member Author

rebased on the latest version of #9326
Addressed @codacy-bot comment

@jnohlgard
Copy link
Member Author

This implementation is actually getting quite reliable now.

Updated:

  • increase number of consecutive CCA checks to reduce risk of mistaking a strobe inter packet interval for a real idle window.
  • added more uses of the debug led
  • reduce default reply RX schedule to improve throughput

Joakim Nohlgård added 2 commits December 1, 2018 14:08
Enabled by the gnrc_netif_events pseudo module. Using an internal event
loop within the gnrc_netif thread eliminates the risk of lost interrupts
and lets ISR events always be handled before any send/receive requests
from other threads are processed.
The events in the event loop is also a potential hook for MAC layers and
other link layer modules which may need to inject and process events
before any external IPC messages are handled.
@jnohlgard jnohlgard force-pushed the pr/netdev-contikimac branch from d056ae0 to 8178036 Compare December 1, 2018 13:09
@kb2ma kb2ma removed this from the Release 2019.10 milestone Oct 8, 2019
@stale
Copy link

stale bot commented Apr 10, 2020

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.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Apr 10, 2020
@miri64 miri64 removed the State: stale State: The issue / PR has no activity for >185 days label Apr 10, 2020
@stale
Copy link

stale bot commented Oct 12, 2020

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.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Oct 12, 2020
@miri64
Copy link
Member

miri64 commented Oct 12, 2020

@jia200x is this on the agenda for a netif / ieee8021154_submac rework?

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Oct 12, 2020
@jia200x
Copy link
Member

jia200x commented Oct 12, 2020

@jia200x is this on the agenda for a netif / ieee8021154_submac rework?

from what I see here netdev layer part is not needed anymore since the Radio HAL already supports Duty Cycle MAC layers on top. We would need to rewrite the netdev adoption part and I guess it should be enough for integrating this feature

@stale
Copy link

stale bot commented Jun 2, 2021

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.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Jun 2, 2021
@stale stale bot closed this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: stale State: The issue / PR has no activity for >185 days State: waiting for other PR State: The PR requires another PR to be merged first Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants