23.03.2017 Views

wilamowski-b-m-irwin-j-d-industrial-communication-systems-2011

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Clock Synchronization in Distributed Systems 18-9<br />

• The second component in the data flow is the so-called peer selection. This unit is included due to<br />

the fact that not only delayed messages can arrive from a node, but also mutually wrong clocks<br />

can present themselves as masters. Reasons for wrong hosts in NTP networks can be broken<br />

server clocks or attacks with the goal to change the time on a network host. The latter can be<br />

tackled by authentication of clock servers, which is nevertheless not sufficient for the first issue<br />

of accidentally wrong clocks. In order to avoid problems resulting from such broken clocks, a<br />

parameter-driven decision of sorting out those clocks is done in peer selection.<br />

• After the peer selection is done—from a message point of view—often contradicting information<br />

regarding the offset and drift of the local clock exist. These data have to be merged in the clock<br />

combining component.<br />

• The last two components, namely the loop filter and voltage-controlled oscillator (VCO), have the<br />

task of conditioning the control signal with respect to control circuit stability and adjusting the<br />

local clock, respectively.<br />

The first element of the NTP signal flow is the data filter. This element is provided to eliminate statistical<br />

errors as well as byzantine nodes. The filter collects data on a per-peer basis and calculates two<br />

measures: the filter dispersion ε σ , and the select dispersion ε ζ . The dispersion is calculated with ϑ i (0 ≤ i ≤ n)<br />

as the offset of the ith sample and the sample difference ε ij = |ϑ i − ϑ j |. The dispersion, ε j is then defined<br />

relative to the jth entry as weighted sum<br />

ε<br />

j<br />

n−1<br />

i+<br />

= ∑ εijw<br />

1<br />

i=<br />

1<br />

Both ε σ and ε ζ are defined by protocol parameters, namely NTP.FILTER and NTP.SELECT, which<br />

are usually set to values less than 0.5 and evaluated relative to the first entry ε 0 . In that context, w<br />

is the weighting factor, which is used to build an exponential average, with a value of w < 0.5. The<br />

second, functional part, the peer selection is most important for the stability of NTP. As soon as new<br />

offsets to a reference clock are estimated, this algorithm decides which peer is used as synchronization<br />

source. Of course, also the unavailability of offset measurements (e.g., due to timeouts) are also<br />

used to (de-)select peers. The actual peer selection is done by assembling of the candidates in a sorted<br />

list. This list represents the available peers sorted by stratum and synchronization dispersion. Also,<br />

several sanity checks to detect defective nodes are a knock-out criterion to remove defective nodes. In<br />

case that the result of this sanity check is an empty list, the local nodes continue running with their<br />

local unadjusted clock frequencies. In the other case, if the list holds more than one node, these statistical<br />

equivalent offsets have to be combined. The clock assembly is done by construction of so-called<br />

final clock correction, η n , for all nodes. Moreover, the synchronization distance, λ n , is also internally<br />

required by the previously described algorithms. The value of 1/λ n is then used as weight of each clock<br />

offset in the list.<br />

The virtual control loop is finally closed by the loop filter and the VCO, respectively. The task of these<br />

two parts is to adapt the calculated settings from NTP to the actual clock of the device. This is done by<br />

adjusting offset and frequency—both algorithms are implemented in a feedback loop. The general structure<br />

of the disciplining is shown in Figure 18.7. In general, this disciplining structure is a subordinate<br />

control loop. The set value ϑ r is taken from the above-described clock selection part of NTP. The value is<br />

compared to the control phase of the variable frequency oscillator, which is the actual driver of the node<br />

clock. The difference between ϑ r and ϑ c is afterward used in the clock filter, which is actually a tapped<br />

delay line, whereas the tap is selected by an algorithm described in [Mills2000].<br />

Afterward, the filtered signal is used in the loop filter (Figure 18.7). This filter adjusts the clock via the<br />

calculation of three variables. First, the phase offset is calculated and directly fed back to the clock adjustment<br />

unit. Second, the frequency offset is calculated via two ways: a phase prediction and a frequency<br />

© <strong>2011</strong> by Taylor and Francis Group, LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!