Reset an assembling container when a tecmp order is wrong
Table of contents
Current buggy behavior
Some of the warnings are coming that should not come. When from UDP Receiver we are missing some samples the counter of tecmp samples is not consecutive anymore. But it should be. So the assembling of not completely assembled tecmp segments, which consist of many sampales, should be descarded and the state of assembling container should be reset or cleared. Because otherwise new samples will refer to the old wrong state of unassembled tecmp segments.
Steps to reproduce
The input pcap file is attached:wireshark_vlan121_after_adtf_small_cut.pcap
Expected correct behavior
In this pcap file example these warnings should not come. They came, because in the container is still a wrong state of unassembled previous segments.
Instead of this a correct warning message should come, like this: "Packet received where the order is not correct. Reassembled segments will be discarded."
And the states in elements of the container should be reset, or all elements should be cleared. Because we dont know how many unassembled segments were corrupted because of the missing samples.
Possible solution:
The wrong order of tecmp samples can be detected by cTecmpFilter::ProcessInput
:
https://gitlab.com/digitalwerk/solutions/adtf_content/adtf_toolboxes/adtf_tecmp_toolbox/-/blob/preview/0.0.13/src/filter/lib/adtf_tecmp_base_filter.cpp?ref_type=heads#L166
oHeader.GetCounter()
has a current tecmp counter. With its help a wrong order can be detected.
And a flag/status can be sent over ProcessPayload
:
https://gitlab.com/digitalwerk/solutions/adtf_content/adtf_toolboxes/adtf_tecmp_toolbox/-/blob/preview/0.0.13/src/filter/lib/adtf_tecmp_base_filter.cpp?ref_type=heads#L259
Here by ProcessPayload
you can check this status/flag and reset a container:
https://gitlab.com/digitalwerk/solutions/adtf_content/adtf_toolboxes/adtf_tecmp_toolbox/-/blob/preview/0.0.13/src/filter/logging_stream/adtf_tecmp_logging_stream_filter.cpp?ref_type=heads#L55
if (isWrongOrder): {m_oSegmentationHandler->ResetReassemblers()}// ResetReassemblers is not exist
return(m_oSegmentationHandler->Append(...);
The container/map is located here:
https://gitlab.com/digitalwerk/solutions/adtf_content/adtf_toolboxes/adtf_tecmp_toolbox/-/blob/preview/0.0.13/src/lib/tecmp-toolbox-segmentation/include/tecmp-toolbox-segmentation/tecmp_segmentation_handler.h?ref_type=heads#L25
*It is only a quick and dirty not tested solution. Probably there is a better one.