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

CoAP size2 and Etag support #10169

Closed
bergzand opened this issue Oct 15, 2018 · 4 comments
Closed

CoAP size2 and Etag support #10169

bergzand opened this issue Oct 15, 2018 · 4 comments
Assignees
Labels
Area: CoAP Area: Constrained Application Protocol implementations State: stale State: The issue / PR has no activity for >185 days Type: new feature The issue requests / The PR implemements a new feature for RIOT

Comments

@bergzand
Copy link
Member

Description

Now that we have Block2 support for Nanocoap merged, I was thinking about expanding this to size2 and Etag support. They complement the block2 options nicely. My first question here is if this is still within the goals of Nanocoap or that this should be a gcoap only thing.

When all data already has to be added to a buffer via the block2 calls (instead of the direct memcpy to buffer), it is easy to calculate a size2 option and an etag option value calculated via $MECHANISM. Both of these options have to be updated after the full payload is known, similar to how the more bit from the block2 option is handled at the moment.

My ideas so far are:

  1. Add them as a submodule to Nanocoap as always on when compiled in, every handler that is block2 also gets an etag and size2 slapped on it.

  2. Expand the coap_resource_t struct with flags to indicate special processing. an unset flag must never change the behaviour otherwise it would cause an api change. The advantage is that we can easily flag certain handlers to include the etag and/or the size2 option without having to modify the handlers themselves

  3. Modify the handlers on a case by case basis, for example by adding flags and the necessary data to the nanocoap_block_slicer_t struct and reuse it for the etag and size2 options. Of course, only adding this based on an enabled submodule is trivial.

What I like to know is how you think about this.

Useful links

https://tools.ietf.org/html/rfc7959#section-4
https://tools.ietf.org/html/rfc7252#section-5.10.6

@bergzand bergzand added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: CoAP Area: Constrained Application Protocol implementations labels Oct 15, 2018
@kaspar030
Copy link
Contributor

My first question here is if this is still within the goals of Nanocoap or that this should be a gcoap only thing.

Anything optional is very welcome in nanocoap. :)

@kb2ma
Copy link
Member

kb2ma commented Oct 17, 2018

I agree that addition of ETag and SizeN options is valuable. I also think it's worthwhile to think of a low impact way to add this to nanocoap. Give me a few days to think this through.

I will think of this in the context of how Block1 and Block2 are presently implemented and opportunities for refactoring.

@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Aug 10, 2019
@kb2ma kb2ma removed the State: stale State: The issue / PR has no activity for >185 days label Aug 12, 2019
@stale
Copy link

stale bot commented Feb 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Feb 13, 2020
@stale stale bot closed this as completed Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CoAP Area: Constrained Application Protocol implementations State: stale State: The issue / PR has no activity for >185 days Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

No branches or pull requests

3 participants