Skip to content
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

Registration validity timespan after Lifetime replacement. #185

Closed
krwc opened this issue Jan 16, 2017 · 13 comments
Closed

Registration validity timespan after Lifetime replacement. #185

krwc opened this issue Jan 16, 2017 · 13 comments

Comments

@krwc
Copy link

krwc commented Jan 16, 2017

The following content is referring to the OMA-TS-LightweightM2M-V1_0-20170113.

During registration, LwM2M Client informs the LwM2M Server about its
Lifetime, and before "Lifetime" seconds expires, the registration is valid.

Specification however, does not discuss how setting Lifetime at arbitrary point in time
affects the timespan of LwM2M Client's registration validity. Namely, it is not clear
when exactly the LwM2M Server should consider Client's registration as expired.

For example:

  1. LwM2M Server registration Lifetime is 86400 (and it is send during Register by the Client).
  2. LwM2M Server at some point in time (timestamp), say t, performs Write on its Instance,
    setting lifetime to 1.

Below an image to make this crystal clear:

            t (replacement of Lifetime)
            |
-+----------+-+------------------------------------------+----------------->
 |            |                                          |
Update       t+1                              At this point old registration (with
                                              Lifetime 86400) would be expired.

Now, we have to determine at which point the registration in fact expires:
a) Would it expire after t + 1, if the Client haven't send the Update?
b) Would it expire after old expiration deadline?
c) Something else happens?

@fdur
Copy link

fdur commented Jan 16, 2017

From my point of view: response a

@boaks
Copy link

boaks commented Jan 17, 2017

May understanding of the lifetime is, that the client informs the server of his lifetime.
If the server writes an new lifetime, then the client has not only to response to that write,
it MUST also explizitly agree on that new value by sending a "5.3.2 Update" with the new lifetime.
So I would prefer b).

@krwc
Copy link
Author

krwc commented Jan 31, 2017

Thanks @fdur and @boaks for your input. However, since you both seem to have different views on the subject I'd still like to wait for the official committee answer. :-)

@jpradocueva
Copy link
Member

DM WG to provide a clarification.

@boaks
Copy link

boaks commented May 21, 2017

For the case, when more LWM2M servers are considered, the lifetime may be written by an other LWM2M server. Therefore I think, the client MUST sent his update registration to the server and therefore this establishes the new lifetime at the server. Wire this to a special resource in the data mangement interface will make it more complex.

@jpradocueva
Copy link
Member

jpradocueva commented Jun 9, 2017

Section 5.3 clearly describes , the following

Feedback provided by Device Management Working Group.
"If the LwM2M Server or the LeM2M Client set a value to the Lifetime Resource of the server object instance, this value becomes the new lifetime of the Registration Session"

In the example provided as soon as "t" is set by LwM2M server then client should use this as its new set limit for lifetime timer..

Further sequences use "t" for any actions

TICKET TO BE CLOSED

@boaks
Copy link

boaks commented Jun 9, 2017

I still belief, that a server will adjust his "session lifetime" only by messages from the registration interface. Anything else (wiring registration interface with device management messages) will make implementations complex!

And I don't know, how the message flow should look like, when two LWM2M servers are connected to the same device and one LWM2M Server update the lifetime of the other.

@dnav
Copy link
Member

dnav commented Jun 28, 2017

Note that if the lifetime resource value is modified, the Client must send a Registration Update message to the Server as per section 5.3.2:

When any of the parameters listed in Table 9 changes, the LwM2M Client MUST send an “Update” operation to the LwM2M Server.

Table 9:

Parameter Required
Lifetime No
Binding Mode No
SMS Number No
Objects and Object Instances No

@boaks
Copy link

boaks commented Jun 29, 2017

Hi David,

Note that if the lifetime resource value is modified, the Client must send a Registration Update message to the Server as per section 5.3.2:

your absolutely right! I wrote this also above. And therefore I think, the server should use that "register update" to update the used lifetime and not "couple/wire up" the data management interface with the registration interface.

@dnav
Copy link
Member

dnav commented Jun 29, 2017

Sorry, I don't get your point.
Server wants the Client lifetime to be modified.
1/ Server sends a Write /1/x/1 [new value]
2/ Client acks the Write
3/ Client sends a Registration Update to /{location}?lt=[new value]
4/ Server and Client update their internal expiration date for the session to now + [new value]

@boaks
Copy link

boaks commented Jun 29, 2017

As far as I understand the above clarification:

1/ Server sends a Write /1/x/1 [new value]
2/ Client acks the Write
3/ Server and Client update their internal expiration date for the session to now + [new value]
4/ Client sends a Registration Update to /{location}?lt=[new value]

@boaks
Copy link

boaks commented Jul 3, 2017

Sorry, I don't get your point.

My point was, that the original question above, explicitly states:

a) Would it expire after t + 1, if the Client haven't send the Update?
b) Would it expire after old expiration deadline?

This would therefore either be

a)
3/ Server and Client update their internal expiration date for the session to now + [new value]
4/ Client sends a Registration Update to /{location}?lt=[new value]

or

b)
3/ Client sends a Registration Update to /{location}?lt=[new value]
4/ Server and Client update their internal expiration date for the session to now + [new value]

So, if the TS says:

"If the LwM2M Server or the LeM2M Client set a value to the Lifetime Resource of the server object instance, this value becomes the new lifetime of the Registration Session"

Then a) is chosen and therefore the sequence from @dnav (that I also agree, to be the right one) is changed to the sequence I specified above (step 3 and 4 exchanged).

with a), I don't understand, how multiple LWM2M server should implement that, if one server writes to the lifetime of the other.

@dnav
Copy link
Member

dnav commented Jul 3, 2017

The TS states that:

  • The lifetime of a LwM2M session is the value of the lt parameter of the Registration message. It can be modified by a Registration Update message.
  • The Client gets the value of lt from the lifetime resource of the Server Object instance.

Any other point is implementation dependant.

krwc pushed a commit to AVSystem/Anjay that referenced this issue Jul 13, 2017
Features:
- Added custom Attribute "con" that may be used to enforce sending Confirmable
  Notifications for observed entities.

- Added new chapter of the Tutorial about Executable Resources.

- Added documentation subsection about relation LwM2M Discover and Attribute
  Storage.

Improvements:
- Removed dependency to Boost.Python in tests, and migrated to pybind11
  instead (included as a submodule).

- Implemented sending Update after Lifetime Resource has changed
  (OpenMobileAlliance/OMA_LwM2M_for_Developers#185)

- Implemented proper Bootstrap Server Account purge logic
  (OpenMobileAlliance/OMA_LwM2M_for_Developers#195)

- Improved handling of CoAP Ping messages - they no longer produce error messages
  in the logs.

- Added more NULL-assertions in the example demo client.

- Enabled scan-build in make check by default.

- Bumped all copyright years.

Bugfixes:
- Fixed dead URLs in the documentation.

- Fixed segfault when Bootstrap Discover was performed on a non-existing Object.

- Fixed various minor issues found by the static analysis tools.

- Fixed various compilation issues when compiled on older Android platforms.
krwc pushed a commit to AVSystem/Anjay that referenced this issue Jul 13, 2017
Features:
- Added custom Attribute "con" that may be used to enforce sending Confirmable
  Notifications for observed entities.

- Added new chapter of the Tutorial about Executable Resources.

- Added documentation subsection about relation LwM2M Discover and Attribute
  Storage.

Improvements:
- Removed dependency to Boost.Python in tests, and migrated to pybind11
  instead (included as a submodule).

- Implemented sending Update after Lifetime Resource has changed
  (OpenMobileAlliance/OMA_LwM2M_for_Developers#185)

- Implemented proper Bootstrap Server Account purge logic
  (OpenMobileAlliance/OMA_LwM2M_for_Developers#195)

- Improved handling of CoAP Ping messages - they no longer produce error messages
  in the logs.

- Documented ANJAY_ERR_* constants.

- Added more NULL-assertions in the example demo client.

- Enabled scan-build in make check by default.

- Bumped all copyright years.

Bugfixes:
- Fixed dead URLs in the documentation.

- Fixed segfault when Bootstrap Discover was performed on a non-existing Object.

- Fixed various minor issues found by the static analysis tools.

- Fixed various compilation issues when compiled on older Android platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants