-
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
contikimac: a ContikiMAC compatible netdev layer #9478
Conversation
I will have a look at it, but it might take some time. |
@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. |
1e321c7
to
1b5f63f
Compare
1b5f63f
to
f09f664
Compare
rebased on the latest version of #9326 |
f09f664
to
903ddcc
Compare
903ddcc
to
484792d
Compare
This implementation is actually getting quite reliable now. Updated:
|
0e208f0
to
f4963b9
Compare
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.
NETOPT_STATE_IDLE will run the normal radio duty cycling schedule, NETOPT_STATE_STANDBY, SLEEP, OFF can be used to force the radio to remain off in order to conserve battery.
d056ae0
to
8178036
Compare
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. |
@jia200x is this on the agenda for a |
from what I see here |
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. |
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, #9326Also useful #7577
Description of the algorithm: http://dunkels.com/adam/dunkels11contikimac.pdf