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

leshan demo server object version failure #1315

Closed
davidahoward opened this issue Sep 27, 2022 · 7 comments
Closed

leshan demo server object version failure #1315

davidahoward opened this issue Sep 27, 2022 · 7 comments
Labels
discussion Discussion about anything

Comments

@davidahoward
Copy link

When I try connect to connect a lwm2m v1.1 client to leshan demo server I get an error relating to the object version

Is this an ambiguity in the spec?

Sep 27 22:57:53 ip-172-31-61-197 java[14287]: 2022-09-27 22:57:53,186 RegisterResource [TRACE] POST received : CON-POST MID=16738, Token=B10001, OptionSet={"Uri-Path":"rd", "Content-Format":"application/link-format", "Uri-Query":["lt=60","lwm2m=1.1","ep=urn:dev:test-dh01"]}, "</3303/0>,</1/0>;ver=1.1,</3/0>;".. 39 bytes

Sep 27 22:57:53 ip-172-31-61-197 java[14287]: 2022-09-27 22:57:53,186 LwM2mCoapResource [DEBUG] Invalid request [CON-POST MID=16738, Token=B10001, OptionSet={"Uri-Path":"rd", "Content-Format":"application/link-format", "Uri-Query":["lt=60","lwm2m=1.1","ep=urn:dev:test-dh01"]}, "</3303/0>,</1/0>;ver=1.1,</3/0>;".. 39 bytes] received on the resource /rd from Identity /104.220.84.132:52204[psk=urn:dev:test-dh01]
Sep 27 22:57:53 ip-172-31-61-197 java[14287]: org.eclipse.leshan.core.link.LinkParseException: Unable to parse link </1/0>;ver=1.1 in </3303/0>,</1/0>;ver=1.1,</3/0>;ver=1.1

Sep 27 22:56:53 ip-172-31-61-197 java[14287]: Caused by: java.lang.IllegalArgumentException: ver attribute is only applicable to [OBJECT], and so can not be assigned to /1/0
Sep 27 22:56:53 ip-172-31-61-197 java[14287]: at org.eclipse.leshan.core.link.lwm2m.attributes.MixedLwM2mAttributeSet.validate(MixedLwM2mAttributeSet.java:99)
Sep 27 22:56:53 ip-172-31-61-197 java[14287]: at org.eclipse.leshan.core.link.lwm2m.DefaultLwM2mLinkParser.parseCoreLinkFormat(DefaultLwM2mLinkParser.java:149)

@davidahoward
Copy link
Author

davidahoward commented Sep 28, 2022

There appears to be an ambiguity/error introduced in the specification between V1.1.1 and V1.2 with respect to Object versioning.

While neither specification appears to allow Object Instance versioning explicitly, V1.2 has an example that does show it.
(I believe it is a typo in the standard)

https://www.openmobilealliance.org/release/LightweightM2M/V1_2-20201110-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_2-20201110-A.html#7-2-3-0-723-Object-Definition-and-Object-Version-Usage

7.2.3. Object Definition and Object Version Usage

At [OMNA], the Object ID:44 will be registered at least twice:
with the URN "urn:oma:lwm2m:oma:44" (version 1.0)
with the URN "urn:oma:lwm2m:oma:44:2.2"

An LwM2M Client supporting LwM2M Enabler version 1.0 registers this Object in version 2.2 along with the Server Object version 1.0 ("urn:oma:lwm2m:oma:1"), and the Device Object version 1.0 ("urn:oma:lwm2m:oma:3"). The registration payload is:

</1/0>,</1/1>,</3/0>,</44/0>;ver=2.2

Version: 1.1.1 - 2019 06 17

 

https://www.openmobilealliance.org/release/LightweightM2M/V1_1_1-20190617-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_1_1-20190617-A.html#5-1-2-0-512-Attributes-Classification

 

Attribute Name CoRE Link param Attachment Assignation Level Support Required Access Mode Value Type Default Value Applicability Notes
Object Version "ver" "=" 1DIGIT "." 1DIGIT Object Object YES (Server) YES (Client) when able to support Objects in version > 1.0 R String 1.0 (Initial Version)   Provides the version of the associated Object. The rules governing the usage of this parameter are specified in 7.2.3. Object Definition and Object Version Usage and Table: 7.2.3.-1 Object Version usage rules.

 


@davidahoward
Copy link
Author

re opened and linked to #1273

request support for more compact format where version is attached to object/instance, but applied to whole object, and checked that no object has multiple versions ... this would maximize interoperability with clients other than Eclipse leshan and Wakaama.

"Register", "Register Update", and "Discover" operations:

</44>;ver=2.2, </44/0>,</44/1> is allowed.
</44>;ver=2.2 is allowed (when there are instances of the Object 44).
</44/0>;ver=2.2 is allowed.
But </44/0>;ver=2.2,</44/1>;ver=1.9 is not allowed.

@sbernard31
Copy link
Contributor

If I correctly understand the issue this is about attaching ver attribute to an object instance.

The specification is pretty clear about this, the version must be attached to object, correct ?

At #1273 (comment), you raise that there is an inconsistency in LWM2M v1.2 specification between attribute definition and example correct ?

When there is this kind of inconsistency, we think this is better to follow specification text body than example.
More than that here the inconsistency appears in LWM2M v1.2 and for now we do not support it :

  • Leshan v1.x targets LWM2M v1.0.x
  • Leshan v2.x targets LWM2M v1.1.x

So I think we are not concerned by this issue.

Here is our thoughts about interoperability (If you want to discuss about this general idea please open a dedicated issue)

Do you open an issue about this at OMA ? or maybe you are member of OMA ?

@davidahoward
Copy link
Author

I work with two vice chairs of OMA... So yes, I've made them aware. There is text being discussed to clarify this case - and it would allow the behavior. It is, after-all, potentially more compact by a few bytes per object that is versioned.
I'm also trying to push for an update to the interop/test documentation from oma, and am looking forward to the interop events starting up again after the long covid hiatus.

@sbernard31
Copy link
Contributor

sbernard31 commented Oct 3, 2022

here is text being discussed to clarify this case - and it would allow the behavior.

How this will affect the 1.0.x and 1.1.x LWM2M version ?

@sbernard31 sbernard31 added the discussion Discussion about anything label Oct 13, 2022
@sbernard31
Copy link
Contributor

sbernard31 commented Dec 15, 2022

I understand this will not affect LWM2M v1.0 or v1.1 so I think we can close it ?

@sbernard31
Copy link
Contributor

By the way, I feel this is a duplicate of #1273. So maybe better to close this one and continue discussion at #1273.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Discussion about anything
Projects
None yet
Development

No branches or pull requests

2 participants