-
Notifications
You must be signed in to change notification settings 8000 - Fork 2.1k
nanocoap: problem with [re]transmission behaviour: (some blocks are sent twice immediately) #18217
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
Comments
Hm this seems to be one of those problems that go away when setting |
With
assert(gnrc_pktbuf_contains(pkt)); |
Wait what 😨 Is that with the current
and
I get
|
master 1638606 You have to send the request multiple times. Your last comment shows only |
and with current |
I don't see this on |
yes on stm32 |
Could also be an out of bounds write on the Ethernet driver, corrupting the pktbuf free list. can you try with #18227 |
|
What 'works' surprisingly well is --- a/sys/net/application_layer/nanocoap/sock.c
+++ b/sys/net/application_layer/nanocoap/sock.c
@@ -174,7 +174,7 @@ ssize_t nanocoap_sock_request_cb(nanocoap_sock_t *sock, coap_pkt_t *pkt,
case STATE_RESPONSE_RCVD:
case STATE_RESPONSE_OK:
if (ctx == NULL) {
- DEBUG("nanocoap: waiting for response (timeout: %"PRIu32" µs)\n",
+ printf("nanocoap: waiting for response (timeout: %"PRIu32" µs)\n",
_deadline_left_us(deadline));
}
const void *old_ctx = ctx; However I don't see an immediate re-transmission in the error case, instead the node appears to wait for the timeout and never gets the response. I do see the response in Wireshark however when sniffing directly on the node's interface. (DOSE, with #18163) |
So my issue was caused by a different thread being scheduled every 10 ms (and calling Adding the printf (or a busy loop, really) before calling I assume the behavior you saw was then caused by issue described in #18416 - so can we close this now? |
Good news: With #18416 no assertion fires anymore, and it is functioning very well. But still, on the second attempt to upload a file, some blocks are transmitted twice immediately. With |
I would keep it open, because it is only partially fixed. |
fixed with #18969 |
Description
During the testing of #17962, I discovered that something in the transmission behaviour of
nanocoap
is not working correctly. Using e.g.tests/nanocoap_cli
:client put fe80::3478:9157:9fd5:81c3%5 5683 /somepath somedata
, to create a resource on a server. The first transmission succeeds, but if you repeat the command, a retransmission is also triggered immediately. Even though the first transmission succeeds, the first call tosock_udp_sendv()
innanocoap_sock_request_cb()
returns the expected value, but the message is not sent out (?). At least it does not appear in wireshark. Then the first call tosock_udp_recv_buf()
always returns-ETIMEDOUT
. But then in the second call tosock_udp_sendv()
, the message is sent out and appears in wireshark.Steps to reproduce the issue
coap-server
:coap-server -A fe80::3478:9157:9fd5:81c3%eth0 -d 1
.nucleo-f767zi
over Ethernet with my notebook, where the server is running.tests/nanocoap_cli
:CFLAGS+=-DCONFIG_GNRC_IPV6_NIB_ARSM=1 BOARD=miot-nucleo-f767zi make flash term
.client put fe80::3478:9157:9fd5:81c3%5 5683 /somepath somedata
and see the attached result.Expected results
The nanocoap client should not immediately trigger a retransmission, but wait for [
ACK_TIMEOUT
,ACK_TIMEOUT * RANDOM_FACTOR
], before it triggers the first retransmission.Actual results
Most of the time, the retransmission happens immediately, if the server is not very fast with the ACK.
nanocoap_cli_put.pcapng.gz
Versions
Linux 5.18.3-arch1-1
(but that´s not relevant)
The text was updated successfully, but these errors were encountered: