Re: zoap architecture question...


Marcus Shawcroft <marcus.shawcroft@...>
 

On 19 September 2016 at 19:37, Vinicius Costa Gomes
<vinicius.gomes(a)intel.com> wrote:

Hi, Thanks for responding. Its good to see coap moving forward in zephyr.

The plan is that the error handling would live in the layer above. So
yeah, the zoap-server sample right now is lacking in the invalid
messages handling department.

What I see that could be done in the zoap layer is to add a few helper
functions for building the most common types of messages, including
RESET.

This choice implies multiples consumers of the coap protocol, both
client and servers would all duplicate the logic of detecting various
error conditions and responding in an appropriate way. This logic is
reasonably simple, but none trivial. I believe they all need to detect
and deal with the at least the following cases:

- corrupt packet, header incomplete (no message id)
-> ignore it
- corrupt packet, but header complete (included message id)
-> ignore unrecognized versions
-> respond with con on reset messages.

Lowering this logic into the coap layer encapsulates it in one place,
which should be simpler to verify, and, at least superficially should
simplify the implementation of coap consumers.... are there other
issues involved here that make is desirable to push such logic
upwards?

Cheers
/Marcus

Join devel@lists.zephyrproject.org to automatically receive all group messages.