home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 900s / rfc957.txt < prev    next >
Text File  |  1992-09-21  |  69KB  |  1,539 lines

  1.  
  2. Network Working Group                                         D.L. Mills
  3. Request for Comments: 957                               M/A-COM Linkabit
  4.                                                           September 1985
  5.  
  6.               Experiments in Network Clock Synchronization
  7.  
  8.  
  9. Status of this Memo
  10.  
  11.    This RFC discusses some experiments in clock synchronization in the
  12.    ARPA-Internet community, and requests discussion and suggestions for
  13.    improvements.  Distribution of this memo is unlimited.
  14.  
  15. Table of Contents
  16.  
  17.    1.      Introduction
  18.    2.      Design of the Synchronization Algorithm
  19.    2.1.    The Logical Clock
  20.    2.2.    Linear Phase Adjustments
  21.    2.3.    Nonlinear Phase Adjustments
  22.    3.      Synchronizing Network Clocks
  23.    3.1.    Reference Clocks and Reference Hosts
  24.    3.2.    Distribution of Timing Information
  25.    4.      Experimental Validation of the Design
  26.    4.1.    Experiment Design
  27.    4.2.    Experiment Execution
  28.    4.3.    Discussion of Results
  29.    4.3.1.  On Power-Grid Clocks
  30.    4.3.2.  On Clocks Synchronized via Network Links
  31.    4.3.3.  On the Accuracy of Radio Clocks
  32.    4.3.3.1. The Spectracom 8170 WWVB Radio Clock
  33.    4.3.3.2. The True Time 468-DC GOES Radio Clock
  34.    4.3.3.3. The Heath GC-1000 WWV Radio Clock
  35.    4.3.4.  On Handling Disruptions
  36.    4.4.    Additional Experiments
  37.    5.      Summary and Conclusions
  38.    6.      References
  39.  
  40. List of Figures
  41.  
  42.    Figure 1. Clock Registers
  43.    Figure 2. Network Configuration
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. Mills                                                           [Page 1]
  56.  
  57.  
  58.  
  59. RFC 957                                                   September 1985
  60. Experiments in Network Clock Synchronization
  61.  
  62.  
  63. List of Tables
  64.  
  65.    Table 1. Experiment Hosts
  66.    Table 2. Link Measurements
  67.    Table 3. First Derivative of Delay
  68.    Table 4. GOES Radio Clock Offsets
  69.    Table 5. WWV Radio Clock Offsets
  70.    Table 6. ISI-MCON-GW Clock Statistics
  71.    Table 7. LL-GW Clock Statistics
  72.    Table 8. LL-GW Clock Statistics
  73.  
  74. 1.  Introduction
  75.  
  76.    One of the services frequently neglected in computer network design
  77.    is a high-quality, time-of-day clock capable of generating accurate
  78.    timestamps with small residual errors compared to intrinsic one-way
  79.    network delays.  Such a service would be useful for tracing the
  80.    progress of complex transactions, synchronizing cached data bases,
  81.    monitoring network performance and isolating problems.
  82.  
  83.    Several mechanisms have been specified in the Internet protocol suite
  84.    to record and transmit the time at which an event takes place,
  85.    including the ICMP Timestamp message [6], Time Protocol [7], Daytime
  86.    protocol [8] and IP Timestamp option [9].  A new Network Time
  87.    Protocol [12] has been proposed as well.  Additional information on
  88.    network time synchronization can be found in the References at the
  89.    end of this document.  Synchronization protocols are described in [3]
  90.    and [12] and synchronization algorithms in [2], [5], [10] and [11].
  91.    Experimental results on measured roundtrip delays in the Internet are
  92.    discussed in [4].  A comprehensive mathematical treatment of clock
  93.    synchronization can be found in [1].
  94.  
  95.    Several mechanisms have been specified in the Internet protocol suite
  96.    to record and transmit the time at which an event takes place,
  97.    including the ICMP Timestamp message [6], Time protocol [7], Daytime
  98.    protocol [8] and IP Timestamp option [9].  Issues on time
  99.    synchronization are discussed in [4] and synchronization algorithms
  100.    in [2] and [5].  Experimental results on measured roundtrip delays in
  101.    the Internet are discussed in [2].  A comprehensive mathematical
  102.    treatment of the subject can be found in [1], while an interesting
  103.    discussion on mutual-synchonization techniques can be found in [10].
  104.  
  105.    There are several ways accurate timestamps can be generated.  One is
  106.    to provide at every service point an accurate, machine-readable clock
  107.    synchronized to a central reference, such as the National Bureau of
  108.    Standards (NBS).  Such clocks are readily available in several models
  109.    ranging in accuracies of a few hundred milliseconds to less than a
  110.  
  111.  
  112. Mills                                                           [Page 2]
  113.  
  114.  
  115.  
  116. RFC 957                                                   September 1985
  117. Experiments in Network Clock Synchronization
  118.  
  119.  
  120.    millisecond and are typically synchronized to special ground-based or
  121.    satellite-based radio broadcasts.  While the expense of the clocks
  122.    themselves, currently in the range $300 to $3000, can often be
  123.    justified, all require carefully sited antennas well away from
  124.    computer-generated electromagnetic noise, as well as shielded
  125.    connections to the clocks.  In addition, these clocks can require a
  126.    lengthy synchonization period upon power-up, so that a battery-backup
  127.    power supply is required for reliable service in the event of power
  128.    interruptions.
  129.  
  130.    If the propagation delays in the network are stable or can be
  131.    predicted accurately, timestamps can be generated by a central
  132.    server, equipped with a clock such as described above, in response to
  133.    requests from remote service points.  However, there are many
  134.    instances where the trans-network delay to obtain a timestamp would
  135.    be intolerable, such as when timestamping a message before
  136.    transmission.  In addition, propagation delays are usually not
  137.    predictable with precisions in the order required, due to
  138.    probabilistic queuing and channel-contention delays.
  139.  
  140.    In principle, a clock of sufficient accuracy can be provided at each
  141.    service point using a stable, crystal-controlled clock which is
  142.    corrected from time to time by messages from a central server.
  143.    Suitable inexpensive, crystal-controlled clock interfaces are
  144.    available for virtually any computer.  The interesting problem
  145.    remaining is the design of the synchronization algorithm and protocol
  146.    used to transmit the corrections.  In this document one such design
  147.    will be described and its performance assessed.  This design has been
  148.    incorprated as an integral part of the network routing and control
  149.    protocols of the Distributed Computer Network (DCnet) architecture
  150.    [5], clones of which have been established at several sites in the US
  151.    and Europe.  These protocols have been in use since 1979 and been
  152.    continuously tested and refined since then.
  153.  
  154. 2.  Design of the Synchronization Algorithm
  155.  
  156.    The synchronization algorithm is distributed in nature, with protocol
  157.    peers maintained in every host on the network.  Peers communicate
  158.    with each other on a pairwise basis using special control messages,
  159.    called Hello messages, exchanged periodically over the ordinary data
  160.    links between them.  The Hello messages contain information necessary
  161.    for each host to calculate the delay and offset between the local
  162.    clock of the host and the clock of every other host on the network
  163.    and are also used to drive the routing algorithm.
  164.  
  165.    The synchronization algorithm includes several features to improve
  166.    the accuracy and stability of the local clock in the case of host or
  167.  
  168.  
  169. Mills                                                           [Page 3]
  170.  
  171.  
  172.  
  173. RFC 957                                                   September 1985
  174. Experiments in Network Clock Synchronization
  175.  
  176.  
  177.    link failures.  In following sections the design of the algorithm is
  178.    summarized.  Full design details are given in [5] along with a formal
  179.    description of the Hello protocol.
  180.  
  181. 2.1.  The Logical Clock
  182.  
  183.    In the DCnet model each service point, or host, is equipped with a
  184.    hardware clock, usually in the form of an off-the-shelf interface.
  185.    Using this and software registers, a logical clock is constructed
  186.    including a 48-bit Clock Register, which increments at a 1000 Hz
  187.    rate, a 32-bit Clock-Adjust Register, which is used to slew the Clock
  188.    Register in response to raw corrections received over the net, and a
  189.    Counter Register, which is used in some interface designs as an
  190.    auxilliary counter.  The configuration and decimal point of these
  191.    registers are shown in Figure 1.
  192.  
  193.            Clock Register                                   
  194.  
  195.            0               16               32              
  196.            +---------------+---------------+---------------+
  197.            |               |               |               |
  198.            +---------------+---------------+---------------+
  199.                                            A                
  200.                                      decimal point          
  201.  
  202.            Clock-Adjust Register                            
  203.  
  204.                            0               16               
  205.                            +---------------+---------------+
  206.                            |               |               |
  207.                            +---------------+---------------+
  208.                                            A                
  209.                                      decimal point          
  210.  
  211.            Counter Register                                 
  212.  
  213.                            0              16                
  214.                            +---------------+                
  215.                            |               |                
  216.                            +---------------+                
  217.                                            A                
  218.                                      decimal point          
  219.  
  220.                        Figure 1. Clock Registers
  221.  
  222.    The Clock Register and Clock-Adjust Register are implemented in
  223.    memory.  In typical clock interface designs such as the DEC KMV11-A
  224.  
  225.  
  226. Mills                                                           [Page 4]
  227.  
  228.  
  229.  
  230. RFC 957                                                   September 1985
  231. Experiments in Network Clock Synchronization
  232.  
  233.  
  234.    the Counter Register is implemented in the interface as a buffered
  235.    counter driven by a crystal oscillator.  A counter overflow is
  236.    signalled by an interrupt, which results in an increment of the Clock
  237.    Register at bit 15 and the propagation of carries as required.  The
  238.    time of day is determined by reading the Counter Register, which does
  239.    not disturb its counting process, and adding its value to that of the
  240.    Clock Register with decimal points aligned.
  241.  
  242.    In other interface designs such as the simple LSI-11 event-line
  243.    mechanism, each tick of the clock is signalled by an interrupt at
  244.    intervals of 10, 16-2/3 or 20 ms, depending on interface and clock
  245.    source.  When this occurs the appropriate number of milliseconds,
  246.    expressed to 32 bits in precision, is added to the Clock Register
  247.    with decimal points aligned.
  248.  
  249.    It should be noted at this point that great care in operating system
  250.    design is necessary in order to preserve the full accuracy of
  251.    timestamps with respect to the application program, which must be
  252.    protected from pre-emption, excessive device latencies and so forth.
  253.    In addition, the execution times of all sequences operating with the
  254.    interrupt system disabled must be strictly limited.  Since the PDP11
  255.    operating system most often used in the DCnet (the "Fuzzball"
  256.    operating system) has been constructed with these considerations
  257.    foremost in mind, it has been especially useful for detailed network
  258.    performance testing and evaluation.  Other systems, in particular the
  259.    various Unix systems, have not been found sufficiently accurate for
  260.    this purpose.
  261.  
  262.    Left uncorrected, the host logical clock runs at the rate of its
  263.    intrinsic oscillator, whether derived from a crystal or the power
  264.    frequency.  The correction mechanism uses the Clock-Adjust Register,
  265.    which is updated from time to time as raw corrections are received.
  266.    The corrections are computed using roundtrip delays and offsets
  267.    derived from the routing algorithm, described later in this document,
  268.    which are relatively noisy compared to the precision of the logical
  269.    clock.  A carefully designed smoothing mechansim insures stability,
  270.    as well as isolation from large transients that occur due to link
  271.    retransmissions, host reboots and similar disruptions.
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283. Mills                                                           [Page 5]
  284.  
  285.  
  286.  
  287. RFC 957                                                   September 1985
  288. Experiments in Network Clock Synchronization
  289.  
  290.  
  291. 2.2.  Linear Phase Adjustments
  292.  
  293.    The correction is introduced as a signed 32-bit integer in
  294.    milliseconds.  If the magnitude of the correction is less than 128
  295.    ms, the low-order 16 bits replaces bits 0-15 in the Clock-Adjust
  296.    register. At suitable intervals, depending on the jitter of the
  297.    intrinsic oscillator, the value of this register is divided by a
  298.    fixed value, forming a quotient which is first added to the Clock
  299.    Register, then subtracted from the Clock-Adjust Register.  This
  300.    technique has several advantages:
  301.  
  302.       1.  The clock never runs backwards;  that is, successive
  303.           timestamps always increase monotonically.
  304.  
  305.       2.  In the event of loss of correction information, the clock
  306.           slews to the last correction received.
  307.  
  308.       3.  The rate of slew is proportional to the magnitude of the last
  309.           correction.  This allows rapid settling in case of large
  310.           corrections, but provides high stability in case of small
  311.           corrections.
  312.  
  313.       4.  The sequence of computations preserves the highest precision
  314.           and minimizes the propagation of round-off errors.
  315.  
  316.    Experience has indicated the choice of 256 as appropriate for the
  317.    dividend above, which yields a maximum slew-rate magnitude less than
  318.    0.5 ms per adjustment interval and a granularity of about 2.0
  319.    microseconds, which is of the same order as the intrinsic tolerance
  320.    of the crystal oscillators used in typical clock interfaces.  In the
  321.    case of crystal-derived clocks, an adjustment interval of four
  322.    seconds has worked well, which yields a maximum slew-rate magnitude
  323.    of 125 microseconds per second.  In the case of power-frequency
  324.    clocks or especially noisy links, the greatly increased jitter
  325.    requires shorter adjustment intervals in the range of 0.5 second,
  326.    which yields a maximum slew-rate magnitude of 1.0 ms per second.
  327.  
  328.    In most cases, independent corrections are generated over each link
  329.    at intervals of 30 seconds or less.  Using the above choices a single
  330.    sample error of 128 ms causes an error at the next sample interval no
  331.    greater than about 7.5 ms with the longer adjustment interval and 30
  332.    ms with the shorter.  The number of adjustment intervals to reduce
  333.    the residual error by half is about 177, or about 12 minutes with the
  334.    longer interval and about 1.5 minutes with the shorter.  This
  335.    completely characterizes the linear dynamics of the mechanism.
  336.  
  337.  
  338.  
  339.  
  340. Mills                                                           [Page 6]
  341.  
  342.  
  343.  
  344. RFC 957                                                   September 1985
  345. Experiments in Network Clock Synchronization
  346.  
  347.  
  348. 2.3.  Nonlinear Phase Adjustments
  349.  
  350.    When the magnitude of the correction exceeds 128 ms, the possiblity
  351.    exists that the clock is so far out of synchronization with the
  352.    reference host that the best action is an immediate and wholesale
  353.    replacement of Clock Register contents, rather than a graduated
  354.    slewing as described above.  In practice the necessity to do this is
  355.    rare and occurs when the local host or reference host is rebooted,
  356.    for example. This is fortunate, since step changes in the clock can
  357.    result in the clock apparently running backward, as well as incorrect
  358.    delay and offset measurements of the synchronization mechanism
  359.    itself.
  360.  
  361.    However, it sometimes happens that, due to link retransmissions or
  362.    occasional host glitches, a single correction sample will be computed
  363.    with magnitude exceeding 128 ms.  In practice this happens often
  364.    enough that a special procedure has been incorporated into the
  365.    design.  If a sample exceeding the limit is received, its value is
  366.    saved temporarily and does not affect the Clock-Adjust Register.  In
  367.    addition, a timer is initialized, if not already running, to count
  368.    down to zero in a specified time, currently 30 seconds.
  369.  
  370.    If the timer is already running when a new correction sample with
  371.    magnitude exceeeding 128 ms arrives, its value and the saved sample
  372.    value are averaged with equal weights to form a new saved sample
  373.    value. If a new correction sample arrives with magnitude less than
  374.    128 ms, the timer is stopped and the saved sample value discarded.
  375.    If the timer counts down to zero, the saved sample value replaces the
  376.    contents of the Clock Register and the Clock-Adjust Register is set
  377.    to zero.  This procedure has the effect that occasional spikes in
  378.    correction values are discarded, but legitimate step changes are
  379.    prefiltered and then used to reset the clock after no more than a
  380.    30-second delay.
  381.  
  382. 3.  Synchronizing Network Clocks
  383.  
  384.    The algorithms described in the previous section are designed to
  385.    achieve a high degree of accuracy and stability of the logical clocks
  386.    in each participating host.  In this section algorithms will be
  387.    described which synchronize these logical clocks to each other and to
  388.    standard time derived from NBS broadcasts.  These algorithms are
  389.    designed to minimize the cumulative errors using linear synchronizing
  390.    techniques. See [10] for a discussion of algorithms using nonlinear
  391.    techniques.
  392.  
  393.  
  394.  
  395.  
  396.  
  397. Mills                                                           [Page 7]
  398.  
  399.  
  400.  
  401. RFC 957                                                   September 1985
  402. Experiments in Network Clock Synchronization
  403.  
  404.  
  405. 3.1.  Reference Clocks and Reference Hosts
  406.  
  407.    The accuracy of the entire network of logical clocks depends on the
  408.    accuracy of the device used as the reference clock.  In the DCnet
  409.    clones the reference clock takes the form of a precision crystal
  410.    oscillator which is synchronized via radio or satellite with the NBS
  411.    standard clocks in Boulder, CO.  The date and time derived from the
  412.    oscillator can be sent continuously or read upon command via a serial
  413.    asynchronous line.  Stand-alone units containing the oscillator,
  414.    synchronizing receiver and controlling microprocessor are available
  415.    from a number of manufacturers.
  416.  
  417.    The device driver responsible for the reference clock uses its
  418.    serial-line protocol to derive both an "on-time" timestamp relative
  419.    to the logical clock of the reference host and an absolute time
  420.    encoded in messages sent by the clock.  About once every 30 seconds
  421.    the difference between these two quantities is calculated and used to
  422.    correct the logical clock according to the mechanisms described
  423.    previously.  The corrected logical clock is then used to correct all
  424.    other logical clocks in the network.  Note the different
  425.    nomenclature:  The term "reference clock" applies to the physical
  426.    clock itself, while the term "reference host" applies to the logical
  427.    clock of the host to which it is connected. Each has an individual
  428.    address, delay and offset in synchronizing messages.
  429.  
  430.    There are three different commercial units used as reference clocks
  431.    in DCnet clones.  One of these uses the LF radio broadcasts on 60 KHz
  432.    from NBS radio WWVB, another the HF radio broadcasts on 5, 10 and 15
  433.    MHz from NBS radio WWV or WWVH and the third the UHF broadcasts from
  434.    a GOES satellite.  The WWVB and GOES clocks claim accuracies in the
  435.    one-millisecond range.  The WWV clock claims accuracies in the 100-ms
  436.    range, although actual accuracies have been measured somewhat better
  437.    than that.
  438.  
  439.    All three clocks include some kind of quality indication in their
  440.    messages, although of widely varying detail.  At present this
  441.    indication is used only to establish whether the clock is
  442.    synchronized to the NBS clocks and convey this information to the
  443.    network routing algorithm as described later.  All clocks include
  444.    some provision to set the local-time offset and propagation delay,
  445.    although for DCnet use all clocks are set at zero offset relative to
  446.    Universal Time (UT).  Due to various uncertaincies in propagation
  447.    delay, serial-line speed and interrupt latencies, the absolute
  448.    accuracy of timestamps derived from a reference host equipped with a
  449.    WWVB or GOES reference clock is probably no better than a couple of
  450.    milliseconds.
  451.  
  452.  
  453.  
  454. Mills                                                           [Page 8]
  455.  
  456.  
  457.  
  458. RFC 957                                                   September 1985
  459. Experiments in Network Clock Synchronization
  460.  
  461.  
  462. 3.2.  Distribution of Timing Information
  463.  
  464.    The timekeeping accuracy at the various hosts in the network depends
  465.    critically on the precision whith which corrections can be
  466.    distributed throughout the network.  In the DCnet design a
  467.    distributed routing algorithm is used to determine minimum-delay
  468.    routes between any two hosts in the net.  The algorithms used, which
  469.    are described in detail in [5] and only in outline form here, provide
  470.    reachability and delay information, as well as clock offsets, between
  471.    neighboring hosts by means of periodic exchanges of routing packets
  472.    called Hello messages. This information is then incorporated into a
  473.    set of routing tables maintained by each host and spread throughout
  474.    the network by means of the Hello messages.
  475.  
  476.    The detailed mechanisms to accomplish these functions have been
  477.    carefully designed to minimize timing uncertaincies.  For instance,
  478.    all timestamping is done in the drivers themselves, which are given
  479.    the highest priority for resource access.  The mechanism to measure
  480.    roundtrip delays on the individual links is insensitive to the delays
  481.    inherent in the processing of the Hello message itself, as well as
  482.    the intervals between transmissions.  Finally, care is taken to
  483.    isolate and discard transient timing errors that occur when a host is
  484.    rebooted or a link is restarted.
  485.  
  486.    The routing algorithm uses a table called the Host Table, which
  487.    contains for each host in the network the computed roundtrip delay
  488.    and clock offset, in milliseconds.  In order to separately identify
  489.    each reference clock, if there is more than one in the network, a
  490.    separate entry is used for each clock, as well as each host.  The
  491.    delay and offset fields of the host itself are set to zero, as is the
  492.    delay field of each attached reference clock.  The offset field of
  493.    each attached reference clock is recomputed periodically as described
  494.    above.
  495.  
  496.    Hello messages containing a copy of the Host Table are sent
  497.    periodically to each neighbor host via the individual links
  498.    connecting them.  In the case of broadcast networks the Hello message
  499.    is broadcast to all hosts sharing the same cable.  The Hello message
  500.    also contains a timestamp inserted at the time of transmission, as
  501.    well as information used to accurately compute the roundtrip delay on
  502.    point-to-point links.
  503.  
  504.    A host receiving a Hello message processes the message for each host
  505.    in turn, including those corresponding to the reference clocks.  It
  506.    adds the delay field in the message to the previously determined
  507.    roundtrip link delay and compares this with the entry already in its
  508.    Host Table.  If the sum is greater than the delay field in the Host
  509.  
  510.  
  511. Mills                                                           [Page 9]
  512.  
  513.  
  514.  
  515. RFC 957                                                   September 1985
  516. Experiments in Network Clock Synchronization
  517.  
  518.  
  519.    Table, nothing further is done.  If the sum is less, an update
  520.    procedure is executed.  The update procedure, described in detail in
  521.    [5], causes the new delay to replace the old and the routing to be
  522.    amended accordingly.
  523.  
  524.    The update procedure also causes a new correction sample to be
  525.    computed as the difference between the timestamp in the Hello message
  526.    and the local clock, which is used to correct the local clock as
  527.    described above.  In addition, the sum of this correction sample plus
  528.    the offset field in the Hello message replaces the offset field in
  529.    the Hello Table.  The effect of these procedures is that the local
  530.    clock is corrected relative to the neighbor clock only if the
  531.    neighbor is on the path of least delay relative to the selected
  532.    reference clock.  If there is no route to the reference clock, as
  533.    determined by the routing algorithm, no corrections are computable
  534.    and the local clock free-runs relative to the last received
  535.    correction.
  536.  
  537.    As the result of the operation of the routing algorithm, all local
  538.    clocks in the network will eventually stabilize at a constant offset
  539.    relative to the reference clock, depending upon the drift rates of
  540.    the individual oscillators.  For most applications the offset is
  541.    small and can be neglected.  For the most precise measurements the
  542.    computed offset in the Host Table entry associated with any host,
  543.    including the reference clock, can be used to adjust the apparent
  544.    time relative to the local clock of that host.  However, since the
  545.    computed offsets are relatively noisy, it is necessary to smooth them
  546.    using some algorithm depending upon application.  For this reason,
  547.    the computed offsets are provided separately from the local time.
  548.  
  549. 4.  Experimental Validation of the Design
  550.  
  551.    The original DCnet was established as a "port expander" net connected
  552.    to an ARPAnet IMP in 1978.  It was and is intended as an experimental
  553.    testbed for the development of protocols and measurement of network
  554.    performance.  Since then the DCnet network-layer protocols have
  555.    evolved to include multi-level routing, logical addressing,
  556.    multicasting and time synchronization.  Several DCnet clones have
  557.    been established in the US and Europe and connected to the DARPA
  558.    Internet system.  The experiments described below were performed
  559.    using the DCnet clone at Linkabit East, near Washington, DC, and
  560.    another at Ford Motor Division, near Detroit, MI.  Other clones at
  561.    Ford Aerospace and the Universities of Maryland and Michigan were
  562.    used for calibration and test, while clones at various sites in
  563.    Norway and Germany were used for occasional tests.  Additional
  564.  
  565.  
  566.  
  567.  
  568. Mills                                                          [Page 10]
  569.  
  570.  
  571.  
  572. RFC 957                                                   September 1985
  573. Experiments in Network Clock Synchronization
  574.  
  575.  
  576.    ARPANET gateways of the WIDEBAND/EISN satellite system were also
  577.    included in the experiments in order to determine the feasability of
  578.    synchronizing clocks across the ARPANET.
  579.  
  580.    There were four principal issues of interest in the experiments:
  581.  
  582.       1.  What are the factors affecting accuracy of a network of clocks
  583.           using the power grid as the basic timing source, together with
  584.           corrections broadcast from a central point?
  585.  
  586.       2.  What are the factors affecting accuracy of a network of clocks
  587.           synchronized via links used also to carry ordinary data.
  588.  
  589.       3.  How does the accuracy of the various radio clocks - WWVB, GOES
  590.           and WWV compare?
  591.  
  592.       4.  What is the best way to handle disruptions, such as a leap
  593.           second?
  594.  
  595.    These issues will be discussed in turn after presentation of the
  596.    experiment design and execution.
  597.  
  598. 4.1.  Experiment Design
  599.  
  600.    Figure 2 shows the configuration used in a series of tests conducted
  601.    during late June and early July of 1985.  The tests involved six
  602.    hosts, three reference clocks and several types of communication
  603.    links.  The tests were designed to coincide with the insertion of a
  604.    leap second in the standard time broadcast by NBS, providing an
  605.    interesting test of system stability in the face of such disruptions.
  606.    The test was also designed to test the feasability of using the power
  607.    grid as a reference clock, with corrections broadcast as described
  608.    above, but not used to adjust the local clock.
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625. Mills                                                          [Page 11]
  626.  
  627.  
  628.  
  629. RFC 957                                                   September 1985
  630. Experiments in Network Clock Synchronization
  631.  
  632.  
  633.       ARPAnet                              |                      
  634.       - - - - - - - - - - - - - - - - - -  |  - - - - - - - - - - 
  635.                                        56K |                      
  636.       +---------+     +---------+     +----+----+ 1.2 +---------+ 
  637.       |   WWV   | 1.2 |         | 4.8 |         +-----+  WWVB   | 
  638.       |  radio  +-----+  DCN6   +-----+  DCN1   |async|  radio  | 
  639.       |  clock  |async|         |DDCMP|         +--+  |  clock  | 
  640.       +---------+     +---------+     +----+----+  |  +---------+ 
  641.                        Ethernet            |       |              
  642.       DCnet     ===o===============o=======o===    | 1822/DH      
  643.                    |               |               |              
  644.               +----+----+     +----+----+     +----+----+         
  645.       power   |         |     |         |     |         |    power
  646.       freq <--+  DCN3   |     |  DCN5   |     |  DCN7   +--> freq 
  647.       60 Hz   |         |     |         |     |         |    60 Hz
  648.               +---------+     +----+----+     +---------+         
  649.                                9.6 |                              
  650.       - - - - - - - - - - - - - -  |  - - - - - - - - - - - - - - 
  651.                                    | DDCMP                        
  652.                               +----+----+     +---------+         
  653.                               |         | 1.2 |  GOES   |         
  654.       FORDnet                 |  FORD1  +-----+satellite|         
  655.                               |         |async|  clock  |         
  656.                               +---------+     +---------+         
  657.  
  658.                     Figure 2. Network Configuration
  659.  
  660.    Only those hosts and links directly participating in the tests are
  661.    shown in Figure 2.  All hosts shown operate using the DCnet protocols
  662.    and timekeeping algorithms summarized in this document and detailed
  663.    in [5].  The DCnet hosts operate as one self-contained net of the
  664.    Internet systems, while the FORDnet hosts operate as another with
  665.    distinct net numbers.  The gateway functions connecting the two nets
  666.    are distributed in the DCN5 and FORD1 hosts and the link connecting
  667.    them.  This means that, although the clock offsets of individual
  668.    DCnet hosts are visible to other DCnet hosts and the clock offsets of
  669.    individual FORDnet hosts are visible to other FORDnet hosts, only the
  670.    clock offset of the gateway host on one net is visible to hosts on
  671.    the other net.
  672.  
  673.    In Figure 2 the links are labelled with both the intrinsic speed, in
  674.    kilobits per second, as well as the link protocol type.  The DDCMP
  675.    links use microprocessor-based DMA interfaces that retransmit in case
  676.    of message failure.  The 1822/DH link connecting DCN1 and DCN7
  677.    operates at DMA speeds over a short cable.  The Ethernet link uses
  678.  
  679.  
  680.  
  681.  
  682. Mills                                                          [Page 12]
  683.  
  684.  
  685.  
  686. RFC 957                                                   September 1985
  687. Experiments in Network Clock Synchronization
  688.  
  689.  
  690.    DMA interfaces that retransmit only in case of collisions.  The
  691.    asynchronous links are used only to connect the reference clocks to
  692.    the hosts over a short cable.
  693.  
  694.    While all hosts and links were carrying normal traffic throughout the
  695.    test period, the incidence of retransmissions was very low, perhaps
  696.    no more than a few times per day on any link.  However, the DDCMP
  697.    link protocol includes the use of short control messages exhanged
  698.    between the microprocessors about once per second in the absence of
  699.    link traffic. These messages, together with retransmissions when they
  700.    occur, cause small uncertaincies in Hello message delays that
  701.    contribute to the total measurement error.  An additional uncertaincy
  702.    (less than 0.5 per-cent on average) in Hello message length can be
  703.    introduced when the link protocol makes use of character-stuffing or
  704.    bit-stuffing techniques to achieve code transparency, such as with
  705.    the LAPB link-level protocol of X.25.  However, the particular links
  706.    used in the tests use a count field in the header, so that no
  707.    stuffing is required.
  708.  
  709.    Although the timekeeping algorithms have been carefully designed to
  710.    be insensitive to traffic levels, it sometimes happens that an
  711.    intense burst of traffic results in a shortage of memory buffers in
  712.    the various hosts.  In the case of the Ethernet interfaces, which
  713.    have internal buffers, this can result in additional delays while the
  714.    message is held in the interface pending delivery to the host.
  715.    Conditions where these delays become significant occur perhaps once
  716.    or twice a day in the present system and were observed occasionally
  717.    during the tests.  As described above, the correction-sample
  718.    processing incorporates a filtering procedure that discards the vast
  719.    majority of glitches due to this and other causes.
  720.  
  721. 4.2.  Experiment Execution
  722.  
  723.    The series of experiments conducted in late June and early July of
  724.    1985 involved collecting data on the delays and offsets of the six
  725.    hosts and three reference clocks shown in Figure 2.  In order to
  726.    accomplish this, a special program was installed in a Unix 4.2bsd
  727.    system connected to the Ethernet link but not shown in Figure 2.  The
  728.    program collected each 128-octet Hello message broadcast from DCN1
  729.    every 16 seconds and appended it bit-for-bit to the data base.  The
  730.    total volume of raw data collected amounted to almost 0.7 megabyte
  731.    per day.
  732.  
  733.    The raw Hello-message data were processed to extract only the
  734.    timestamp and measured clock offsets for the hosts shown in Table 1
  735.    and then reformatted as an ASCII file, one line per Hello message.
  736.  
  737.  
  738.  
  739. Mills                                                          [Page 13]
  740.  
  741.  
  742.  
  743. RFC 957                                                   September 1985
  744. Experiments in Network Clock Synchronization
  745.  
  746.  
  747.         Host    Clock   Drift   Experiment Use                 
  748.         Name    ID      (ppm)                                  
  749.         ------------------------------------------------------ 
  750.         DCN1    WWVB    -2.5    WWVB reference host            
  751.         DCN3    -       60-Hz   power-grid (unlocked)          
  752.         DCN5    DCN1    6.8     Ethernet host                  
  753.         DCN6    DCN1    -1.7    DDCMP host, WWV reference host 
  754.         DCN7    DCN1    60-Hz   power-grid (locked)            
  755.         FORD1   GOES    17.9    GOES reference host            
  756.         WWV     -       -       WWV reference clock            
  757.         WWVB    -       -       WWVB reference clock           
  758.  
  759.                        Table 1. Experiment Hosts
  760.  
  761.    In Table 1 the Clock ID column shows the reference host selected as
  762.    the master clock for each host shown.  In this particular
  763.    configuration host DCN1 was locked to host WWVB, while hosts DCN5,
  764.    DCN6 and DCN7 were locked to DCN1.  Although the offset of GOES can
  765.    not be directly determined from the Hello messages exchanged between
  766.    DCnet and FORDnet hosts, the offset of FORD1 relative to GOES was
  767.    determined by observation to be in the order of a millisecond, so for
  768.    all practical purposes the offset of FORD1 represents the offset of
  769.    GOES.  In addition, since the WWVB clock was considered by experience
  770.    the most accurate and reliable and the offset of DCN1 relative to
  771.    WWVB was negligible, DCN1 was considered the reference clock with
  772.    offset zero relative to the NBS clocks.
  773.  
  774.    During the setup phase of the experiments the intrinsic drift rates
  775.    of the crystal oscillators in the four hosts DCN1, DCN5, DCN6 and
  776.    FORD1 equipped with them was measured as shown in the "Drift" column
  777.    in Table 1.  The two hosts DCN3 and DCN7 are equipped with
  778.    line-frequency clocks. For experimental purposes DCN3 was unlocked
  779.    and allowed to free-run at the line-frequency rate, while DCN7
  780.    remained locked.
  781.  
  782.    An ASCII file consisting of about 0.2 megabyte of reformatted data,
  783.    was collected for each Universal-Time (UT) day of observation
  784.    beginning on 28 June and continuing through 8 July.  Each file was
  785.    processed by a program that produces an eight-color display of
  786.    measured offsets as a function of time of observation.  Since the
  787.    display technique uses a bit-map display and each observation
  788.    overwrites the bit-map in an inclusive-OR fashion, the sample
  789.    dispersion is immediately apparent. Over eight samples per pixel on
  790.    the time axis are available in a 24-hour collection period.  On the
  791.    other hand, the fine granularity of almost four samples per minute
  792.    allows zooming the display to focus on interesting short-term
  793.    fluctuations, such as in the case of the WWV clock.
  794.  
  795.  
  796. Mills                                                          [Page 14]
  797.  
  798.  
  799.  
  800. RFC 957                                                   September 1985
  801. Experiments in Network Clock Synchronization
  802.  
  803.  
  804. 4.3.  Discussion of Results
  805.  
  806.    Each of the four previously mentioned issues of interest will be
  807.    discussed in following subsections.
  808.  
  809. 4.3.1.  On Power-Grid Clocks
  810.  
  811.    Telephone interviews with operators and supervisors of the Potomac
  812.    Electric Power Company (PEPCO), the electric utility serving the
  813.    Washington, DC, area, indicate that there are three major operating
  814.    regions or grids, one east of the Rockies, a second west of the
  815.    Rockies and a third in parts of Texas.  The member electric utilities
  816.    in each grid operate on a synchronous basis, so that clocks anywhere
  817.    within the grid should keep identical time.  However, in the rare
  818.    case when a utility drops off the grid, no attempt is made to
  819.    re-establish correct time upon rejoining the grrd.  In the much more
  820.    common case when areas within the grid are isolated due to local
  821.    thunderstorms, for example, clock synchronization is also disrupted.
  822.  
  823.    The experiments provided an opportunity to measure with exquisite
  824.    precision the offset between a clock connected to the eastern grid
  825.    (DCN3) and the NBS clocks.  The results, confirmed by the telephone
  826.    interviews, show a gradual gain in time of between four and six
  827.    seconds during the interval from about 1700 local time to 0800 the
  828.    next morning, followed by a more rapid loss in time between 0800 and
  829.    1700.  If the time was slewed uniformly throughout these extremes,
  830.    the rate would be about 100 ppm.
  831.  
  832.    The actual slewing rates depend on the demand, which itself is a
  833.    function of weather, day of the week and season of the year.  Similar
  834.    effects occur in the western and Texas grids, with more extreme
  835.    variations in the Texas grid due to the smaller inertia of the
  836.    system, and less extreme variations in the western grid, due to
  837.    smaller extremes in temperature, less total industrial demand and a
  838.    larger fraction of hydro-electric generation.
  839.  
  840.    The uilities consider timekeeping a non-tariffed service provided as
  841.    a convenience to the customer.  In the eastern grid a control station
  842.    in Ohio manually establishes the baseline system output, which
  843.    indirectly affects the clock offset and slewing rate.  The local time
  844.    is determined at the control station with respect to a WWVB radio
  845.    clock. The maximum slewing rate is specified as .025 Hz (about 400
  846.    ppm), which is consistent with the maximum rates observed.  In the
  847.    western grid the baseline system output is adjusted automatically
  848.    using a servomechanism driven by measured offsets from the NBS
  849.    clocks.
  850.  
  851.  
  852.  
  853. Mills                                                          [Page 15]
  854.  
  855.  
  856.  
  857. RFC 957                                                   September 1985
  858. Experiments in Network Clock Synchronization
  859.  
  860.  
  861.    Given the considerations above, it would seem feasable for hosts to
  862.    synchronize logical clocks to a particular power grid, but only if
  863.    corrections were transmitted often enough to maintain the required
  864.    accuracy and these corrections were delivered to the hosts
  865.    essentially at the same time.  Assuming a worst-case 400-ppm slewing
  866.    rate and one minute between correction broadcasts, for example, it
  867.    would in principle be possible to achieve accuracies in the 20-ms
  868.    range.  There are a number of prediction and smoothing techniques
  869.    that could be used to inhance accuracy and reduce the overhead of the
  870.    broadcasts.
  871.  
  872.    Host DCN3, which uses a line-frequency clock interface, was unlocked
  873.    during the experiment period so that the offset between the PEPCO
  874.    clock, which is locked to the eastern power grid, could be measured
  875.    with respect to the reference host DCN1.  Host DCN7, which uses the
  876.    same interface, remained locked to DCN1.  In spite of the previously
  877.    noted instability of the power grid, DCN7 remained typically within
  878.    30 ms of DCN1 and only infrequently exceeded 100 ms in the vicinity
  879.    of large changes in system load that occured near 0800 and 1700 local
  880.    time. Over the seven-day period from 2 July through 8 July the mean
  881.    offset was less than a millisecond with standard deviation about 24
  882.    ms, while the maximum was 79 ms and minimum -116 ms.
  883.  
  884.    Experiments were also carried out using ICMP Timestamp messages with
  885.    hosts known to use line-frequency clock interfaces in California,
  886.    Norway and Germany.  The results indicated that the western power
  887.    grid is rather more stable than the eastern grid and that the
  888.    overseas grids are rather less stable.  In the Oslo, Munich and
  889.    Stuttgart areas, for example, the diurnal variation was observed to
  890.    exceed ten seconds.
  891.  
  892. 4.3.2.  On Clocks Synchronized via Network Links
  893.  
  894.    As mentioned previously, all network links used to synchronize the
  895.    clocks were carrying normal data traffic throughout the experiment
  896.    period.  It would therefore be of interest to investigate how this
  897.    affects the accuracy of the individual clocks.
  898.  
  899.    Table 2 summarizes the mean and standard deviation of the measured
  900.    offsets between the WWVB radio clock and various hosts as shown in
  901.    Figure 2.  Measurements were made over the 24-hour period for each of
  902.    several days during the experimental period.  Each entry shown in
  903.    Table 2 includes the mean of the statistic over these days, together
  904.    with the maximum variation.
  905.  
  906.  
  907.  
  908.  
  909.  
  910. Mills                                                          [Page 16]
  911.  
  912.  
  913.  
  914. RFC 957                                                   September 1985
  915. Experiments in Network Clock Synchronization
  916.  
  917.  
  918.       Host  Mean          Deviation    Link Type and Speed        
  919.       ----------------------------------------------------------- 
  920.       DCN1  .08/.02       0.53/.02     WWVB radio clock (1200 bps)
  921.       DCN5  -13.61/.04    1.1/0.4      Ethernet (10 Mbps)         
  922.       DCN6  0.27/.18      5.8/1.0      DDCMP (4800 bps)           
  923.       FORD1 38.5/1.6      2.5/0.5      DDCMP (9600 bps)           
  924.  
  925.                        Table 2. Link Measurements
  926.  
  927.    The departure of the mean shown in Table 2 from zero is related to
  928.    the drift of the crystal oscillator used in the hardware interface
  929.    (see Table 1).  As described previously, FORD1 was synchonized to the
  930.    GOES radio clock with neglible offset, so that the mean and standard
  931.    deviation shown can be accurately interpreted to apply to the GOES
  932.    radio clock as well.
  933.  
  934.    The results show that the uncertaincies inherent in the
  935.    synchronization algorithm and protocols is in the same order as that
  936.    of the reference clocks and is related to the speed of the links
  937.    connected the reference hosts to the other hosts in the network.
  938.    Further discussion on the FORD1/GOES statistics can be found in the
  939.    next section.
  940.  
  941.    Further insight into the error process can be seen in Table 3, which
  942.    shows the first derivative of delay.
  943.  
  944.                  Host    Dev     Max     Min     Error 
  945.                  ------------------------------------- 
  946.                  DCN3    2.3     12      -17     10    
  947.                  DCN5    1.5     45      -45     5     
  948.                  DCN6    9       94      -54     40    
  949.                  DCN7    1.4     6       -7      5     
  950.                  FORD1   3.4     68      -51     15    
  951.  
  952.                    Table 3. First Derivative of Delay
  953.  
  954.    The mean and standard deviation of delay were computed for all hosts
  955.    on a typical day during the experimental period.  In all cases the
  956.    magnitude of the mean was less than one.  The standard deviation,
  957.    maximum and minimum for each link is summarized by host in Table 3.
  958.    A common characteristic of the distribution in most cases was that
  959.    only a handful of samples approached the maximum or minimum extrema,
  960.    while the vast majority of samples were much less than this.  The
  961.    "Error" colum in Table 3 indicates the magnitude of the estimated
  962.    error when these extrema are discarded.
  963.  
  964.  
  965.  
  966.  
  967. Mills                                                          [Page 17]
  968.  
  969.  
  970.  
  971. RFC 957                                                   September 1985
  972. Experiments in Network Clock Synchronization
  973.  
  974.  
  975.    A very interesting feature of the observations was the unexpectedly
  976.    low standard deviation of DCN3, which was locked to the power grid
  977.    and thus would be expected to show wide variations.  Upon analysis,
  978.    this turned out to be a natural consequence of the fact that the
  979.    Hello messages are generated as the result of interrupts based on the
  980.    line frequency when the local clock had just been incremented by
  981.    1/60th of a second.
  982.  
  983.    The synchronizing protocol and implementation were carefully
  984.    constructed to minimize the loss of accuracy due to sharing of the
  985.    network links between data and control traffic, as long as sufficient
  986.    resources (in particular, packet buffers) are available.  Since the
  987.    various network links shown in Figure 2 operate over a wide range of
  988.    rates, it is possible that undisciplined bursts of traffic can swamp
  989.    a host or gateway and precipitate a condition of buffer starvation.
  990.  
  991.    While most hosts using paths through the experimental configuration
  992.    were relatively well-disciplined in their packetization and
  993.    retransmission policies, some Unix 4.2bsd systems were notorious
  994.    exceptions.  On occasion these hosts were observed sending floods of
  995.    packets, with only a small amount of data per packet, together with
  996.    excessive retransmissions.  As expected, this caused massive
  997.    congestion, unpredictable link delays and occasional clock
  998.    synchronizing errors.
  999.  
  1000.    The synchronizing algorithms described above successfully cope with
  1001.    almost all instances of congestion as described, since delay-induced
  1002.    errors tend to be isolated, while inherent anti-spike and smoothing
  1003.    properties of the synchronizing algorithm help to preserve accuracies
  1004.    in any case.  Only one case was found during the ten-day experiment
  1005.    period where a host was mistakenly synchronized outside the
  1006.    linear-tracking window due to congestion.  Even in this case the host
  1007.    was quickly resynchronized to the correct time when the congestion
  1008.    was cleared.
  1009.  
  1010. 4.3.3.  On the Accuracy of Radio Clocks
  1011.  
  1012.    One of the more potent motivations for the experiments was to assess
  1013.    the accuracy of the various radio clocks and to determine whether the
  1014.    WWV radio clock was an appropriate replacement for the expensive WWVB
  1015.    or GOES clocks.  A secondary consideration, discussed further in the
  1016.    next section, was how the various clocks handled disruptions due to
  1017.    power interruptions, leap seconds and so forth.
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024. Mills                                                          [Page 18]
  1025.  
  1026.  
  1027.  
  1028. RFC 957                                                   September 1985
  1029. Experiments in Network Clock Synchronization
  1030.  
  1031.  
  1032. 4.3.3.1.  The Spectracom 8170 WWVB Radio Clock
  1033.  
  1034.    As the result of several years of experience with the WWVB radio
  1035.    clock, which is manufactured by Spectracom Corporation as Model 8170,
  1036.    it was chosen as the reference for comparison for the GOES and WWV
  1037.    radio clocks.  Washington, DC, is near the 100-microvolt/meter
  1038.    countour of the WWVB transmitter at Boulder, CO, well in excess of
  1039.    the 25-microvolt/meter sensitivity of the receiver.  The antenna is
  1040.    located in a favorable location on the roof of a four-storey building
  1041.    in an urban area.
  1042.  
  1043.    Using the data from the instruction manual, the propagation delay for
  1044.    the path from Boulder to Washington is about 8 ms, while the
  1045.    intrinsic receiver delay is about 17 ms.  The clock is read via a
  1046.    1200-bps asynchronous line, which introduces an additional delay of
  1047.    about 7 ms between the on-time transition of the first character and
  1048.    the interrupt at the middle of the first stop bit.  Thus, the WWVB
  1049.    radio clock indications should be late by 8 + 17 + 7 = 32 ms relative
  1050.    to NBS standard time.  While it is possible to include this delay
  1051.    directly in the clock indication, this was not done in the
  1052.    experiments.  In order to account for this, 32 ms should be
  1053.    subtracted from all indications derived from this clock.  The
  1054.    uncertaincy in the indication due to all causes is estimated to be a
  1055.    couple of milliseconds.
  1056.  
  1057. 4.3.3.2.  The True Time 468-DC GOES Radio Clock
  1058.  
  1059.    The GOES radio clock is manufactured by True Time Division of
  1060.    Kinemetrics, Incorporated, as Model 468-DC.  It uses the
  1061.    Geosynchronous Orbiting Environmental Satellite (GOES), which
  1062.    includes an NBS-derived clock channel.  Early in the experiment
  1063.    period there was some ambiguity as to the exact longitude of the
  1064.    satellite and also whether the antenna was correctly positioned.
  1065.    This was reflected in the rather low quality-of-signal indications
  1066.    and occasional signal loss reported by the clock and also its
  1067.    apparent offset compared with the other radio clocks.
  1068.  
  1069.    Table 4 shows a summary of offset statistics for the GOES radio clock
  1070.    by day (all day numbers refer to July, 1985).
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.  
  1081. Mills                                                          [Page 19]
  1082.  
  1083.  
  1084.  
  1085. RFC 957                                                   September 1985
  1086. Experiments in Network Clock Synchronization
  1087.  
  1088.  
  1089.                  Day     Mean    Dev     Max     Min   
  1090.                  ------------------------------------ 
  1091.                  2       31.6    9.4     53      -76  
  1092.                  3       19.8    22.1    53      -64  
  1093.                  4       42.8    17.1    >150    19   
  1094.                  5       39.3    2.2     54      -45  
  1095.                  6       37.8    2.7     53      19   
  1096.                  7       62.2    13.0    89      22   
  1097.                  8       38.2    2.8     90      -7   
  1098.  
  1099.                    Table 4. GOES Radio Clock Offsets
  1100.  
  1101.     On all days except days 5, 6 and 8 long periods of poor-quality
  1102.    signal reception were evident.  Since the antenna and satellite
  1103.    configuration are known to be marginal, these conditions are not
  1104.    considered representative of the capabilities of the clock.  When the
  1105.    data from these days are discarded, the mean offset is 38.4 ms with
  1106.    standard deviation in the range 2.2 to 2.8.  The maximum offset is 90
  1107.    ms and the minimum is -45 ms;  however, only a very small number of
  1108.    samples are this large - most excursions are limited to 10 ms of the
  1109.    mean.
  1110.  
  1111.    In order to compute the discrepancy between the GOES and WWVB clocks,
  1112.    it is necessary to subtract the WWVB clock delay from the mean
  1113.    offsets computed above.  Thus, the GOES clock indications are 38.4 -
  1114.    32 = 6.4 ms late with respect to the WWVB clock indications.  which
  1115.    is probably within the bounds of experiment error.
  1116.  
  1117. 4.3.3.3.  The Heath GC-1000 WWV Radio Clock
  1118.  
  1119.    The WWV radio clock is manufactured by Heath Company as Model
  1120.    GC-1000.  It uses a three-channel scanning WWV/WWVH receiver on 5, 10
  1121.    and 15 MHz together with a microprocessor-based controller.  The
  1122.    receiver is connected to an 80-meter dipole up about 15 meters and
  1123.    located in a quiet suburban location.  Signal reception from the Fort
  1124.    Collins transmitters was average to poor during the experiment period
  1125.    due to low sunspot activity together with a moderate level of
  1126.    geomagnetic disturbances, but was best during periods of darkness
  1127.    over the path.  The clock locked at one of the frequencies for
  1128.    varying periods up to an hour from two to several times a day.
  1129.  
  1130.    The propagation delay on the path between Fort Collins and Washington
  1131.    is estimated at about 10 ms and can vary up to a couple of
  1132.    milliseconds over the day and night.  While it is possible to include
  1133.    this delay in the clock indications, which are already corrected for
  1134.  
  1135.  
  1136.  
  1137.  
  1138. Mills                                                          [Page 20]
  1139.  
  1140.  
  1141.  
  1142. RFC 957                                                   September 1985
  1143. Experiments in Network Clock Synchronization
  1144.  
  1145.  
  1146.    the intrinsic receiver delay, this was not done in the experiments.
  1147.    During periods of lock, the clock indications are claimed to be
  1148.    accurate to within 100 ms.
  1149.  
  1150.    Table 5 shows a summary of offset statistics for the WWV radio clock
  1151.    by day (all day numbers refer to July, 1985).
  1152.  
  1153.                  Day     Mean    Dev     Max     Min   
  1154.                  ------------------------------------  
  1155.                  2       -31     36      110     -119  
  1156.                  3       -42     38      184     -141  
  1157.                  4       -21     38      61      -133  
  1158.                  5       -31     37      114     -136  
  1159.                  6       -48     42      53      -160  
  1160.                  7       -100    80      86      -315  
  1161.                  8       -71     70      115     -339  
  1162.  
  1163.                     Table 5. WWV Radio Clock Offsets
  1164.  
  1165.    On inspection of the detailed plots of offsets versus time the data
  1166.    reveal an interesting sawtooth variation with period about 25 cycles
  1167.    per hour and amplitude about 90 ms.  Once the clock has locked for
  1168.    some time the variation decreases in frequency and sometimes
  1169.    disappears.  This behavior is precisely what would be expected of a
  1170.    phase-locked oscillator and accounts for the rather large standard
  1171.    deviations in Table 5.
  1172.  
  1173.    On inspection of the plots of offsets versus time, it is apparent
  1174.    that by far the best accuracies are obtained at or in the periods of
  1175.    lock, which is most frequent during periods of darkness over the
  1176.    propagation path, which occured roughly between 0800 UT and 1100 UT
  1177.    during the experiment period.  Excluding all data except that
  1178.    collected during this period, the mean offset is -21.3 ms with
  1179.    standard deviation in the range 29-31.  The maximum offset is 59 ms
  1180.    and the minimum is -118 ms.
  1181.  
  1182.    In order to compute the discrepancy between the WWV and WWVB clocks,
  1183.    it is necessary to subtract the total of the propagation delay plus
  1184.    WWVB clock delay from the mean offsets computed above.  Thus, the WWV
  1185.    clock indications are -21.3 - 10 - 32 = -72.3 ms late (72.3 ms early)
  1186.    with respect to the WWVB clock indications.  Considering the large
  1187.    standard deviations noted above, it is probably not worthwhile to
  1188.    include this correction in the WWV clock indications.
  1189.  
  1190.    On exceptional occasions excursions in offset over 300 ms relative to
  1191.    the WWVB clock were observed.  Close inspection of the data showed
  1192.    that this was due to an extended period (a day or more) in which lock
  1193.  
  1194.  
  1195. Mills                                                          [Page 21]
  1196.  
  1197.  
  1198.  
  1199. RFC 957                                                   September 1985
  1200. Experiments in Network Clock Synchronization
  1201.  
  1202.  
  1203.    was not achieved on any frequency.  The master oscillator uses a
  1204.    3.6-MHz crystal oscillator trimmed by a digital/analog converter and
  1205.    register which is loaded by the microprocessor.  The occasional
  1206.    excursions in offset were apparently due to incorrect register values
  1207.    as the result of noisy reception conditions and excessive intervals
  1208.    between lock.  On occasion the oscillator frequency was observed in
  1209.    error over 4 ppm due to this cause, which could result in a
  1210.    cumulative error of almost 400 ms per day if uncorrected.
  1211.  
  1212. 4.3.4.  On Handling Disruptions
  1213.  
  1214.    The experiment period was intentionally selected to coincide with the
  1215.    insertion of a leap second in the worldwide time broadcasts.  The
  1216.    intent was to examine the resulting behavior of the various radio
  1217.    clocks and the synchronization algorithm when an additional second
  1218.    was introduced at 2400 UT on 30 June.
  1219.  
  1220.    As it turned out, radio reception conditions at the time of insertion
  1221.    were quite poor on all WWV frequencies, the WWVB frequency and the
  1222.    GOES frequency.  Thus, all three clocks took varying periods up to
  1223.    several hours to resynchonize and correct the indicated time.  In
  1224.    fact, the only time signals heard around the time of interest were
  1225.    those from Canadian radio CHU, but the time code of the Canadian
  1226.    broadcasts is incompatible with the of the US broadcasts.
  1227.  
  1228.    As mentioned above, the WWVB clock was used as the master during the
  1229.    experiment period.  About two hours after insertion of the leap
  1230.    second the clock resynchronized and all hosts in the experimental
  1231.    network were corrected shortly afterwards.  Since the magnitude of
  1232.    the correction exceeded 128 ms, the correction was of a step nature,
  1233.    but was not performed simultaneously in all hosts due to the
  1234.    individual timing of the Hello messages.  Thus, if timing-critical
  1235.    network operations happened to take place during the correction
  1236.    process, inconsistent timestamps could result.
  1237.  
  1238.    The lesson drawn from this experience is quite clear.  Accurate time
  1239.    synchronization requires by its very nature long integration times,
  1240.    so that epochal events which disrupt the process must be predicted in
  1241.    advance and applied in all hosts independently.  In principle, this
  1242.    would not be hard to do and could even be integrated into the
  1243.    operation of the step-correction procedure described earlier, perhaps
  1244.    in the form of bits included in Hello messages which trigger a
  1245.    one-second correction at the next rollover from 2400 to 0000 hours.
  1246.  
  1247.    In order for such an out-of-band correction to be effective, advance
  1248.    notice of the leap second must be available.  At present, this
  1249.    information is not available in the broadcast format and must be
  1250.  
  1251.  
  1252. Mills                                                          [Page 22]
  1253.  
  1254.  
  1255.  
  1256. RFC 957                                                   September 1985
  1257. Experiments in Network Clock Synchronization
  1258.  
  1259.  
  1260.    obtained via the news media.  In fact, there are spare bits in the
  1261.    broadcast format that could be adapted for this purpose, but this
  1262.    would require reprogramming both the transmitting and receiving
  1263.    equipment. Nevertheless, this feature should be considered for future
  1264.    systems.
  1265.  
  1266. 4.4.  Additional Experiments
  1267.  
  1268.    A set of experiments was performed using two WIDEBAND/EISN gateways
  1269.    equipped with WWVB radio clocks and connected to the ARPANET.  These
  1270.    experiments were designed to determine the limits of accuracy when
  1271.    comparing these clocks via ARPANET paths.  One of the gateways
  1272.    (ISI-MCON-GW) is located at the Information Sciences Institute near
  1273.    Los Angeles, while the other (LL-GW) is located at Lincoln
  1274.    Laboratories near Boston.  Both gateways consist of PDP11/44
  1275.    computers running the EPOS operating system and clock-interface
  1276.    boards with oscillators phase-locked to the WWVB clock.
  1277.  
  1278.    The clock indications of the WIDEBAND/EISN gateways were compared
  1279.    with the DCNet WWVB reference clock using ICMP Timestamp messages
  1280.    [6], which record the individual timestamps with a precision of a
  1281.    millisecond.  This technique is not as accurate as the one described
  1282.    in Section 3, since the protocol implementation involves the
  1283.    user-process level, which can be subject to minor delays due to
  1284.    process scheduling and interprocess-message queueing.  However,
  1285.    calibration measurements made over several of the links shown in
  1286.    Figure 2 indicate that the measurement errors are dominated by the
  1287.    individual link variations and not by the characteristics of the
  1288.    measurement technique itself.
  1289.  
  1290.    Measurements were made separately with each gateway by sending an
  1291.    ICMP Timestamp Request message from the ARPANET address of DCN1 to
  1292.    the ARPANET address of the gateway and computing the round-trip delay
  1293.    and clock offset from the ICMP Timestamp Reply message.  This process
  1294.    was continued for 1000 message exchanges, which took about seven
  1295.    minutes. Table 6 shows the statistics obtained with ISI-MCON-GW and
  1296.    Table 7 those with LL-GW (all numbers are milliseconds).
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309. Mills                                                          [Page 23]
  1310.  
  1311.  
  1312.  
  1313. RFC 957                                                   September 1985
  1314. Experiments in Network Clock Synchronization
  1315.  
  1316.  
  1317.             ISI-MCON-GW     Mean    Dev     Max     Min    
  1318.              --------------------------------------------  
  1319.              Offset          -16     40      126     -908  
  1320.              Delay           347     59      902     264   
  1321.  
  1322.                  Table 6. ISI-MCON-GW Clock Statistics
  1323.  
  1324.              LL-GW (a)       Mean    Dev     Max     Min   
  1325.              --------------------------------------------  
  1326.              Offset          -23     15      32      -143  
  1327.              Delay           310     25      536     252   
  1328.  
  1329.                     Table 7. LL-GW Clock Statistics
  1330.  
  1331.    The smaller values of standard deviation and extreme for LL-GW are
  1332.    probably due to the shorter ARPANET path involved.  The confidence in
  1333.    the mean offset can be estimated by dividing the standard deviation
  1334.    by the square root of the number of samples (1000), which suggests
  1335.    that the mean offsets are accurate to within a couple of miliseconds.
  1336.    The mean offsets of the WIDEBAND/EISN clocks as a group relative to
  1337.    the DCN1 clock may thus indicate a minor discrepancy in the setting
  1338.    of the delay-compensation switches.
  1339.  
  1340.    It is well known that ARPANET paths exhibit wide variations in
  1341.    delays, with occasional delays reaching surprising values up to many
  1342.    seconds.  In order to improve the estimates a few samples were
  1343.    removed from both the offset and delay data, including all those with
  1344.    magnitude greater than one second.
  1345.  
  1346.    The above experiments involve a burst of activity over a relatively
  1347.    short time during which the ratio of the measurement traffic to other
  1348.    network traffic may be nontrivial.  Another experiment with LL-GW was
  1349.    designed with intervals of ten seconds between ICMP messages and
  1350.    operated over a period of about three hours.  The results are shown
  1351.    in Table 8.
  1352.  
  1353.              LL-GW (b)       Mean    Dev     Max     Min  
  1354.              -------------------------------------------- 
  1355.              Offset          -16     93      990     -874 
  1356.              Delay           371     108     977     240  
  1357.  
  1358.                     Table 8. LL-GW Clock Statistics
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366. Mills                                                          [Page 24]
  1367.  
  1368.  
  1369.  
  1370. RFC 957                                                   September 1985
  1371. Experiments in Network Clock Synchronization
  1372.  
  1373.  
  1374.    Note that the standard deviations and extrema are higher than in the
  1375.    previous experiments, but the mean offset is about the same.
  1376.  
  1377.    The results of these experiments suggest that time synchronization
  1378.    via ARPANET paths can yield accuracies to the order of a few
  1379.    milliseconds, but only if relatively large numbers of samples are
  1380.    available.  The number of samples can be reduced and the accuracy
  1381.    improved by using the techniques of Section 3 modified for ICMP
  1382.    Timestamp messages and the longer, more noisy paths involved.
  1383.  
  1384. 5.  Summary and Conclusions
  1385.  
  1386.    The experiments described above were designed to verify the correct
  1387.    operation of the DCnet time-synchronization algorithms and protocols
  1388.    under a variety of scenarios, including the use of line-frequency
  1389.    clocks, three types of radio clocks and various types of
  1390.    interprocessor links.  They involved the collection and processing of
  1391.    many megabytes of data collected over a ten-day period that included
  1392.    the insertion of a leap second in the standard NBS time scale.  Among
  1393.    the lessons learned were the following:
  1394.  
  1395.       1.  The algorithms and protocols operate as designed, yielding
  1396.           accuracies throughout the experimental net in the order of a
  1397.           few milliseconds to a few tens of milliseconds, depending on
  1398.           the topology and link type.
  1399.  
  1400.       2.  Glitches due to congestion, rebooted hosts and link failures
  1401.           are acceptably low, even in the face of massive congestion
  1402.           resulting from inappropriate host implementations elsewhere in
  1403.           the Internet.
  1404.  
  1405.       3.  A synchronization scenario where the clocks in all hosts are
  1406.           locked to the line frequency and corrections are broadcast
  1407.           from a central time standard will work only if all hosts are
  1408.           on the same power grid, which is unlikely in the present
  1409.           Internet configuration, but may be appropriate for some
  1410.           applications.
  1411.  
  1412.       4.  In spite of the eastern power grid wandering over as much as
  1413.           six seconds in a day, it is possible to achieve accuracies in
  1414.           the 30-ms range using line-frequency interface clocks and
  1415.           corrections broadcast on the local net.
  1416.  
  1417.       5.  Radio clocks can vary widely in accuracy depending on signal
  1418.           reception conditions.  Absolute time can be determined to
  1419.           within a couple of milliseconds using WWVB and GOES radio
  1420.           clocks, but only if they are calibrated using an independent
  1421.  
  1422.  
  1423. Mills                                                          [Page 25]
  1424.  
  1425.  
  1426.  
  1427. RFC 957                                                   September 1985
  1428. Experiments in Network Clock Synchronization
  1429.  
  1430.  
  1431.           standard such as a portable clock.  The inexpensive WWV clocks
  1432.           perform surprisingly well most of the time, but can be in
  1433.           error up to a significant fraction of a second under some
  1434.           conditions.
  1435.  
  1436.       6.  Adjustments in the time scale due to leap seconds must be
  1437.           anticipated before they occur.  The synchronization protocol
  1438.           must include a mechanism to broadcast an adjustment in advance
  1439.           of its occurance, so that it can be incorporated in each host
  1440.           simultaneously.  There is a need to incorporate advance notice
  1441.           of leap seconds in the broadcast time code.
  1442.  
  1443.       7.  Time synchronization via ARPANET paths can yield accuracies in
  1444.           the order of a few milliseconds, but only if relatively large
  1445.           numbers of samples are available.  Further work is needed to
  1446.           develop efficient protocols capable of similar accuracies but
  1447.           using smaller numbers of samples.
  1448.  
  1449. 6.  References
  1450.  
  1451.    1.  Lindsay, W.C., and A.V.  Kantak.  Network Synchronization of
  1452.        Random Signals.  IEEE Trans.  Comm.  COM-28, 8 (August 1980),
  1453.        1260-1266.
  1454.  
  1455.    2.  Mills, D.L.  Time Synchronization in DCNET Hosts.  DARPA Internet
  1456.        Project Report IEN-173, COMSAT Laboratories, February 1981.
  1457.  
  1458.    3.  Mills, D.L.  DCNET Internet Clock Service.  DARPA Network Working
  1459.        Group Report RFC-778, COMSAT Laboratories, April 1981.
  1460.  
  1461.    4.  Mills, D.L.  Internet Delay Experiments.  DARPA Network Working
  1462.        Group Report RFC-889, M/A-COM Linkabit, December 1983.
  1463.  
  1464.    5.  Mills, D.L.  DCN Local-Network Protocols.  DARPA Network Working
  1465.        Group Report RFC-891, M/A-COM Linkabit, December 1983.
  1466.  
  1467.    6.  Postel, J.  Internet Control Message Protocol.  DARPA Network
  1468.        Working Group Report RFC-792, USC Information Sciences Institute,
  1469.        September 1981.
  1470.  
  1471.    7.  Postel, J.  Time Protocol.  DARPA Network Working Group Report
  1472.        RFC-868, USC Information Sciences Institute, May 1983.
  1473.  
  1474.    8.  Postel, J.  Daytime Protocol.  DARPA Network Working Group Report
  1475.        RFC-867, USC Information Sciences Institute, May 1983.
  1476.  
  1477.  
  1478.  
  1479.  
  1480. Mills                                                          [Page 26]
  1481.  
  1482.  
  1483.  
  1484. RFC 957                                                   September 1985
  1485. Experiments in Network Clock Synchronization
  1486.  
  1487.  
  1488.    9.  Su, Z.  A Specification of the Internet Protocol (IP) Timestamp
  1489.        Option.  DARPA Network Working Group Report RFC-781.  SRI
  1490.        International, May 1981.
  1491.  
  1492.    10. Marzullo, K., and S.  Owicki.  Maintaining the Time in a
  1493.        Distributed System.  ACM Operating Systems Review 19, 3 (July
  1494.        1985), 44-54.
  1495.  
  1496.    11. Mills, D.L.  Algorithms for Synchronizing Network Clocks.  DARPA
  1497.        Network Working Group Report RFC-956, M/A-COM Linkabit, September
  1498.        1985.
  1499.  
  1500.    12. Mills, D.L.  Network Time Protocol (NTP).  DARPA Network Working
  1501.        Group Report RFC-958, M/A-COM Linkabit, September 1985.
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.  
  1526.  
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537. Mills                                                          [Page 27]
  1538.  
  1539.