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
Tracking: OpenThread Support #3833
Comments
What is
? |
For the flash storage, what is required? How many bytes do we need to store? |
This was referring to implementing the OpenThread radio PAL in libtock-c (I was trying to draw a distinction between the capsule / libtock-c milestones). I've rephrased to hopefully make this more clear. |
I do not have an exact answer for now. Briefly checking, it appears on the order of ~24kB persistent storage is expected. @Samir-Rashid and @atar13 just began working on the flash PAL so we should have more ideas as to what is required soon. I do not expect flash functionality to be a blocker for Thread functioning as it serves to provide persistence to the Thread state across power cycles. This will however be necessary to comply with the Thread spec for any future Thread certification. |
Ok that is quite a bit. We do have https://github.com/tock/tock/blob/master/capsules/extra/src/nonvolatile_storage_driver.rs which might work for a userspace interface.
I don't know what this looks like in practice, but it seems like a device should be able to reboot and reconnect as expected. It would be good to avoid having to make any caveats about how things don't quite work as expected. But maybe you can't really tell as a user what happens if you don't have persistent state. |
Getting close!
|
I think there is a fundamental mismatch with trying to use OpenThread in userspace with the
however the lower layer of OpenThread does not expect to sit on any of those layers except for the radio. For the tutorial we essentially added a raw path through those layers. However, that still doesn't allow configuring the channel. Instead, I propose:
|
I am overall in favor of this. The current 15.4 stack is not conducive to supporting OpenThread and we are forcing a square peg into a round hole so to speak. In my opinion, the two routes forward at this juncture are either:
I favor option two because I think this provides an easier path forward to more fully support the features OpenThread requires (sleeping / channel switching etc). These features become increasingly complicated to reason about across virtualized 15.4 access with multiple apps. Some things to keep in mind with option two are that:
Ideally these changes should be entirely abstracted from userland. Perhaps we should only expose one 15.4 userspace driver that then will interface to the "non virtualized full control" 15.4 driver or the "virtualized stack" depending on how the kernel is configured.
With this design we can then return an error to userland if the full radio control "non virtualized" design is configured and multiple apps request 15.4 access. Furthermore, we can also easily return an error to userland if things such as switching channels or setting radio transmit power etc are attempted to be set in the virtualized mutli app design. |
The easiest path is to have two separate One thing to note is that currently the virtualization in this stack is within the kernel and not for userspace. Adding userspace virtualization would make this more complicated, as that really only applies to the in-kernel MAC stack. While a singe userspace driver would be nice in some respects, I'm not inclined to purse that for two reasons: 1) Sending raw MAC-layer frames from userspace seems, practically speaking, a niche use case, and 2) It adds a fair bit of complexity to the implementation which is otherwise simpler to read and write as separate drivers. Note, we can keep the interface the same so userspace has only one driver and gets the errors as you describe. It's just that the correctness of that is harder to maintain over time (every change would need to be ported to both syscall drivers). |
Overview
With #3683, Tock added support for a minimal Thread network implementation. This implementation was completed in a Thread capsule and served to demonstrate the feasibility of Tock supporting Thread networking. Given the complexities of implementing the entire Thread specification, a bespoke Tock Thread implementation is unfeasible.
Google actively manages and maintains the OpenThread project; this serves as the de facto Thread implementation. To date, all major embedded platforms that provide Thread support have implemented the protocol by porting OpenThread (typically in the form of an OpenThread library / module). Moving forward, a Tock / OpenThread port likely presents the most feasible avenue towards Tock providing a robust Thread network stack. Tock presents an added complexity to complete this port given Tock's policy preventing external dependencies. Thus far, the two options for porting OpenThread to Tock appear to be through:
This tracking issue will serve to provide a summary of the OpenThread libtock-c port, describe what remains to be done, and emphasize capsule features blocking the completion of this port. Beyond simplifying a Thread implementation, choosing to port OpenThread provides the added benefit of a simplified path towards Tock receiving official certification as a Thread platform (the Thread group holds a lower bar for testing if using the OpenThread stack).
Details to Port OpenThread
OpenThread provides a detailed porting guide. OpenThread specifies a platform abstract layer (PAL) which a given OpenThread platform must implement to provide support for:
libtock-c OpenThread
OpenThread utilizes a
CMake
build system. This creates immediate conflicts and challenges with the libtock-cmake
based build system. To work around this, we invoke the OpenThreadCMake
build system to create static libraries. Moreover, we specify anarm-none-eabi.cmake
file so that OpenThread is compiled in a manner compatible with libtock-c / Tock. These static libraries are linked to libtock-c applications using the libtock-c external library mechanism. We are currently able to compile a libtock-c application that references OpenThread functions and successfully constructs an OpenThread instance.Tasks to Complete
This list will likely grow as development continues. For now, this is divided into tasks that need to be completed in order to provide a fully functional Thread network and the less urgent tasks required for Thread certification.
Fully Functional Thread Network
timer_in
Thread Certified Thread Network
Other Related Problems
The text was updated successfully, but these errors were encountered: