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

Protocol deviations around GWINFO/SEARCHGW #10

Open
axelriet opened this issue May 11, 2020 · 1 comment
Open

Protocol deviations around GWINFO/SEARCHGW #10

axelriet opened this issue May 11, 2020 · 1 comment

Comments

@axelriet
Copy link

What are the reasons/pros/cons of the deviations? Does it affect interoperability with other implementation of MQTT-SN? Is there a way to revert to standard MQTT-SN 1.2 behavior so devices using this implementation mesh with others without any subtle surprise? Thanks!

@arobenko
Copy link
Member

The major reason for the deviation is to simplify the implementation and support low memory consumption when compiling client for bare-metal application (which doesn't use dynamic memory allocation).

To the best of my understanding that MQTT-SN was designed for multiple use cases, including widely distributed mesh networks with multiple gateways and/or slow / unreliable I/O link. But I think this is not a typical setup. The typical (IMHO) one is 1 gateway residing in the same machine with MQTT broker and just forwards / translate messages between the protocols. If it's not your case and you do want to put multiple gateways in the same mesh network, then maybe my libraries are not 100% suitable for you.

Quote from spec:

Upon receiving a SEARCHGW message a gateway replies with a GWINFO message containing its id. Similarly, a client answers with a GWINFO message if it has at least one active gateway in its list of active gateways. If the client has multiple GWs in its list, it selects one GW out of its list and includes that information into the GWINFO message.

The intention of the protocol designers is to allow other clients that are already online and monitor existence of available gateways to respond on behalf of the gateway with the available information. In my implementation of the client, the latter doesn't respond with GWINFO on behalf of the gateway, which will respond anyways (or some other client implementation responds on behalf of the gateway)

Similar with my gateway, it is supposed (according to spec) to broadcast its information with GWINFO to save sending of SEARCHGW messages by some clients which just got online, but haven't started their gateway discovery process yet.

My understanding that my deviations from the spec may (not necessarily will) cause extra messages being exchanged and/or gateway discovery may take a bit more time, but there shouldn't be any interoperability problems with other implementations. However, there is only one way to find out, just try it. If you do want to use my libraries in the production environment and require strict adherence to the spec, then I can put some extra effort and implement the required functionality or you can dive into my code and see whether you can do it yourself.

Home it helps.
Regards,
Alex

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

No branches or pull requests

2 participants