Skip to content

ASDM: Drift Tracking#18

Open
ws-intel wants to merge 6 commits intointel-staging:mainfrom
ws-intel:dev/ASDM_P2P
Open

ASDM: Drift Tracking#18
ws-intel wants to merge 6 commits intointel-staging:mainfrom
ws-intel:dev/ASDM_P2P

Conversation

@ws-intel
Copy link
Copy Markdown

@ws-intel ws-intel commented Mar 4, 2026

Introduce new drift tracking feature based on IEEE Std 802.1AS™‐2025

@ws-intel ws-intel changed the title Drift Tracking (WIP) ASDM: Drift Tracking Mar 6, 2026
ws-intel added 6 commits March 6, 2026 16:02
Introduces an option to enable drift tracking support for IEEE Std 802.1ASdm.

Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com>
Introduce a dedicated TLV structure to support drift tracking in time
synchronization protocols. This new TLV will enables precise encapsulation and
communication of drift tracking data between protocol entities, facilitating
improved synchronization diagnostics and interoperability.

Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com>
Enable the drift_tracking feature for P2P network. This feature enables
comprehensive monitoring and reporting of clock drift for P2P network, enhancing
synchronization accuracy and system diagnostics.

Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com>
This patch introduce the nrrSync which utilizing the information in
drift_tracking TLV to calculate the neigbor rate ratio. Now user have the
alternative to choose between using the nrrPdelay or nrrSync based on
nrrCompMethodfor clock rate adjustment.

The nrrSync is expected to be more accurate as it is based on the sync message
which is more frequent than pdelay, but it also might be more noisy as it is
more sensitive to timestamping error. The nrrPdelay is expected to be more
stable but might be less accurate as it is based on the pdelay message which is
less frequent than sync.

Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com>
Signed-off-by: Goh, Wei Sheng <wei.sheng.goh@intel.com>
Comment thread config.c Outdated
@ws-intel
Copy link
Copy Markdown
Author

ws-intel commented Apr 6, 2026

Help needed to review the NRR calculation and implementation. Thanks.

Comment thread clock.c Outdated
Comment thread clock.c Outdated
Comment thread port.c Outdated
Comment thread port_private.h Outdated
Comment thread tlv.h Outdated
Comment thread tmv.h Outdated
Comment thread config.c
Comment thread clock.c Outdated
Comment thread port.c Outdated
/* Calculate nrrSync */
tmv_t t1, t1c;
t1 = extended_to_tmv(&dt->syncEgressTimestamp);
t1c = tmv_add(t1, correction_to_tmv(p->asymmetry)); // do we need to add asymmetry here?
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: nrrSync need to add asymmetry/correction or not?

Comment thread port.c Outdated
Comment thread port.c Outdated
n->ratio_valid = 1;
}

void port_nrate_sync_calculate(struct port *p, tmv_t origin, tmv_t ingress)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All: Help needed to evaluate the nrrSync calculation, the flow where nrrSync is calculate at the right place? and does it implemented correctly?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to Peter - check the nrrSync calc and flow implement correct or not?

Comment thread port.c Outdated
Comment thread port.c Outdated
Comment thread port.c Outdated
Comment thread port.c
Comment thread port.c Outdated
if (clock_drift_tracking(p->clock)) {
struct drift_tracking_tlv *dt = drift_tracking_extract(m);
clock_drift_tracking_update(p->clock, dt);
/* Calculate nrrSync */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same doubt. How can you determine the last hwts is timestamp of the corresponding sync msg of this FUP msg? Please rethink whether the nrrSync calculation should be done in process_follow_up().

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to WS - consider to move to port_syfufsm

Comment thread port.c Outdated
/* Calculate nrrSync */
tmv_t t1, t1c;
t1 = extended_to_tmv(&dt->syncEgressTimestamp);
t1c = tmv_add(t1, correction_to_tmv(p->asymmetry)); // Q: do we need to add asymmetry/correction?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the nrrSync asymmetry used the same value p->asymmetry?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to All - recheck

Comment thread port.c Outdated
t1c = tmv_add(t1, correction_to_tmv(p->asymmetry)); // Q: do we need to add asymmetry/correction?
pr_debug("%s: t1=%" PRId64 ", asymmetry=%" PRId64 ", t1c=%" PRId64, p->log_name,
tmv_to_nanoseconds(t1), tmv_to_nanoseconds(correction_to_tmv(p->asymmetry)), tmv_to_nanoseconds(t1c));
if (dt && p->nrrCompMethod == SYNC) // Q: if no dt tlv do we still calculate nrrSync?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If dt tlv is not available, there will be missing info needed for nrrSync calculation, example syncEgressTimestamp.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to WS - reconfirm the missing info

Comment thread port.c Outdated

tsproc_set_clock_rate_ratio(p->tsproc, p->nrate.ratio *
clock_rate_ratio(p->clock));
double nrr = (p->nrrCompMethod == SYNC && clock_drift_tracking(p->clock)) ?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to AS2025, "11.2 State machines for MD entity specific to full-duplex point-to-point links", the nrrCompMethod should be handle in the syncReceive state machine (MDSyncReceiveSM). This make sense as sync msg is sending more frequent compare to Pdelay msg. if nrrSync is selected, do not update the clock_rate_ratio here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to all - recheck

Comment thread port.c Outdated
Comment thread port_private.h Outdated
int inhibit_delay_req;
/* portDS */
struct PortIdentity portIdentity;
Enumeration8 nrrCompMethod;
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AR to WS - change to Enu1

Comment thread port.c
if (clock_drift_tracking(p->clock)) {
struct drift_tracking_tlv *dt = drift_tracking_extract(m);
clock_drift_tracking_update(p->clock, dt);
// Q: Do we want to direct return when no dt? or change the nrrcompmethod to nrrpdelay? else nrr will be some invalid value to adjust the tsproc?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open discussion: if driftTrackingTlvSupport is TRUE and nrrCompMethod is Sync, but no drift_tracking_tlv is received, do we still need calculate nrrSync and nrrSync will be used?

Comment thread port.c
tmv_t origin, corrected_origin;

origin = extended_to_tmv(&dt->syncEgressTimestamp);
corrected_origin = tmv_add(origin, correction_to_tmv(p->asymmetry)); // Q: do we need to add asymmetry/correction?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo yes, as mentioned, "(C) CMLDS delayAsymmetry (i.e., cmldsLinkPort.delayAsymmetry, see 10.2.5.9) if CMLDS is provided, otherwise instance-specific delayAsymmetry (i.e., portDS.delayAsymmetry, see 14.10.11) divided by rateRatio (see 10.2.8.1.4)."
so p->asymmetry here i assume is from CMLDS? how about if without CMLDS, do we need to handle?

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