zephyr/subsys
Francois Gervais bfed8d0966 net: lib: coap_client: wait for all acknowledgements
This commit makes sure we continue to wait for extra confirmations even
after the request is done so we can handle duplicate confirmations if any.

Detailed description:

rfc7252#section-4.5 specifies that:

"The recipient SHOULD acknowledge each duplicate copy of a
 Confirmable message".

So if, for example, the client sends to a multicast destination address,
the server will get multiple requests and will confirm all of them.

Without this commit, the client will set the request to done after
receiving the first answer.
From here the request object will be marked as free and the duplicate
acknowledgements will stay buffered in the network stack.
Once the client tries to send a new request, it will unbuffer those
duplicate acknowledgements but now the request object is unallocated
so the client won't be able to handle those acknowledgements as duplicates.
It will instead treat it as an unexpected ACK.

To work around this issue, rfc7252#section-4.8.2 states that:

"EXCHANGE_LIFETIME is the time from starting to send a Confirmable
 message to the time when an acknowledgement is no longer expected,
 i.e., message-layer information about the message exchange can be
 purged."

Keeping the request object allocated for EXCHANGE_LIFETIME ensures that
duplicate acknowledgements can be handled accordingly.

This commit adds a basic implementation of what is stated in the RFC.

EXCHANGE_LIFETIME has been arbitrarily set to 3 * ACK_TIMEOUT which
seems more reasonable than the 247 seconds stated in the RFC.

Signed-off-by: Francois Gervais <francoisgervais@gmail.com>
2024-09-26 09:20:23 -05:00
..
bindesc bindesc: Add support for the build version values 2024-09-04 07:03:47 -04:00
bluetooth Bluetooth: Controller: Add device tree dependency to selection 2024-09-26 11:10:22 +01:00
canbus lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
console
dap
debug debug: coredump: dump privileged stack 2024-09-21 11:29:39 +02:00
demand_paging demand_paging: add a semihosting based backing store for on-demand sections 2024-09-11 20:18:51 -04:00
dfu
disk
dsp
emul
fb
fs fs: nvs: fix nvs static analysis error 2024-09-04 12:51:14 +02:00
input
ipc ipc: icmsg & icbmsg: Add support for POSIX arch targets 2024-09-26 03:34:26 -04:00
jwt mbedtls: do not set PSA_WANT_KEY_TYPE_[RSA/ECC]_KEY_PAIR_BASIC 2024-09-12 10:02:40 +02:00
llext llext: export DT devices to extensions 2024-09-25 12:59:13 +02:00
logging logging: log_output: timestamp_print uses gmtime_r, a POSIX function 2024-09-24 14:29:02 -05:00
lorawan
mem_mgmt
mgmt mgmt: mcumgr: Add SMP SVC and CHR UUIDs to header 2024-09-23 18:10:49 -04:00
modbus
modem
net net: lib: coap_client: wait for all acknowledgements 2024-09-26 09:20:23 -05:00
pm pm: policy: change the policy event handling 2024-09-09 13:56:04 -04:00
portability
profiling style: subsys: comply with MISRA C:2012 Rule 15.6 2024-09-11 07:40:35 -04:00
random
retention
rtio
sd
sensing
settings
shell style: subsys: adjust `return` usage in `void functions` 2024-09-20 11:06:55 +02:00
sip_svc
stats
storage
task_wdt
testsuite Ztest: Ztest_param fix 2024-09-19 03:25:17 -04:00
timing
tracing
usb usb: device_next: uac2: Support multiple sample rates 2024-09-13 09:21:58 +02:00
zbus lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
CMakeLists.txt lib: net_buf: move the network buffer implementation to lib 2024-09-07 11:19:05 -05:00
Kconfig