[ntp:questions] Ref Clk ID and Leap still valid after sys_peer is lost?
mlawdawg at comcast.net
mlawdawg at comcast.net
Tue May 2 19:31:58 UTC 2006
After my NTP server loses it's sys_peer, it still replies to client
requests using the "stale" sys_stratum, sys_refid, and sys_leap values.
I don't think this is the correct behavior. I think the sys_stratum,
sys_refid, and sys_leap should also be reset when sys_peer is reset to
NULL in peer_clear(). The 4.2.0 code DOES clear the peer->leap,
peer->stratum, and peer->refId, but not their sys_xxx var counterparts.
The sys_refid and sys_leap vars are used when responding to client pkts
and shouldn't contain "stale" values.
When sys_peer is reset to NULL, shouldn't sys_stratum, sys_refid, and
sys_leap be reset also?
I'm essentially arguing for the following source code change to
ntp_proto.c's function peer_clear():
if (peer == sys_peer)
{
sys_peer = NULL;
/* START: also clear these sys_xxx vars */
sys_leap = LEAP_NOTINSYNC;
sys_stratum = STRATUM_UNSPEC;
memcpy(&sys_refid, ident, 4);
sys_peer_refid = 0;
/* END: also clear these sys_xxx vars */
}
Cmts?
In my configuration, client A is configured to use ONLY server B.
Server B is configured to use ONLY server C. Server C has a GPS
directly connected. In my test, after all nodes are synchronized, I
turn off Server C. After 5 polls, Server B reports it's sys_peer is
unreachable and clears it's sys_peer variable.
I'm running 4.2.0.
Tx,
Mark
Here are Server B's sys vars after it found server C (which is also the
sys_peer) unreachable.
11-> sys_peer
sys_peer = 0x0
OK, no more sys_peer.
11-> sys_refid
sys_refid = 0xde02a8c0 ===> 192.168.2.222
Stale value. We don't have a sys_peer right now.
11-> sys_stratum
sys_stratum = 0x3
Stale value. We don't have a sys_peer right now. I think value should
be 16 (STRATUM_UNSPEC)
11-> sys_leap
sys_leap = 0x0
Stale value. We don't have a sys_peer right now. 0 means OK. I think
leap should say 3 (LEAP_NOTINSYNC).
11-> sys_peer_refid
sys_peer_refid = 0xde02a8c0
Stale value. We don't have a sys_peer right now.
Here's ntpq output on Server B after it found server C (which is also
the sys_peer) unreachable.
ntpq> pe
remote refid st t when poll reach delay offset
jitter
==============================================================================
192.168.2.222 .INIT. 16 - 39m 1024 0 0.000 0.000
4000.00
ntpq> as
ind assID status conf reach auth condition last_event cnt
===========================================================
1 17797 a023 yes yes none reject lost reach 2
ntpq> rv 17797
status=a023 unreach, conf, 2 events, event_unreach,
srcadr=192.168.2.222, srcport=123, dstadr=0.0.0.0, dstport=123,
leap=11,
stratum=16, precision=-13, rootdelay=0.000, rootdispersion=0.000,
refid=INIT, reach=000, unreach=9, hmode=3, pmode=4, hpoll=10, ppoll=10,
flash=00 ok, keyid=0, ttl=0, offset=0.000, delay=0.000,
dispersion=0.000, jitter=4000.000,
reftime=c8022093.4f7e6c07 Tue, May 2 2006 18:16:51.310,
org=00000000.00000000 Thu, Feb 7 2036 6:28:16.000,
rec=00000000.00000000 Thu, Feb 7 2036 6:28:16.000,
xmt=c80229cb.bef8cb00 Tue, May 2 2006 18:56:11.745,
filtdelay= 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00,
filtoffset= 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.00,
filtdisp= 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0 16000.0
16000.0
More information about the questions
mailing list