Skip to content

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Sep 17, 2020

Contribution description

This PR migrates OpenThread the OpenThread implementation from message queues to event threads.
Besides saving ROM and RAM, this:
a) Opens the door for using an external event queue e.g when using GNRC on top of OpenThread (TBD :)
b) Makes OpenThread more responsive: it seems the message queue was getting full from time to time. Now everything seems to run smoothly.

Testing procedure

This one is easier to test with IoT-LAB. Book a list of nodes (I'm booking the full row of nodes in Grenoble). Use examples/openthread:
a) Check that after some seconds there's only one leader. All the others should be either router or child. Use the state command.

Output
1600340780.719295;m3-302;> state
1600340780.720192;m3-354;> state
1600340780.720756;m3-354;child
1600340780.721226;m3-354;Done
1600340780.721968;m3-358;> state
1600340780.722468;m3-358;leader
1600340780.722754;m3-358;Done
1600340780.723118;m3-316;> state
1600340780.723384;m3-316;router
1600340780.723643;m3-316;Done
1600340780.723936;m3-302;router
1600340780.724196;m3-302;Done
1600340780.724485;m3-312;> state
1600340780.724745;m3-312;router
1600340780.725003;m3-312;Done
1600340780.725292;m3-336;> state
1600340780.725552;m3-336;router
1600340780.725836;m3-336;Done
1600340780.726122;m3-340;> state
1600340780.726421;m3-340;router
1600340780.726693;m3-340;Done
1600340780.726981;m3-327;> state
1600340780.727239;m3-327;router
1600340780.727495;m3-327;Done
1600340780.727780;m3-319;> state
1600340780.728037;m3-319;router
1600340780.728295;m3-319;Done
1600340780.728580;m3-332;> state
1600340780.728837;m3-332;router
1600340780.729092;m3-332;Done
1600340780.729375;m3-308;> state
1600340780.729651;m3-308;router
1600340780.729910;m3-308;Done
1600340780.730196;m3-299;> state
1600340780.730482;m3-299;router
1600340780.730739;m3-299;Done
1600340780.731025;m3-305;> state
1600340780.731282;m3-305;router
1600340780.731537;m3-305;Done
1600340780.731823;m3-344;> state
1600340780.732079;m3-344;router
1600340780.732334;m3-344;Done
1600340780.732605;m3-350;> state
1600340780.732713;m3-350;router
1600340780.732821;m3-350;Done
1600340780.732941;m3-323;> state
1600340780.733049;m3-323;router
1600340780.733157;m3-323;Done

b) Try pinging between nodes. Here's a multihop example:

1600340542.747002;m3-302;> ipaddr
1600340542.748039;m3-302;fdde:ad00:beef:0:0:ff:fe00:8c00
1600340542.748873;m3-302;fdde:ad00:beef:0:5b8b:1df0:2de1:7b3a
1600340542.749094;m3-302;fe80:0:0:0:a0b4:1e9d:852f:3e3b
1600340542.750302;m3-302;Done
m3-350; ping fdde:ad00:beef:0:5b8b:1df0:2de1:7b3a
1600341093.283009;m3-350; ping fdde:ad00:beef:0:5b8b:1df0:2de1:7b3a
1600341093.313566;m3-350;> 16 bytes from fdde:ad00:beef:0:5b8b:1df0:2de1:7b3a: icmp_seq=26 hlim=64 time=30ms

Issues/PRs references

None so far

@jia200x jia200x force-pushed the pr/openthread/refactor branch 2 times, most recently from a2d7f1e to 3cd82f9 Compare September 17, 2020 11:58
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the new event based approach much nicer. It also allows to get rid of the custom messages defines.

Code-wise things looks good. Just some minor nits but besides this, this PR should be ready to go.

@aabadie aabadie added Area: network Area: Networking Area: pkg Area: External package ports Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation labels Sep 22, 2020
@aabadie aabadie self-assigned this Sep 23, 2020
@jia200x jia200x force-pushed the pr/openthread/refactor branch from 3cd82f9 to 34b3f55 Compare September 24, 2020 13:48
@jia200x
Copy link
Member Author

jia200x commented Sep 24, 2020

@aabadie thanks for the review! I amended directly

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 25, 2020
Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK!

@aabadie aabadie merged commit a2cf40a into RIOT-OS:master Sep 29, 2020
@aabadie aabadie deleted the pr/openthread/refactor branch September 29, 2020 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants