Skip to content

CoAP Packet Deduplication#791

Open
mlasch wants to merge 5 commits intoeclipse-wakaama:mainfrom
husqvarnagroup:gardena/ml/coap-packet-deduplication
Open

CoAP Packet Deduplication#791
mlasch wants to merge 5 commits intoeclipse-wakaama:mainfrom
husqvarnagroup:gardena/ml/coap-packet-deduplication

Conversation

@mlasch
Copy link
Contributor

@mlasch mlasch commented Jun 19, 2024

According to rfc 7252, section "4.5. Message Deduplication", duplicate received packets must be dropped. Also "The recipient SHOULD acknowledge each duplicate copy of a Confirmable message using the same Acknowledgement or Reset message [...]".

Wakaama identifies a duplicate message based on the message id and the session it was received from. Duplicate messages are then processed only once for the first message, subsequent messages are acked with the
corresponding CoAP response code, but not processed further. Duplicate messages are ignored for a predefined time period EXCHANGE_LIFETIME.

@mlasch mlasch requested a review from LukasWoodtli June 19, 2024 12:00
@boaks
Copy link

boaks commented Jun 19, 2024

If the response has payload, also that payload is intended to be sent back in cases of deduplication, not only the response code.

@mlasch
Copy link
Contributor Author

mlasch commented Jun 19, 2024

If the response has payload, also that payload is intended to be sent back in cases of deduplication, not only the response code.

ok, this means we have to store the whole response message with content type etc. to properly answer duplicate messages. This will consume quite some amount of memory. But I agree, it makes sense.

@LukasWoodtli
Copy link
Contributor

Todo: squash fix

mlasch and others added 3 commits January 6, 2026 12:16
According to rfc 7252, section "4.5. Message Deduplication", duplicate
received packets must be dropped. Also "The recipient SHOULD acknowledge
each duplicate copy of a Confirmable message using the same
Acknowledgement or Reset message [...]".

Wakaama identifies a duplicate message based on the message id and the
session it was received from. Duplicate messages are then processed only
once for the first message, subsequent messages are acked with the
corresponding CoAP response code, but not processed further. Duplicate
messages are ignored for a predefined time period EXCHANGE_LIFETIME.
Test CoAP message deduplication functions.
@LukasWoodtli LukasWoodtli force-pushed the gardena/ml/coap-packet-deduplication branch from 9f47dcb to af09510 Compare January 6, 2026 11:24
@LukasWoodtli
Copy link
Contributor

Squash this PR before merging

@LukasWoodtli LukasWoodtli force-pushed the gardena/ml/coap-packet-deduplication branch from af09510 to 08a48b0 Compare January 6, 2026 11:38
Previously when a response of a de-duplicated message was resent, only
the status code was provided. Now the complete message is stored for
retransmission.
@LukasWoodtli LukasWoodtli force-pushed the gardena/ml/coap-packet-deduplication branch 3 times, most recently from a16c790 to 76e7ff2 Compare January 6, 2026 13:23
Previously when a response of a de-duplicated message was resent, only
the status code was provided. Now the complete message is stored for
retransmission.
@LukasWoodtli LukasWoodtli force-pushed the gardena/ml/coap-packet-deduplication branch from 76e7ff2 to 72556b9 Compare January 6, 2026 13:33
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
7.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants