Professional Documents
Culture Documents
Clock Models PDF
Clock Models PDF
Etisalat British Telecom Innovation Centre (EBTIC), Khalifa University of Science, Technology and Research, UAE
{zdenek.chaloupka, nayef.alsindi, jarnes.aweya}@kustar.ac.ae
Abstract-As packet technologies like Ethernet and IP are synchronization solutions have to be tested in compliance with
becoming the dominant in modern telecommunication networks, standard [3] for long-term based stability. Such tests are
clock frequency and time synchronization over packet networks
usually performed over tens of hours of running time, however
is an active area of research. Packet networks are asynchronous
it would be convenient to obtain the simulation results in few
by design so frequency and time synchronization with sub
microsecond precision is a demanding task due to packet delay
minutes.
variations. A design of proper algorithms, that meet the This paper describes a simple and effective IEEE 1588 PTP
telecommunication requirements, usually involves simulations model that provides a precise simulation of long time periods
over long period of time with nanoseconds resolution. Such (tens of hours) in few minutes of computer time. Such model
precise and long-term simulation of synchronization performance
is essential for delivery of stable and reliable synchronization
is challenging, because of the vast amount of computer resources
solutions for packet networks.
involved. This paper describes a simulation model that is both,
efficient and highly precise. The model is able to simulate A. Literature Review
algorithms behavior over long period of time (tens of hours)
while the computation time remains within interval of few
In [4] a simulation tool for analysis of clock
minutes. synchronization in communication networks was presented.
The model of clock synchronization was based on substitution
Index Terms- clocks, frequency synchronization, IEEE 1588 of Master/Slave clocks, Phase-Locked Loop (PLL) and
PTP, time synchronization forward/backward paths by a transfer function. As it is
preferred to have full control over PLL design without the
need for deriving mathematical models, this method is not
I. INTRODUCTION
suitable. The authors in [5] investigated forwarding and
P attractive
ACKET based technologies (e.g. IP, Ethernet) are becoming queuing process of individual packets in a simple packet
alternatives to traditional Time-Division network. With simulation sampling period of 1/-ls and
MUltiplexing (TDM) technologies, because of their higher simulation time of 5s the model required packet sampling rate
efficiency with significantly less capital involved. The recent to be 20.000 per second in order to get exploitable results.
advances in high-speed switching/forwarding made it possible Such packate sampling rate is unrealistic (refer to settings of
to build networks with joint voice, video and data standardized synchronization protocol [1]) and the model
transmissions. sampling period is inadequate (we require sub-microsecond
Current TDM networks are designed with respect to the resolution). In [6] Q. Yujuan derived model for OPNET
synchronization requirements of the voice/data services. Thus, Modeler based on NTP, but the paper didn't give any
the TDM networks have embedded tlmmg transfer specifications regarding the clock precision settings. [7]
capabilities. Contrarily, packet networks such as Ethernet and studied the performance of IEEE 1588 PTP protocol with
IP are asynchronous and do not have such aptitude. In order to transparent clocks. A combination of Matlab and PROFINET
be able to substitute TDM networks with packet networks (and tool was used for simulation. Although the results presented
packet technologies) for telecommunication services, timing are with sub-microsecond precision, the simulation run times
transfer and synchronization have to be provided by other were very short (60 seconds). The paper didn't provide any
means. Two commonly used protocols for timing distribution information about simulation model. In [8] T. Kunz et al.
are the IEEE 1588 Precision Time Protocol (PTP) [1] and the presented clock synchronization in WSN, where the sensor
Network Time Protocol (NTP) [2]. As the time and frequency clock sampling time is based on 32.767 kHz oscilator which
synchronization technologies and devices are subject to brings time resolution of approximately 31 f.!S and thus the
stringent demands that require sub-microsecond precision [3] model does not fulfill the stringent sub-microsecond resolution
we are primarily targeting the IEEE 1588 PTP protocol, requirements [3]. Another IEEE 1588 PTP simulation
because it provides better resolution (sub-nanosecond [1]) than experiment was carried out in [9]. Authors implemented and
NTP (millisecond [2]), although the definition of our simulated complete IEEE 1588 PTP protocol in OMNeT++
simulation model should be easily transferred to a different simulator and investigated the behavior of end-to-end clock
timing distribution protocol (e.g. NTP). Generally, synchronization in packet networks. The paper lacks detailed
information about simulation running times, and the subscript refers to the PTP protocol timestamps generated by a
simulation was clearly aimed to show real time behavior. Master (Tj, T-I) or Slave (T2' T3) clock. Variables that change
Thus, long time simulations are impractical with such model. discretely with respect to a set of message exchange are
In [10] a simulation model for clock synchronization based denoted as Tj[n] and Tj[n+l], where the former is n-th and
on IEEE 1588 PTP protocol was derived. The model is based latter (n+1)-th discrete state related to the n-th and (n+1)-th set
on mathematical representation of the clocks, thus high of messages respectively. Lower case letter t stands for
precision is granted. However, the paper is focused more on reference (ideal) time. Capital N refers to number of observed
PLL behavior than model efficiency and implementation, set of PTP messages. Tpck is SYNC message send interval
though the simulation run times (12000s) are longer than in always measured by a Master clock. Superscript M, S next to a
any other reviewed paper. variable denotes that the variable is clocked by the Master,
In this paper we extended the work presented in [10]. Our Slave counter respectively. Other symbols are explained next
main contributions are as follows: to the equation that uses them.
1) We extended the model definition presented in [10] to a
Slave Clock Master Clock Ideal Time
more general case (see Section II).
2) A discussion on the model's precision is completely
T,[nl
omitted in [10]. This paper gives a thorough discussion on
the model precision in Section III.
3) A design of the model and its effectiveness (in terms of T2[nl
simulation speed) are not discussed in [10]. An easy-to
understand design of the model as well as the
performance evaluation of the model (see Section III) is c
(;j
revealed in this paper. <I
The reminder of this paper is organized as follows. Section
II derives a simulation model with respect to the IEEE 1588
PTP protocol. Section III investigates the model precision and
effectiveness. Finally, Section IV highlights the conclusions
CS[n+11
drawn from the work and discusses future work.
--
T2[n+11
�__ :' i\)_:ii
+1
--:(::n:: S y-;n�
th�s. c I T,[n+11
II. SIMULATION MODEL
80
2013 IEEE 18th International Workshop on Computer Aided Modeling and Design of Communication Links and Networks (CAMAD)
• • • •
1 1 1 1
r r 1
• 1 1 1 Messages
1 1 1 1
I 1 1 1
Tp,' Tp,' Tpc'
I
I
1
1
1
1
1
1 Fig. 3. An example of synchronization setup in packet network using
I I I I i boundary clocks; M, S stands for Master, Slave respectively. Boundary
� �
1 I I
• ...
1'.,["] I 1'., [II + I] " 1'.,[II] I 1'.,[11+2] I Master clocks may be skewed from the ideal time due to limited
I I I Ideal •lime precision of the Master's counter oscillator.
IR,n tR,n+1 tR,n+2 tR,n+3
The Slave device receives SYNC message at time T2[n]
• • • •
1
•
1
I.
1
1 •
1
1 measured by the Slave's clock counter CS. Every timestamp T2
r
I 1 : 1 1
I 1 : 1 1
is delayed behind the time of SYNC message transmission by a
Tp,'
1 : 1 1
Tp,'
I
1 1 : 1 1
I 1 1
i
I
IiI 1
i
I
I
�
I
forward delay 8, that is the time spent to travel the distance
1'.,[11]=1'.,[0] 1'.,[0] between the Master and Slave device. We define timestamp T2
Ideal lime
T",.
I
=
•
IR,n tR,n+1 tR,n+2 tR,n+3 . . . .
Fig. 2. A relation between the ideal time (dash dot), the Master (5)
(dotted) and Slave (dash) clocks. The upper case is for inaccurate
Master (faster than the ideal time).
i[n] is the forward delay measured by the Slave clock.
Upon receiving the SYNC message the Slave device sends
The bottom part of the Fig. 2 reflects the situation when the
DELAY_REQ message at time Tj[n]. Timestamp Tj is delayed
Master clock is aligned with ideal time. Thus, the constant
behind T2 by a processing delay A[n],
Tpck. measured by the Master clock, equals fi" measured by the
ideal time. Contrarily in the upper part of the Fig. 2, fit
measured by the ideal time is changing for each packet. As we � [n]=T2 [n] + AS [n]= CS [n] + £s [n] + AS [n]. (6)
assume the frequency of the Master's clock counter to be
known, computation of fit for ideal time is as follows The Master device receives DELAY_REQ message at time
T�[n], that is delayed behind TI by a sum of the forward,
j�
'TpCk' n =l..N.
processing and backward delays (measured by the Master
fi,[n]=tR,n-tR,n_l = (2)
clock). We define T� as follows
j�[n]
We assume that the reference frequency IR is constant T4 [n]= T., [n] + £M [n] + AM [n] + yM [n]. (7)
whereas the Master's frequency 1M can change between
consecutive packets, hence the discrete notation. Similarly to The Master device responses with DELAY_RESP message
(2), the amount of time that passes between two consecutive that carries timestamp T-I back to the Slave device. At this
SYNC messages at the Slave clock site is exactly specified by stage the Slave device possesses a complete set of timestamps
a ratio between the reference and Slave clock's frequency and {h h Tj, T�}.
time between two consecutive SYNC messages measured by Let us assume for this moment that the forward/backward
ideal time (see Fig. 1), that is and processing delays were measured by the ideal time (refer
to next chapter for details). In order to use these delay values
in (5)-(7) we need to convert them into the Master/Slave clock
(3) time representation. Similarly to (2) or (3), the time that passes
for the Master/Slave clock with respect to ideal time is exactly
given by the ratio between the Master/Slave clock frequency
Hence, we can define the Slave's clock counter time as and the reference frequency. We can write
(4)
(8)
81
2013 IEEE 18th International Workshop on Computer Aided Modeling and Design of Communication Links and Networks (CAMAD)
required. The processing delay can be simulated by one of the Taking into account (1)-(8) the maximum time precision of
well-known distributions (e.g. normal distribution). Simulink model is limited only by a numerical resolution of
The above definition of statistical characteristics of variables inside the model. The obvious precision bottlenecks
forward/backward and processing delays gives us full control are the frequency division (3), (8) and integration (4). If we
over the model variables as the generation of a random use system with 8byte floating representation maximum
variable from known probability distribution is attainable resolution is T53 (i.e. 1.12x 10.16) second. To
straightforward. Since the generation of the random variables confirm the sub-nanosecond resolution of the proposed model
is independent on the Master/Slave clock, the generated delay its precision was tested as follows. We set the forward,
values are measured by ideal time, hence (8) applies. backward and processing delays to zero. The initial offset of
The model was implemented in Matlab Simulink R2012a the Master and Slave clock is zero, the Master clock is
because Matlab itself is simply not efficient with loops. considered equal to the ideal time (i.e. the!R equals!M[n] for
Anyway, we suppose that the simplicity of the derived model each n) and Is is arbitrary. Hence the relation between
makes it easy to implement in any programming language. timestamps of the Master and Slave clock can be written as
Simulink block design for the generation of the timestamps is
on the Fig. 4. r; [ n] + £ [ n]= (1 + a [ n]). T2 [ n] + () [ n]. (9)
clock
fM,S---� As mentioned above the variables c and e are set to zero in
fR (9). The variable a (called skew) is defined as a ratio between
the Master and Slave clock frequency, that is
Plain clock
82
2013 IEEE 18th International Workshop on Computer Aided Modeling and Design of Communication Links and Networks (CAMAD)
IV. CONCLUSIONS
83