-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Energy] Add support to timed-transmission events - Part 5 of RTEA #362
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #362 +/- ##
==========================================
- Coverage 49.97% 47.37% -2.61%
==========================================
Files 38 40 +2
Lines 4608 4906 +298
==========================================
+ Hits 2303 2324 +21
- Misses 2123 2394 +271
- Partials 182 188 +6
|
Just noting for completeness that this PR addresses only the dispatcher.go file. (Changes are in 2nd commit, 1st commit was kept in to avoid rebasing later on) @Vinggui @simonlingoogle @jwhui I see the motivation for this PR clearly, same as for the radiomodels PR (#316) and also needed for energy analysis. However I do worry about the proposed change here to integrate all of such functionality into the dispatcher which is already quite complex. The 'radiomodels' approach was rather a nice alternative that separates the event-dispatching more cleanly from different radiomodels (which may themselves have arbitrary complexity or be very simple, with or without CCA, with or without collissions / timing etc.). The models use the dispatcher as a timed event processing engine so it keeps that dispatcher close to its core features. For the goal of RTEA the PR #316 can also provide the right events and hooks - there's also a new "TxDone" event type added ; and a new type "RadioTx" which has the same role as "RadioComm" here. We have some choices to make on how to proceed with this: e.g.
I would prefer one of 1, 2 or 3. In any case the merging of any PRs may take some time because OpenThread is also busy with other things and we are contributing tons of code ;-) |
Hi @EskoDijk ,
Good point! I'll add it up in the next PRs.
I believe that the decision to keep things mostly inside the dispatcher was based on the fact the I don't know yet if I agree with a medium model without more than one channel, nor a radio model without collisions. This should be up to the protocol to be able to handle. However, the idea of simplifying
This is good. It means that:
I am excited to go with options 1 or 2. The only thing is that I still have a bit more commits to finish the steps which should include visual charts in the web view. If we go with option 2, I am concerned of having too many modifications to be implemented to make it keep working with the web part. Nevertheless, what I am doing now is just finishing the break into steps necessary for everyone to better debug/understand the initial suggestion at PR #235. Thanks again. |
The "Ideal*" radiomodels I propose do handle all the channels - it's only that they do not simulate collissions. To me that seems a valid model: it tries to mimic what OTNS has until now. Maybe it shouldn't be the default simulation model, but that's up for a future discussion. I do think it needs to be there for comparison purposes. E.g. debug your new algorithm in ideal conditions vs realistic conditions. Or, do a simulation of a Thread system where nodes are connected by high-speed Ethernet.
Ok! Thanks also for taking all the time to respond and the splitting of the PRs. |
I see your point. For an experimental reason, or impact analysis, I agree with your points. Also, the "close-to-real" model as default seems a better option, and since this is an easy swap, I think it is a win-win situation. |
Contribution description
This PR is part of the process of breaking PR #235 into small steps, a process nominated "Road to Energy Analysis" (RTEA). These small modifications will lead to the whole improvement started on March 2022. At the end of these steps, OT-NS will be capable of precisely estimating energy consumption, collision events (channel aware), and plot all the data in real-time as the simulation progress.
At the moment, OT-NS can not estimate energy, collisions, nor transmission energy. Also, even though OT is working well in simulation, many of its recovery properties are not correctly simulated as they would happen in real devices due to its incorrect timing events at the simulated radio part.
This PR adds functions to handle the radio-timed events (e.g., transmissions) by each simulated device.
It is still compatible to the current implementation of the OT.
This PR also introduces:
Main modifications
eventTypeRadioComm
to distinguish the current operation of OT (using a confusing duplex commeventTypeRadioReceived
) from the new implementation;eventTypeRadioTxDone
providing callbacks signals that consider transmission times of the simulated device;This PR keeps all previous commits to reduce future rebase efforts. However, relative to the timeline of RTEA, it addresses only the following files:
Requirements
None (if intended to be used with current Openthread repository). But, this is a walk to the road of PR #7500 in Openthread repository that will allow all the new features in the simulation to work.
Testing procedure
Just install OTNS the same way as before, using the "OTNS=1" for the building parameter.
Roadmap
This is part 5 of the RTEA (Road to Energy Analysis) steps to PR #235 and PR #7500.
Part 1: PR #357;
Part 2: PR #8144;
Part 3: PR #359;
Part 4: PR #8152;
Part 5: This PR;
Part 6: PR #8165;
Part 7: PR #363;
Part 8: PR #8173;
Part 9: PR #365;
Part 10: PR #366;
Part 11: PR #367.