IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 58, NO. 6, JUNE 2009 1849 Synchronization Performance of the Precision Time Protocol in Industrial Automation Networks Ruxandra Lupas Scheiterer, Chongning Na, Student Member, IEEE, Dragan Obradovic, Member, IEEE, and Günter Steindl
Abstract—This paper analyzes the factors that affect the syn- Boundary clocks adjust their own clock to the master clock chronization performance in peer-to-peer precision time protocol and then serve as masters for the next network segment. The (PTP). We first study the influence of frequency drift in the authors of [8] introduced the transparent clock (TC) concept, absence of jitter and compare the gravity of the master drift in which intermediate bridges are treated as network compo- with that of the slave drift. Then, we study the influence of jitter under the assumption of constant frequencies and the effect of nents with known delay. By doing this, the synchronization averaging. The analytic formulas provide a theoretical ground for at the time client is not dependent on the control loop design understanding the simulation results, some of which are presented, in the intermediate bridges. The TC concept has been adopted as well as the guidelines for choosing both system and control in the new version of IEEE 1588 published in 2007 (http: parameters. //ieee1588.nist.gov/). The IEEE 1588-2008, also known as Index Terms—Frequency drift, IEEE 1588, jitter, master, pre- 1588 Version 2, was approved by the IEEE on March 27, 2008. cision time protocol (PTP) Version 2, rate-compensation factor The current state of the art is to guarantee a synchronization (RCF), slave, synchronization error, synchronization precision, precision of 1 μs for topologies with 30 consecutive slaves. transparent clock (TC). To expand this limit, it is important to study the factors that influence the quality of the synchronization process and to I. INTRODUCTION work on minimizing their effect. Industrial environments are THERNET [1], due to its cheap cabling and infrastruc- such that unpredictable and independent temperature changes E ture costs, high bandwidth, efficient switching technology, at each node are commonly encountered, causing short-term and better interoperability, has been adopted in various areas frequency drifts, unless precluded by expensive temperature- to provide the basic networking solution. Many Ethernet- compensated (TCXO) or oven-controlled (OCXO) crystal based applications require the networked clocks to be precisely oscillators. Factors that affect the synchronization quality synchronized. Typical examples include the synchronization achievable by PTP include the stability of oscillators, the res- of base stations for handover or interference cancellation [2] olution of time stamping the message, the frequency of sending in telecommunication networks, distribution of audio/video synchronization messages, and the propagation delay variation streams over Ethernet-based networks [3], and motion control caused by the jitter in the intermediate elements. Previous work in industrial Ethernet [4]. Standard network time protocol on the subject includes [10], which derives the synchronization (NTP) [5], [6] synchronization over Ethernet provides a time errors due to jitters and master frequency drift; [11] and [12], accuracy at the millisecond level, which is enough for processes where improved algorithms are proposed; [13], where the line that are not time critical. However, in many applications, delay estimation error due to clock frequency drift is obtained; base station synchronization or motion control, where only and [14], which derives the synchronization error due to slave submicrosecond-level synchronization errors are allowed (the frequency drift. so-called isochronous mode), a more accurate solution is This paper summarizes the work in [10]–[14], adding ana- needed. The precision time protocol (PTP), which was deliv- lytic results on the effect of averaging, comparative simulation ered by the IEEE 1588 standard [7] and published in 2002, con- results, and guidelines for choosing both system and control stitutes a promising Ethernet synchronization protocol in which parameters when applying PTP. messages carrying precise timing information are propagated in This paper is organized as follows. Section II introduces the network to synchronize the slave clocks to a master clock. the 1588 peer-to-peer system model and describes the PTP. An analysis of the influence of frequency drifts is presented in Section III and of jitters in Section IV. Consequences are Manuscript received March 18, 2008; revised September 26, 2008. discussed in Section V and strengthened by simulation results First published April 14, 2009; current version published May 13, 2009. in Section VI. The Associate Editor coordinating the review process for this paper was Dr. Georg Gaderer. R. L. Scheiterer, C. Na, and D. Obradovic are with Corporate Technology, Information and Communications, Siemens AG, 81730 Munich, II. DESCRIPTION OF PTP WITH TCS Germany (e-mail: [email protected]; na.chongning.ext@ siemens.com; [email protected]). Since the standard does not specify the details, this section G. Steindl is with Automation & Drives, Industrial Automation Systems, introduces the system model and notation. Fig. 1 shows a Siemens AG, 92220 Amberg, Germany (e-mail: guenter.steindl@ system with N +1 cascaded elements connected in a line siemens.com). topology. The PTP has a master/slave structure. Color versions of one or more of the figures in this paper are available online at http://ieeexplore.ieee.org. The time server, called grand(master), provides the reference Digital Object Identifier 10.1109/TIM.2009.2013655 time to the other elements, called slaves, via time-aware bridges
0018-9456/$25.00 © 2009 IEEE
Authorized licensed use limited to: T U MUENCHEN. Downloaded on September 3, 2009 at 03:44 from IEEE Xplore. Restrictions apply. 1850 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 58, NO. 6, JUNE 2009
Fig. 2. PTP with TCs.
ˆ i Fig. 1. System model. (a) Network topology. (b) System parameters. master counter value Mn−1 augmented by its local delay, i.e., the sum of its (skewed) line and bridge delays translated to (TCs). The master sends Sync messages every T seconds, sync master time by multiplication with RCFn: which carry the counter state of the master clock M i, stamped Mˆ i = Mˆ i + Sˆ (LDi )+Sˆ (BDi ) · RCF i at sending, and are propagated along the network. Quantities, n n−1 n n n n n (2) ˆ i i certain or not, linked with the Sync message transmitted by M0 = M = M(ti). the master at time t are labeled by superscript i.Iff is the i This equation represents the “support” for an extrapolation clock frequency, a delay D is measured by the local clock process that advances the controlled local clock until the arrival as the counter increase D · f; or as an integral thereof, if the of new information. The last ingredient necessary for the update frequency drifts. The line delay LDi is the propagation time n of (2) is the estimation of the line delay to the predecessor, between the nth slave and its uplink element, and is estimated shown on the right in Fig. 2; j indexes the line delay com- by using the so-called “line delay estimation process” of (6). putation. This process uses four time stamps: with periodicity Each time a time stamp is read, a jitter of known distribution is R, node n (the requestor) sends a request message to node incurred. The Sync message is forwarded after a bridge delay − j − BDi , which is recorded at each slave as the difference of the n 1 and records its time of departure Sn,req_out. Node n 1 n (the responder) reports the two time stamps of receiving the times stamped at reception and forwarding. A time labeled by j request message and transmitting the reply S − and Sn (respectively, M) means “measured in the local time of n 1,req_in j − j slave n (respectively, master time)”; a hat on a symbol means Sn−1,resp_out.Theresponder delay of node n 1 is RDn−1 ˆ i “estimate.” For example, Sn(BDn) means “the bridge delay in absolute time and is, in local time that affects the ith Sync message at slave n, estimated in terms j j − j i Sn−1,respD := Sn−1,resp_out Sn−1,req_in. (3) of the own local free-running clock.” At slave n, we define LBn as the sum of line delay plus bridge delay of Sync message j Node n records the time S of receiving the desired i,n i − i−1 n,resp_in i, and δLB = LBn LBn as the difference between the LB reply after a requestor delay in node n time of values that affected Sync messages i and i − 1. j j − j The time intervals measured by two different clocks will Sn,reqD := Sn,resp_in Sn,req_out. (4) be called “skewed”. To be able to add or subtract them from each other, they have to be converted to the same time basis. To be able to subtract the skewed time intervals of (3) and To this end, each slave determines its frequency offset to the (4), each element maintains an “RCF peer” estimate, i.e., the master. The rate compensation factor (RCF, which is also the frequency ratio estimate to its predecessor, that is estimated via “rate ratio” [9], [12]) is defined as the frequency ratio of two j − j−1 j Sn,req_out Sn,req_out clocks. We use RCFX/Y to denote the frequency ratio between RCF = . (5) Sn/Sn−1 j j−1 S − − S − X and Y , i.e., ideally RCFX/Y = fX /fY . The rate offset n 1,req_in n 1,req_in to the master RCF can be estimated via the master counter n Then, the line delay can be estimated as estimates Mˆ in two Sync messages whose transmission times j − j · are separated by an interval T (equal to Tsync, or a multiple S S − RCFS /S − Sˆ LDj = n,reqD n 1,respD n n 1 . (6) thereof) and the local counter values S at arrival of these n n 2 messages at slave n, i.e., Usually, several successive line delay estimates are averaged. ˆ i − ˆ i−1 Mn−1 Mn−1 This concludes the description of the synchronization process, RCFn ≡ RCFM/S = . (1) n i i−1 whose accuracy is studied in this paper. In our analytic work, S − Sn n we examine each effect in isolation. However, all are simulta- Fig. 2 illustrates the pillars of time synchronization: timing neously present in the subsequent simulations. We assume zero propagation, and line delay estimation. Upon reception of Sync delay skew, i.e., direction-independent cable run time. This is message i,slaven hands an estimate of the master time at the a mild idealization since the IEC 61784-5-3 mandates stringent time of reception to the control loop of its controlled clock. In requirements for the delay skew, e.g., for PROFINET, it may addition, he acts as TC by passing on the received (estimated) not exceed 20 ns/100 m.
Authorized licensed use limited to: T U MUENCHEN. Downloaded on September 3, 2009 at 03:44 from IEEE Xplore. Restrictions apply. SCHEITERER et al.: SYNCHRONIZATION PERFORMANCE OF THE PTP IN INDUSTRIAL AUTOMATION NETWORKS 1851
i III. ANALYSIS OF ERROR PROPAGATION—PART 1: THE where Ln is the propagation time of the ith Sync message to i EFFECT OF CLOCK DRIFT IN THE ABSENCE OF JITTER slave n (which is called latency) with L0 =0, and n−1 n A. Scenario Description i i i ≈ i i ≥ Ln = LBk + LDn LDk + BDk ,n1 (14) To estimate the master counter value from (2), estimates of k=1 k=1 the line delay and RCF value need to be available, and the i and An is the “age” of the line delay computation valid for Sync RCF and the master counter estimation processes are tightly Message i, i.e., the middle of the last line delay computation intertwined. The clock frequency drifts affect these estimates interval until the arrival of the current Sync message, upper and influence the synchronization performance. In this section, bounded by the requestor interval R introduced earlier, with we quantify these effects and compare the two scenarios where − (denoting δi,n = Li − Li 1) the master frequency stays constant, while the slave frequencies L n n i,n drift, and vice versa. Tsync + δL , if no new line Ai − Ai−1 = The frequency of all the elements is constant until t0. Then, n n delay estimate (15) i,n − the drifting elements’ frequencies linearly increase. The short- Tsync + δL R, else. term linear frequency drifts are typically temperature induced, as shown by the corresponding characteristic curves. For other C. Error in RCF and Master-Counter Estimation Due to situations, our analysis is a local first-order approximation. Master Frequency Drift for Nondrifting Slaves The frequency of an element k with constant frequency follows: For the master, (8) and (11) apply, whereas for the slaves, (7) and (9) apply. The slaves’ line delay estimates of (13) become ⎧ fk(ti)=fk(ti−1)=fk (7) j(i) R+RD ⎨⎪ · j(i) − j(i) · M · f1 LD1 RDM 4 ΔM whereas the frequency of element n whose frequency drifts Sˆ LDj(i) ≈ · j(i) − j(i),1 n n ⎪ = f1 LD1 εLD ,n=1 with slope Δn follows: ⎩ j(i) fn · LDn , else. fn(ti)=fn(ti−1)+Δn · (ti − ti−1),ti >ti−1 >t0 (8) (16)
The RCF value computed by Slave1 from the Sync message i.e., fn(ti)/fn(ti−1)=1+Δn · (ti − ti−1)/fn(ti−1). The counter value increase of each element over the time transmitted by the master at time ti is interval (t − ,t ) is the integral over the element’s frequency. M(t ) − M(t − ) i 1 i RCF i = i i 1 1 i i−1 For the constant-frequency element, this results in S (t + LD ) − S t − + LD 1 i 1 1 i 1 1 ti+ti−1 · − − · − fM (ti ti−1) Ck(ti) Ck(ti−1)=fk (ti ti−1) (9) = 2 T + LDi − LDi−1 · f 1 1 1 whereas for drifting element n, it is calculated as T fM ti − T = 2 · . (17) f i,1 ti 1 T + δLD − · Cn(ti) Cn(ti−1)= fn(t) dt Without jitter, LDi = const and δi,n =0, hence: n LD t i−1 f t − T i M i 2 Δn 2 RCF1 = . (18) = fn(ti−1)·(ti −ti−1)+ ·(ti −ti−1) . (10) f 2 1 Slave1 forwards the received Sync message to Slave2 at time Due to the assumed linearity of the frequency change, we can t + LBi and replaces the received master counter content by rewrite (10) as the product of the frequency in the middle of the i 1 its estimate at the time of transmission using (2), i.e., time interval times the length of the interval t +LBi ˆ i 1 ˆ j(i) ˆ i · i M =M(ti)+ S1 LD1 +S1 BD1 RCF1 . (19) ti + ti−1 S1out Cn(ti) − Cn(ti−1)=fn · (ti − ti−1). (11) 2 Using (16), (12), and (18), we can rewrite this as T For example, the bridge delay is approximately t +LBi fM ti − Mˆ i 1 = M(t )+ f ·LDj(i) −εj,1 +f ·BDi · 2 S out i 1 1 LD 1 1 1 f1 Sˆ BDi = f (mid Bridge Delay) · BDi . (12) n n n n f t − T i · − T − j,1 · M i 2 = M(ti)+LB1 fM ti εLD 2 f1 T + LDj(i) − LDi · f t − . (20) B. Effect of Frequency Drift on the Accuracy of the Line Delay 1 1 M i 2 Estimate in the Absence of Jitter If there is no jitter, LDj(i) = LDi , and the last term vanishes. In [13], the line delay estimate of slave n is derived to be 1 1 Assuming that the master frequency continues to increase Sˆ LDj(i) ≈ f t + Li − Ai · LDj(i) with the same slope, the true value of the master counter at this n n n i n n n time is [from (10)] j(i) j(i) R + RDn−1 t +LBi i ΔM i2 + RD · · (Δ − Δ − ) (13) M| i 1 = M(t )+f (t ) · LB + · LB . (21) n−1 4 n n 1 i M i 1 2 1
Authorized licensed use limited to: T U MUENCHEN. Downloaded on September 3, 2009 at 03:44 from IEEE Xplore. Restrictions apply. 1852 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 58, NO. 6, JUNE 2009
Comparing (21) and (20), the error at this time in the TC Hence, the error at this time in the TC transmission of transmission of Slave1 is [using (8)] Slave2 is