-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bluetooth: Mesh: do not send time status often than 30 seconds #11997
Conversation
Test specificationCI/Jenkins/NRF
CI/Jenkins/integration
Detailed information of selected test modules Note: This message is automatically posted and updated by the CI |
You can find the documentation preview for this PR at this link. It will be updated about 10 minutes after the documentation build succeeds. Note: This comment is automatically posted by the Documentation Publishing GitHub Action. |
PR has been converted into draft. I want to implement unit tests for the changes. |
c37d834
to
b90fc35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions.
- Why does the time relaying introduce randomness, whereas the time set response does not?
- If I read the current code correctly, the time set handling will just not send a response if it is less than 30 seconds since last response was sent. In my opinion, we should always send one response after the "last" time set, potentially having to delay this response (between 1 and 30 seconds, depending on when the last status was sent).
Also, if I read correctly, the relay handling will first wait until 30 seconds have passed and then schedule a delayed status at 20-50 seconds later after this, meaning there will be 50-80 seconds between these two relays. Is this on purpuse? If so: why?Sorry, I misread. The delay will of course be pending if the handler is called again while waiting to send the first randomly delayed relayed status.
This is an errata requirement. Please take a look errata reference in JIRA task since Omkar asked to not reference the errata number and text here. Changes to this subclause:
Time Set will always send a response to the sender here: https://github.com/nrfconnect/sdk-nrf/pull/11997/files#diff-626675688a86ce1b261757ffd4f251e64c8b334403c2432102a99ec505fa8c32R273 The time model had the bug and didn't publish state change at all. Luckily errata coincided with this code. I fixed the bug according to the errata requirement. |
My point is, it should probably sent one more status update than it does now. Meaning, the behavior should be this, I think: t = 0, time_set The last step will not be done with the current code. |
I asked this question to @omkar3141 during implementation. Should the server skip or postpone publishing? I got answered it should skip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec does not have clarity about whether 30 second limit applies to all kinds of publishing or only to periodic publishing. The intention in the spec seems to be to prevent flooding of network by Time_Status messages if someone sets the publish period to a low value. We will ask for clarification.
Meanwhile it is enough to implement rate limitation for handing of 'Time_Status' messages (in handle_time_status
). So, if other server is misbehaving, this server does not start misbehaving as well.
Hm... Seems spec clarifies the time restriction only for one kind of publishing. This is state change publishing. I added periodic here to follow 30 seconds rules. I'll remove considering time in periodic publishing. If user wants to do DDoS attack of network over the time service, let's allow to do this. :) |
Discussed IRL. For now, we decided to apply publishing time restriction rules for handling Time Status messages and not do for Time Set messages. At the current moment, publishing the last Time model state depends on configured periodic publishing time of the Time model. If Time Set is received during 30 seconds restriction time it is not clear what is better to do: publish immediately or postpone until the end of the already started 30 seconds timeout. If clarification for the Time Set message is gotten from Bluetooth SIG it will be applied later as a separate task\PR. |
20739a6
to
61352aa
Compare
Commit adds restriction for the Time model to not send Time Status more often than 30 seconds if this is aresult of state update after Time Set or Time Status commands. Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
e850dcc
to
7018d94
Compare
7018d94
to
dc6b4e8
Compare
dc6b4e8
to
58275c2
Compare
Commit adds unit test to check the Time Status timig of the Time model (including time restrictions). Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
58275c2
to
a9325ab
Compare
Commit adds restriction for the Time model to not send Time Status more often than 30 seconds if this is aresult of state update after Time Set or Time Status commands.