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

nanocoap_sock: only re-transmit CON messages #18819

Merged
merged 1 commit into from
Nov 3, 2022

Conversation

benpicco
Copy link
Contributor

Contribution description

If a NON confirmable message is sent with a callback function, not receiving a response in time would lead to a retransmission.

This is of course an error, as only CON messages are to be retransmitted.

Testing procedure

Issues/PRs references

@github-actions github-actions bot added Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System labels Oct 28, 2022
@benpicco benpicco added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Oct 28, 2022
@benpicco benpicco requested a review from maribu October 28, 2022 23:49
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 28, 2022
@riot-ci
Copy link

riot-ci commented Oct 28, 2022

Murdock results

✔️ PASSED

782910a nanocoap_sock: only re-transmit CON messages

Success Failures Total Runtime
2000 0 2000 06m:56s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@benpicco benpicco requested a review from chrysn October 29, 2022 00:29
@benpicco benpicco force-pushed the nanocoap_sock-non-retrans branch from f6a9953 to 30ed25f Compare October 31, 2022 15:59
If a NON confirmable message is sent with a callback function,
not receiving a response in time would lead to a retransmission.

This is of course an error, as only CON messages are to be retransmitted.
@benpicco benpicco force-pushed the nanocoap_sock-non-retrans branch from 30ed25f to 782910a Compare October 31, 2022 16:18
Copy link
Member

@chrysn chrysn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with BOARD=native make -C tests/nanocoap_cli all term / put_non coap://[2001:db8::1]/ hello before-after, largely LGTM with one note:

This sets the application timeout (which on this API is fixed to whatever nanocoap decides) to the time it'd take for the first CON transmission to be sent. That's probably not too bad if the times are all configured well (with ACK_TIMEOUT larger than a typical RTT), but if RTTs do exceed ACK_TIMEOUT, responses get lost.

For comparison -- not that I'd be particularly convinced it's the best thing to do --, gcoap keeps waiting for as long as it'd wait for CONs if it retransmitted (at least when waiting for separate responses, which is a different thing, but still comparable; I don't know off my head what it does for NONs).

What's coded there is an OK choice, I just want to be sure it's understood that that choice is being made here.

@benpicco
Copy link
Contributor Author

benpicco commented Nov 3, 2022

Thank you for the review!
Maybe it would make sense to have an optional sock_asnyc option for nanoCoAP.
But for separate response there will be a separate timeout as well, but that's a differnet PR 😉

@benpicco benpicco merged commit 0284aa5 into RIOT-OS:master Nov 3, 2022
@benpicco benpicco deleted the nanocoap_sock-non-retrans branch November 3, 2022 22:10
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
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 Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants