zephyr/subsys/net/lib
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
..
capture net: capture: enable capturing of IPv6/v4 only 2024-08-26 17:06:37 +02:00
coap net: lib: coap_client: wait for all acknowledgements 2024-09-26 09:20:23 -05:00
config net: config: sntp: add periodic resync option 2024-09-12 14:48:07 +02:00
dhcpv4 style: subsys: adjust `return` usage in `void functions` 2024-09-20 11:06:55 +02:00
dhcpv6 net: dhcpv6: adjust switch-case in `dhcpv6_enter_state` 2024-09-20 11:06:03 +02:00
dns net: stats: dns: Collect DNS statistics 2024-09-25 13:52:15 -05:00
http net: lib: http_server: fix snprintk issue of size_t 2024-09-25 04:00:02 -04:00
lwm2m style: subsys: adjust `return` usage in `void functions` 2024-09-20 11:06:55 +02:00
mqtt
mqtt_sn lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
ptp
shell net: stats: dns: Collect DNS statistics 2024-09-25 13:52:15 -05:00
sntp
sockets style: subsys: adjust `return` usage in `void functions` 2024-09-20 11:06:55 +02:00
socks
tftp
tls_credentials
trickle
utils
websocket net: websocket: fix undefined reference 2024-08-21 08:58:57 +02:00
zperf style: subsys: comply with MISRA C:2012 Rule 15.6 2024-08-20 10:33:51 +02:00
CMakeLists.txt
Kconfig