Yo Eric! On Sun, 23 Apr 2017 20:00:33 -0400 "Eric S. Raymond" <[email protected]> wrote:
> Gary E. Miller <[email protected]>: > > Yo Eric! > > > > On Sun, 23 Apr 2017 17:44:20 -0400 > > "Eric S. Raymond" <[email protected]> wrote: > > > > > Achim Gratz <[email protected]>: > > > > I don't think ntpd needs to do any pivoting _except_ at startup > > > > time, where it is unavoidable and it should attempt to do > > > > anything after it has started up. > > > > > > Huh? Potentially you need to apply a pivot to every packet that > > > comes in; different sources could even have different epochs. > > > > Not really. 2s complement fixes it for packet up to many years > > apart. Remember, all ntpd uses, after the first time, is time > > deltas. > > I don't understand this remark. We're being shipped timestamps from > upstream, not merely deltas. Yes, but when we subtract from our local time, truncated to an l_fp, and 2s complement, we end up with a delta on local time. Once we get runnning, any delta past 'gate' is thrown away. That gate, by default is just 1,000 seconds. So. after the first big correction, we KNOW the delta is 1,000 seconds or less and 2s complement arithmetic over the epoch rollever is fine. I'd be happy to create some test cases showing the effect. But to really use them we'll need hooks into that area of ntpd. But for example on these dates: NTP Epoch NTP Era NTP Datestamp 1 Jan 1900 0 0 0 27 Feb 2036 0 1 0x100000000 So at the roll over, any time greater than 1,000 seconds in the past or the future will be rejected. The only acceptable time stamps will be between: NTP Epoch EPOCH - 1,000 sec 0x3e8 EPOCH + 1,000 sec 0xfffffc18 Plug those into the hex calculator of you choice and you can see that subtracting thos from zero very neatly give you a plain and simple offset as an l_fp. Subtract 0x3e8 from zero and you get 0xfffffca8, which is conventiently the offset of -1,000 seconds. Feel free to compute the other permutations. > > > Instead of trying to use this for precise time, we could try > > > using a Date just at startup to figure out what era we are in. > > > > Except for ntpd that is not net connected. A more common condition > > than I would have thought. > > I want to make that case work better too. Doesn't mean this couldn't > be useful to a normal client-only setup. Diconnected is the hard case, get that right and the others are already done. RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 [email protected] Tel:+1 541 382 8588 Veritas liberabit vos. -- Quid est veritas? "If you can’t measure it, you can’t improve it." - Lord Kelvin
pgpV1Tb1wEIoE.pgp
Description: OpenPGP digital signature
_______________________________________________ devel mailing list [email protected] http://lists.ntpsec.org/mailman/listinfo/devel
