-
Notifications
You must be signed in to change notification settings - Fork 407
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
Unable to handle notification after device ip change in M11 #1421
Comments
It seems that you have indeed found a problem. 👍 I should not have added this out of specification Anyway, some question to better understand the issue :
|
We need this feature on production for our customers only for COAPS In general, the problem is more complex: We have customers with devices that often changes ip addresses, but after that they:
unfortunately, without updating registration before! I know it's out of the scope the OMA LwM2M specification, but Leshan's competitors supports it ..... Do you see the possibility to implement such business logic in Leshan as a non-standard function which can be activated on demand (e.g. leshanServerBuilder.acceptNotifySendwithoutRegistrationUpdate(true) similar to leshanServerBuilder.setUpdateRegistrationOnNotification(true)) ? |
So Let's try to think about this problem.
That's not a so strong argument to me.
I understand that you try to push this in Leshan but what happens here is exactly what I explain at https://github.com/eclipse/leshan/wiki/How-Leshan-should-behave-with-Non-Compliant-Implementations-%3F#first-idea--using-robustness-principle
This would be better :
First let's try to think how code should be modified. I think a bit about that and there is maybe 1 issue with : I try to explain : If that was the case when we search by identity for CoAPs even if socket address changed we will be able to find the profile. You could try to simulate this by creating your own Let me know if this is not clear enough. |
Please find here my PoC using CustomInMemoryRegistrationStore. I replaced "Identifier" + "socket address" by:
For unsecure connections I left the existing business logic unchanged. I also sucessfully tested this solution for PSK, RPK or X509. After implementation of these changes in case device IP address change it is possible to handle Send and Notify by the server without registration update. |
Thx for testing this. So I guess we have an issue with our Identity concept... 🤔 I will try to take time to think about this. (Do not hesitate to share ideas too) |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
I created an issue to talk about new design for |
I created PoC similar to previous one but implemented using Redis https://github.com/JaroslawLegierski/leshan/tree/opl/send_not_without_update_v4 I would also like briefly present our point of view by return to our last discussion:
It would be great if we could get some clarification from OMA. In my opinion, the blur area in the specification is due to the fact that it was written BEFORE the CID was specified and widely used as a solution for IP/Port volatility.
Yes, Battery-powered devices need to minimize the power consumption (minimize handshakes + Minimize exchanges). The CID feature makes it possible to reach the server if the IP has changed, without having to make a new handshakes, and without having to perform an UPDATE before each SEND or NOTIFY. The UPDATE becomes then necessary only to signal to the server that device is “present” and ready to receive operations.
Indeed, hard to say. But at least, as explained here https://github.com/eclipse/leshan/wiki/How-Leshan-should-behave-with-Non-Compliant-Implementations-%3F#first-idea--using-robustness-principle, Leshan can be strict in regard of the specification, but should allow any solution maker to “customize” some specific behavior, such as this one: Accepting Notify and Send even when a device is “sleeping”, whatever its IP has changed or not: Leshan can rely on the DTLS layer’s responsibility to ensure the connection has been “securely accepted”. |
You mainly change the identity serializer correct ? Too bad it seems we missed to add it to RedisRegistrationStore.Builder 🤦 ...
Yep discussion are welcome :)
There are already several issues about that :
Maybe we could try to make more simple question and see if we succeed to get answer from OMA but at least for Update Registration it seems pretty clear, right ? (If you want to have more impact that just opening issue and hoping that someone at OMA will answer, unfortunately you need to be an OMA member)
I understand and it makes sense.
This makes me think there are 2 questions :
Do you need only 1) or both ?
I think there is something not so good with current For "updating registraiton on notification or send", we can also try to make this doable with current code but I don't know how this should looks like for now. |
This is theoretical, but we have some use cases where constrained devices will do a NOTFY each hour and only 1 UPDATE each day. If we force them to do an UPDATE (+ ACK) each hour before each NOTIFY, it will drastically increase the traffic and their CPU consumption.
At least we need 1) We do not want the device to be considered as “present” because he sent a NOTIFY or a SEND. It is the role of UPDATE however ...
... during my last tests I prepared this solution ... maybe it will be interesting to someone ? |
OK if one day you get real numbers about it, please share it with us.
Ok thx for clarification. Let's focus on 1) for now. (Let me know if you have any opinion/idea about #1436)
Just to clarify, I mean I don't know if we should :
Thx for sharing this. Just a little remark, ideally this should not be done in |
@JaroslawLegierski at #1373 (comment) you said :
Just to be sure, there is no urgency because we find a workaround using a custom I don't know if I was clear enough, but I agree to try to have a real solution in next release but this means working on :
Do you want I start to move forward on #1436 now (I didn't start to code about that because I was waiting for feedback) ? |
Exactly btw my colleagues will want to test this solution as soon as it will be available in M12 Release Candidate (master)
I think we can wait a while for feedback. I will try to continue my work in the meantime (Your help will be very welcome) I see only one potential problem - in next week starting from Tuesday I will be on bussiness trip. But I'll see what I can finish before I leave. |
Just let me know
If wanted, Just share your work and I could try to continue your work. |
This comment was marked as off-topic.
This comment was marked as off-topic.
So an update about this :
|
Point 2. should be addressed by : Point 3. should be addressed by : |
I think we can close this bug. The only remaining part is the out of specification "update registration on Send" so let's continue discussion about this at : #1464 |
I improved documentation about "update registration on Send" : #1544 (comment) |
Version(s)
leshan-2.0.0-M11
Which components
leshan-server-demo
Tested With
leshan-clint-demo
What happened
We have device with observed resource (e.g. /6/0/0) cid is on. After device ip address change (without reg update) when Leshan server is receiving Notification we are getting following exception:
In M10 this was working fine
How to reproduce
The main problem with Notification is that in M10 registration was returned based on registrationid:
but in M11 is used identity instead of registrationid
Unfortunately, the identity changes after changing the ip as well.
Therefore is not possible now use leshanServerBuilder.setUpdateRegistrationOnNotification(true);
I have prepared the following commit which can correct this problem.
Relevant Output
No response
The text was updated successfully, but these errors were encountered: