Previous  Top  Next

Windows Time Server

3.4.6 Primary-Clock Procedure

When a primary reference source such as a radio clock is connected to the host, it is convenient to incorporate its information into the data base as if the clock were represented as an ordinary peer. In the primary-clock procedure the clock is polled once a minute or so and the returned timecode used to produce a new update for the local clock. When peer.timer decrements to zero for a primary clock peer, the transmit procedure is not called; rather, the radio clock is polled, usually using an ASCII string specified for this purpose. When a valid timecode is received from the radio clock, it is converted to NTP timestamp format and the peer variables updated. The value of peer.leap is set depending on the status of the leap-warning bit in the timecode, if available, or manually by the operator. The value for peer.peeraddr, which will become the value of sys.refid when the clock-update procedure is called, is set to an ASCII string describing the clock type (see Appendix A).

begin primary-clock-update procedure
       peer.leap <-- "from" radio or operator;                              /* copy variables */
       peer.peeraddr <-- ASCII identifier;
       peer.rec <-- radio timestamp;
       peer.reach <-- 1;
       call clock-filter(sys.clock - peer.rec, 0 , 1 << peer.precision);          /* process sample */
       call clock-update;                                                             /* update local clock */
end primary-clock-update procedure;