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

pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC #18156

Merged
merged 6 commits into from
Jun 13, 2023

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Jun 1, 2022

Contribution description

This PR adds support for openDSME.
DSME is a time-slotted MAC layer (similar to TSCH), which supports deterministic communication.
It offers some promising features such as:

  • Topology agnostic (peer-to-peer, star, mesh, etc).
  • By design, it's possible to extend the network just adding more coordinators near the edge.
  • Automatic resolution of beacon collision
  • Transmission of frames using either CSMA-CA or multi-channel GTS (guaranteed time slot)
  • Built-in slot negotiation

Similar to TSCH, such a MAC improves PRR drastically (with the cost of some latency) and enables low-power operation.

This work is still WIP, although the basic support is already running. This PR includes:

  • Basic openDSME support as a pkg
  • Implementation of GNRC interface for openDSME (IP support will be a follow up)
  • An example application

Some commits (labeled as "REMOVE_ME") will be handled in separate PRs
Tested with nrf52840. The cc2538 needs a small change to remove the beacon filter.

Testing procedure

  1. Flash 2 boards (or more) with examples/opendsme.
  2. Choose one boards as the PAN coordinator and run:
ifconfig 3 pan_coord
ifconfig 3 up
ifconfig     <--- Should display "Link: up" and show the short address.
  1. Join the DSME network in the shell of the other nodes. Wait a fraction of a second and get the status and address.
ifconfig 3 up
ifconfig    <--- Should display "Link: up" and show the short address.
  1. Use the gts option to enable GTS transmission (slotted). By default, the option is unset.
  • Send data using CSMA-CA
ifconfig 3 -gts
txtsnd 3 <l2_addr> login 
  • Send data using GTS
ifconfig 3 gts
txtsnd 3 <l2_addr> login 

Example session

PAN coordinator

2022-06-01 15:22:43,584 # main(): This is RIOT! (Version: 2022.07-devel-595-g61467b-pr/opendsme_v3)
ifconfig 3 pan_coord
2022-06-01 15:24:40,160 # ifconfig 3 pan_coord
2022-06-01 15:24:40,162 # success: set option
> ifconfig 3 up
2022-06-01 15:24:48,087 # ifconfig 3 up
2022-06-01 15:24:48,090 # This node is PAN coordinator
> 2022-06-01 15:25:23,347 # PKTDUMP: data received:
2022-06-01 15:25:23,352 # ~~ SNIP  0 - size:  12 byte, type: NETTYPE_NETIF (-1)
2022-06-01 15:25:23,355 # if_pid: 0  rssi: -32768  lqi: 0
2022-06-01 15:25:23,356 # flags: 0x0
2022-06-01 15:25:23,357 # src_l2addr: BD:3F
2022-06-01 15:25:23,359 # dst_l2addr: EB:82
2022-06-01 15:25:23,364 # ~~ SNIP  1 - size:   4 byte, type: NETTYPE_UNDEF (0)
2022-06-01 15:25:23,366 # 00000000  52  49  4F  54
2022-06-01 15:25:23,371 # ~~ SNIP  2 - size:   9 byte, type: NETTYPE_UNDEF (0)
2022-06-01 15:25:23,374 # 00000000  41  A8  39  23  00  82  EB  3F  BD
2022-06-01 15:25:23,378 # ~~ PKT    -  3 snips, total size:  25 byte

Child:

Welcome to pyterm!
Type '/exit' to exit.
ifconfig 3 up
2022-06-01 15:25:07,341 # ifconfig 3 up
> ifconfig
2022-06-01 15:25:09,228 # ifconfig
2022-06-01 15:25:09,232 # Iface  3  HWaddr: BD:3F  Link: up 
2022-06-01 15:25:09,234 #           L2-PDU:127  
2022-06-01 15:25:09,235 #           
ifconfig 3 gts
2022-06-01 15:25:17,318 # ifconfig 3 gts
2022-06-01 15:25:17,319 # success: set option
txtsnd 3 EB:82 RIOT
2022-06-01 15:25:23,184 # txtsnd 3 EB:82 RIOT
> 

Issues/PRs references

#15313
Depends on #18283, #18284

@jia200x jia200x added the State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet label Jun 1, 2022
@github-actions github-actions bot added Area: build system Area: Build system Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: examples Area: Example Applications Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System Platform: ARM Platform: This PR/issue effects ARM-based platforms labels Jun 1, 2022
@PeterKietzmann
Copy link
Member

Great PR! As discussed offline, many nits need cosmetics, e.g., get rid of magic numbers, do the todos, remove needless checks, add asserts consistently, split out unrelated changes... Furthermore, I think that the code would be even better to understand if 1. the filenames would be more descriptive (example: opendsme.cpp currently contains netif adaptation) and 2. there was a brief overview (documentation) of the openDSME OS abstraction interfaces. Otherwise, I flashed the example application on two nrf52840dk boards and successfully managed to send some packets with CAP and CFP as described above. Nice!

@github-actions github-actions bot added the Area: Kconfig Area: Kconfig integration label Jun 29, 2022
@jia200x jia200x added State: waiting for other PR State: The PR requires another PR to be merged first and removed State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jun 29, 2022
@jia200x
Copy link
Member Author

jia200x commented Jun 29, 2022

Not WIP anymore!
But depends on #18283 and #18284

@jia200x
Copy link
Member Author

jia200x commented May 31, 2023

Our current Doxygen configuration doesn't seem to behave that nicely with C++ :/

@jia200x jia200x force-pushed the pr/opendsme_v3 branch 2 times, most recently from 1e4f7c4 to 972304c Compare May 31, 2023 08:45
@jia200x
Copy link
Member Author

jia200x commented May 31, 2023

I think I found the missing group

@jia200x
Copy link
Member Author

jia200x commented May 31, 2023

finally!!!

@chrysn
Copy link
Member

chrysn commented May 31, 2023

Thanks a lot. I'm particularly looking forward to trying this on energy constrained devices.

bors merge

bors bot added a commit that referenced this pull request May 31, 2023
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=chrysn a=jia200x



Co-authored-by: Jose Alamos <[email protected]>
@chrysn
Copy link
Member

chrysn commented May 31, 2023

Looking over the commits (as I should have done before the bors command), why is there a revert in this, moreover one that refers to a commit not in the history?

bors cancel

@bors
Copy link
Contributor

bors bot commented May 31, 2023

Canceled.

@jia200x
Copy link
Member Author

jia200x commented May 31, 2023

I reverted a commit into the wrong branch. Completely unrelated. Will fix it.

@miri64
Copy link
Member

miri64 commented May 31, 2023

bors merge

bors bot added a commit that referenced this pull request May 31, 2023
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=miri64 a=jia200x



19691: drivers/bmx055: fix crazy use of FPU r=maribu a=maribu

### Contribution description

As the title says...


19694: tests/drivers/epd_bw_spi_disp_dev: fix accidental use of FPU r=maribu a=maribu



Co-authored-by: Jose Alamos <[email protected]>
Co-authored-by: Marian Buschsieweke <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 31, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Jun 1, 2023
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=miri64 a=jia200x



19689: cpu/sam0_eth: disable PHY when MAC is sleeping r=dylad a=benpicco





Co-authored-by: Jose Alamos <[email protected]>
Co-authored-by: Benjamin Valentin <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2023

Build failed (retrying...):

bors bot added a commit that referenced this pull request Jun 1, 2023
18156: pkg/opendsme: add initial support for IEEE 802.15.4 DSME time-slotted MAC r=miri64 a=jia200x



Co-authored-by: Jose Alamos <[email protected]>
@bors
Copy link
Contributor

bors bot commented Jun 1, 2023

Build failed:

@jia200x
Copy link
Member Author

jia200x commented Jun 2, 2023

the build failure seems to be unrelated

@jia200x
Copy link
Member Author

jia200x commented Jun 13, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jun 13, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit c463bc9 into RIOT-OS:master Jun 13, 2023
@jia200x
Copy link
Member Author

jia200x commented Jun 14, 2023

Thank you everyone for reviewing!

@benpicco benpicco added this to the Release 2023.07 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: doc Area: Documentation Area: examples Area: Example Applications Area: Kconfig Area: Kconfig integration Area: network Area: Networking Area: pkg Area: External package ports Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines 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