-
Notifications
You must be signed in to change notification settings - Fork 2k
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
nanocoap: add support for no-response option #18154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a suggestion (GitHub doesn't let me add suggestions to files you didn't touch) to reflect the response code in the documentation.
An aspect this misses on the CoAP side is that No-Response acts on the request-response sublayer, but leaves the reliability sublayer intact. IOW: When a CON request is sent with No-Response, there still needs to be an ACK (but if the response is actually suppressed, it would be an empty ACK). In the implementation, that'd mean building a response header with a zero-length token and a zero code, and returning the header length.
I suppose it makes sense to limit no-response to NON requests then, when we are sending a response anyway we might was well include the payload. |
2059803
to
1f27d10
Compare
As far as I understood @chrysn, CON requests are also possible to have no-response. They would just an empty ACK. Shouldn't be too difficult to implement. |
But does it make sense? The RFC says
Since we are not doing separate response, I don't think this is useful for CON messages. |
What even are "separate responses" in this context? Late CON responses after the server already ACK'd the request with an empty ACK? In this case, I think it does all the more sense to save traffic from the server. |
Yes - but we don't have this implemented AFAIK (and it would also not be relevant here since the payload length of the ACK would then be 0 anyway) |
We do have empty ACKs implemented. In RIOT/sys/net/application_layer/gcoap/gcoap.c Lines 446 to 450 in c9bbac8
|
Just because we don't have them implemented (well) doesn't mean that the client can't send a CON request with a No-Response option. Sending the full answer (as we do now) is not wrong, as the option is not critical. |
3719b15
to
06aa577
Compare
Adding no-response support for NON messages is easy (less than 10 lines in |
06aa577
to
6118ab5
Compare
32b11d4
to
15a9f01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this now, thanks for sticking with it.
Not too much has changed since the version I've tested. Two notes on documentation in the usual mixture of "I think this needs to be documented" and "If this is inaccurate I'd have misunderstood something" -- but unless the latter triggers, it's fine without them as well.
Please squash.
d7b5fc3
to
17b5055
Compare
17b5055
to
29cb2d0
Compare
Contribution description
This adds support for the no-response option (RFC 7968) in the nanoCoAP server.
To allow for testing and easy use, the two client functions
nanocoap_sock_put_non()
andnanocoap_sock_post_non()
are also added which will add the no-response option if no payload response is requested.Testing procedure
A new
put_non
command has been added totests/nanocoap_cli
:Verify in Wireshark that indeed no response was generated to the PUT request
Issues/PRs references