-
Notifications
You must be signed in to change notification settings - Fork 376
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
CoAP Packet Deduplication #791
base: main
Are you sure you want to change the base?
CoAP Packet Deduplication #791
Conversation
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.
If the response has payload, also that payload is intended to be sent back in cases of deduplication, not only the response code. |
@@ -817,6 +817,8 @@ typedef int (*lwm2m_bootstrap_callback_t)(lwm2m_context_t *contextP, void *sessi | |||
void *userData); | |||
#endif | |||
|
|||
typedef struct _coap_msg_dedup_ coap_msg_dedup_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear if this really belongs here. Probably it does together with the complete struct definition as we need it in the context. But then it should probably be prefixed by lwm2m_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to store the list somewhere, the lwm2m context was the easiest place, for that I needed this forward declaration. The message duplication tracking list is an implementation detail of the CoAP layer and might fit better there. The context structure was available everywhere I needed access though. Problem is, there is no clean separation between LwM2M and CoAP in Wakaama.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we don't have that nice separation between CoAP and LwM2M. But the forward declaration doesn't work properly together with the typedef.
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. |
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.