-
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
Should Registration be strictly tied to a server endpoint ? #1415
Comments
I agree with your statement. I don't see a use case for a device to move its registration from one endpoint to another without registering (especially if the two endpoints are of very different natures, UDP vs non-IP). As a side note: do we need to use the URI class to identify the endpoint? |
👍
For the M11, I think clearly it's too late, for the M12 maybe. |
The memory usage: // Components of all URIs: [<scheme>:]<scheme-specific-part>[#<fragment>]
private transient String scheme; // null ==> relative URI
private transient String fragment;
// Hierarchical URI components: [//<authority>]<path>[?<query>]
private transient String authority; // Registry or server
// Server-based authority: [<userInfo>@]<host>[:<port>]
private transient String userInfo;
private transient String host; // null ==> registry-based
private transient int port = -1; // -1 ==> undefined
// Remaining components of hierarchical URIs
private transient String path; // null ==> opaque
private transient String query;
// The remaining fields may be computed on demand, which is safe even in
// the face of multiple threads racing to initialize them
private transient String schemeSpecificPart;
private transient int hash; // Zero ==> undefined
private transient String decodedUserInfo;
private transient String decodedAuthority;
private transient String decodedPath;
private transient String decodedQuery;
private transient String decodedFragment;
private transient String decodedSchemeSpecificPart; |
When I was coding this feature, I change several times from Maybe |
Any ideas ? |
Good morning from Germany! I wonder why we need to store with what endpoint the client has spoken to? In addition maybe you could help with your opinion. What do you do to scale horizontally your server applications? |
Good morning from France 😉
Unfortunately there is no easy way to solve this. You could have a look at : https://github.com/eclipse-leshan/leshan/wiki/Using-Leshan-server-in-a-cluster
To know which endpoint need to be used to send request.
I didn't know
Already answer above ☝️ |
Hey, thank you for the quick answer!
But why actually? In the end the CoAP message just contains a IP and Port, correct? Who has send it, is not interesting for the client (at least, this is what I think :D )
Thank you very much for pointing us into the right direction already! |
From a client point of view : Generally who sent data is very important for the client. There is often constraint about this in RFC/specification of different protocol,e.g. for CoAP :
In production, this is really rare that you don't care especially for security reason. (Of course for CoAP without DTLS this is maybe less true but this is also rarely used in production) From a server point of view : A Leshan server can be created with different endpoints. If a client talks to server using a Even if you have only |
One more question regarding this… You say
How does that play together with the concept of distributed registration stores (like the RedisRegistrationStore for example)? Because the “find endpoint to use” logic in DefaultDownlinkRequestSender doesn't work when trying to send something from an instance other than the one that received the registration (results in a NPE here). |
Distributed registrations store can mean a lot of different thing. 🤔 Example if
Then And so this should work like before we add "Transport Abstraction Layer".
If the endpoint doesn't exist, I'm not sure we can find a working solution. |
Ah, thanks for the clarification, that brings some light I guess 🙂
Yes, this is what I meant.
That's probably the crucial point here… because this is not the case in my test setup. The instances do not use the same listen port (cause they're located on the same machine). But now as I understand this it is a requirement for multiple Leshan server instances to share the same listen port… |
Maybe it's possible to make this use case work but I never thought about it. 🤔 Maybe given an identifier to endpoint at creation ? |
This wasn't meant as feature request 😉 I guess it's fine to use the same listen port when deployed on separate machines… |
(About replace usage of |
This is implemented by :
Please, if you are interested about this look at both PR description to know consequences of those changes. |
With new Transport Layer Abstraction, a sever can have several endpoints (opened socket address) that client can use to connect to it.
A new field
lastEndpointUsed
was added to theRegistration
to know which server endpoint is used by the client.When I created this field, I had in mind that maybe client could connect to another server endpoint and just do a registration update.
But finally, I think that this could lead to some issues (e.g. for observation) and I'm not even sure if this is allowed by LWM2M specification.
Maybe it would be better to strictly tied the registration to only 1 server endpoint. In that case, if client want to use another server endpoint, it must create a new registration.
Do you have any opinion on this ? (or knowledge about this part of the specification)
If we agree that registration must be tied to only one server endpoint, so we probably need a better name ?
endpointUsed
,serverEndpoindUsed
any idea ?The text was updated successfully, but these errors were encountered: