[core] Fixed getTsbPdTimeBase: carryover within 2 wrapping periods #2043
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The refactoring in PR #1968 had removed TSBPD base update on incoming ACKACK control packet used for drift tracing.
At the same time
CTsbpdTime::getTsbPdTimeBase(uint32_t timestamp_us)
while in wrapping-aware state was only tracking for packet timestamps below the value ofTSBPD_WRAP_PERIOD
(30 s).The wrapping period itself ends once a data packet with a timestamp in range
[TSBPD_WRAP_PERIOD; 2 * TSBPD_WRAP_PERIOD]
is received.All these lead to an issue when an ACKACK packet with TS
30.000001
s arrives: the time base is not updated (like before), and the TS is already higher thanTSBPD_WRAP_PERIOD
, meaning that carryover correction is not applied.This PR increases the carryover-applicable range for TS up to
2 * TSBPD_WRAP_PERIOD
ingetTsbPdTimeBase
.Fixes #2041.
Further improvements to timestamp carryover tracing are required. E.g. data sender should track TS carryover based on the incoming ACK packets in case it eventually needs to start receiving data.
Also, idle connections should track TS carryover. See #1936.