Add OTBR node type for real-time mode (draft PR)#780
Draft
EskoDijk wants to merge 4 commits into
Draft
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for real-time simulation mode and new node types, specifically OpenThread Border Routers (OTBR) and Radio Co-Processors (RCP). Key changes include the implementation of a real-time UART driver in the ot-rfsim platform, updates to the dispatcher to handle real-time clock synchronization, and new build scripts and CLI commands to manage these advanced node configurations. Feedback focuses on improving the robustness of the new UART implementation, specifically by handling EINTR signals during I/O operations and preventing potential deadlocks in the UART data processing loop when internal buffers are full.
742375a to
fb6fabf
Compare
…ead#769) This adds support for running a standard OT Posix node in a realtime simulation, where the Posix process performs realtime SPINEL/HDLC UART communication with an RCP process. Support for RCPs is the basis for upcoming features like including real OTBRs in a simulation, either running on the local host or running in a Docker. The dispatcher/simulation core is updated to allow handling of both 'realtime UART' (stdout) based CLI and logging interactions and 'virtual-time UART' interactions by nodes, in the same simulation. The real-time simulation mode now has a different time keeping mechanism that is synced to the host's clock and processes continuously, not based on discrete time periods or different speeds - like virtual-time simulation is. Deletion of nodes is updated in real-time mode: it is ongoing in the background in a separate goroutine, to ensure the simulation doesn't halt upon node deletion and that all final log messages of the exiting node are captured also. A method waitForSimulation() is introduced to be more clear when command processing needs to wait for simulation events to be processed first. It simplifies the code in expectEvent() and expectLine() functions also. Also, the queueing and filtering of UART/log output of OT nodes is simplified to make the code better readable and the UART data flow easier to understand and debug. The CLI (over PTY/UART/...) echo behavior differs for Linux Posix nodes that are controlled via stdin/stdout: there is no 'echo' behavior. Depending on OS, there could be echo. To handle all possible combinations of platform/node-type, there is a new function 'setupCli' added that autodetects whether echo is used for a node, or not, and whether the CLI connection is functional. The RFSIM radio C code is updated to avoid going to sleep when there are still OTNS events in the queue, received via the Unix socket. This ensures faster overall processing with less events being sent, relevant for nodes to keep up in real-time mode. Finally, previous build errors for the rcp target (Issue openthread#758) are now resolved. Close openthread#758 Co-authored-by: François Michel <francoismichel.dev@gmail.com>
The OTBR allows interfacing to a real Ethernet/Wi-Fi network. An 'OTBR' button is added in the GUI when in real-time mode. Only 1 OTBR can be added at a time. Binaries otbr-agent and ot-ctl are used, running as root user via 'sudo -n'. Automatic instructions for 'sudoers' will appear if the user attempts to start an OTBR without these processes having root permission. A build script is added to easily build these binaries and install them. The OTBR can be started with the 'restore' flag to let it restore previous (NVM) network settings in /var/lib/thread. GUIDE.md is updated with instructions to build an OTBR and run OTNS correctly.
… 2) log style output of otbr.sh; 3) param if to set bb interface per OTBR; 4) fast fail handling when OTBR process exits - without 5 sec wait.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This includes the existing 'RCP' PR commit. On top of this, the final commit adds the OTBR.
The OTBR allows interfacing to a real Ethernet/Wi-Fi network. An 'OTBR' button is added in the GUI when in real-time mode. Note: this is still draft code; and only 1 OTBR can be added at a time. No tests added yet.