diff --git a/src/confd/yang/confd/infix-ntp.yang b/src/confd/yang/confd/infix-ntp.yang index 19addf89..9a2582b8 100644 --- a/src/confd/yang/confd/infix-ntp.yang +++ b/src/confd/yang/confd/infix-ntp.yang @@ -33,8 +33,10 @@ module infix-ntp { description "Add stratumweight to NTP server configuration. Allows tuning the weight of stratum in NTP source selection - relative to measured distance. Setting to 0.0 ensures lower - stratum sources are always preferred regardless of distance."; + relative to measured distance. Higher values give more preference + to lower-stratum sources; use 1.0 to guarantee stratum-based + selection on local networks. Setting to 0.0 disables stratum + weighting (pure distance-based selection)."; reference "internal"; } @@ -75,13 +77,19 @@ module infix-ntp { description "Weight of stratum in NTP source selection relative to measured distance. - A one-stratum difference counts as this many seconds of additional - distance when comparing candidates. + Each stratum level adds this many seconds of effective distance when + comparing candidates. Higher values give more preference to lower-stratum + sources. - The default (0.001 = 1ms) means stratum only wins when distance - differences are less than 1ms. Setting it to 0.0 ensures that a - lower-stratum source is always preferred over a higher-stratum source, - regardless of their measured distances."; + The default (0.001 = 1ms per stratum level) is suitable for most networks. + On a LAN where all servers have similar round-trip times, a lower-stratum + source wins unless its synchronization distance degrades (e.g., due to + missed polls) by more than this amount. + + Use 1.0 or larger to guarantee stratum-based selection on local networks + regardless of transient distance fluctuations. Setting it to 0.0 disables + stratum weighting; selection is then based purely on measured + synchronization distance."; } container makestep { diff --git a/src/confd/yang/confd/infix-system.yang b/src/confd/yang/confd/infix-system.yang index 16c8de18..3e60a5b8 100644 --- a/src/confd/yang/confd/infix-system.yang +++ b/src/confd/yang/confd/infix-system.yang @@ -32,8 +32,10 @@ module infix-system { description "Add stratumweight to NTP client configuration. Allows tuning the weight of stratum in NTP source selection - relative to measured distance. Setting to 0.0 ensures lower - stratum sources are always preferred regardless of distance."; + relative to measured distance. Higher values give more preference + to lower-stratum sources; use 1.0 to guarantee stratum-based + selection on local networks. Setting to 0.0 disables stratum + weighting (pure distance-based selection)."; reference "internal"; } @@ -327,13 +329,19 @@ module infix-system { description "Weight of stratum in NTP source selection relative to measured distance. - A one-stratum difference counts as this many seconds of additional - distance when comparing candidates. + Each stratum level adds this many seconds of effective distance when + comparing candidates. Higher values give more preference to lower-stratum + sources. - The default (0.001 = 1ms) means stratum only wins when distance - differences are less than 1ms. Setting it to 0.0 ensures that a - lower-stratum source is always preferred over a higher-stratum source, - regardless of their measured distances."; + The default (0.001 = 1ms per stratum level) is suitable for most networks. + On a LAN where all servers have similar round-trip times, a lower-stratum + source wins unless its synchronization distance degrades (e.g., due to + missed polls) by more than this amount. + + Use 1.0 or larger to guarantee stratum-based selection on local networks + regardless of transient distance fluctuations. Setting it to 0.0 disables + stratum weighting; selection is then based purely on measured + synchronization distance."; } } diff --git a/test/case/ntp/client_stratum_selection/test.py b/test/case/ntp/client_stratum_selection/test.py index 073d4a7e..f52be546 100755 --- a/test/case/ntp/client_stratum_selection/test.py +++ b/test/case/ntp/client_stratum_selection/test.py @@ -107,7 +107,7 @@ with infamy.Test() as test: "system": { "ntp": { "enabled": True, - "infix-system:stratum-weight": 0.0, + "infix-system:stratum-weight": 1.0, "server": [{ "name": "srv1", "udp": {