Clock Synchronization in Wireless Sensor Networks : Analysis and Design of Error Precision Based on Lossy Networked Control Perspective

Motivated by the importance of the clock synchronization in wireless sensor networks (WSNs), due to the packet loss, the synchronization error variance is a random variable andmay exceed the designed boundary of the synchronization variance. Based on the clock synchronization state space model, this paper establishes the model of synchronization error variance analysis and design issues. In the analysis issue, assuming sensor nodes exchange clock information in the network with packet loss, we find a minimum clock information packet arrival rate in order to guarantee the synchronization precision at synchronization node. In the design issue, assuming sensor node freely scheduleswhether to send the clock information,we look for an optimal clock information exchange rate between synchronization node and reference node which offers the optimal tradeoff between energy consumption and synchronization precision at synchronization node. Finally, simulations further verify the validity of clock synchronization analysis and design from the perspective of synchronization error variance.


Introduction
From the present study [1], the purpose of establishing various models of the clock synchronization is to design a more optimized synchronization algorithm and improve the synchronization precision.For the analysis of synchronization precision, the studies focus on estimating the clock parameters; at the same time, deeply analyzing the synchronization error variance is also worthy of attention.For the network without packet loss, existing studies offered the quantitative equation of the synchronization error variance, which can be determined offline.Various optimized synchronization algorithms are aimed at decreasing the synchronization error variance as far as possible.However, due to the randomness of packet loss, the synchronization error variance is a random variable [2].For given applications, the variance maybe exceeds the designed boundary of the synchronization variance.This brings serious hidden peril for wireless sensor networks.
Therefore, this paper researches clock synchronization problems from the point of the synchronization error variance.How does packet loss affect the synchronization error variance?Can packet loss in the existing network satisfy the requirements of the synchronization precision?How to reasonably improve synchronization precision with a limited resource?It is the following cases that are common but not efficiently solved in reality.
For a wireless sensor network with packet loss, packet loss has a serious influence on clock parameters estimation of the synchronization node.The more the packet is lost, the larger the estimation error of clock parameters is and the lower the clock synchronization precision is.And due to the randomness of packet loss, the synchronization error variance is a random variable.Further, different sensor networks have different requirements of synchronization precision according to the different application backgrounds.So can packet loss in the existing network satisfy the requirements of application background?For the synchronization error variance analysis issue, we look for a minimum clock information packet arrival rate in order to guarantee the precision requirement at synchronization node.
Assume there is no packet loss in sensor network but the sensor node freely schedules whether to send the clock information.The more the clock information is exchanged, the higher the synchronization precision is, while the more the corresponding energy is consumed.We expect that the sensor nodes can consume as little energy as possible.At the same time, we hope that the clock synchronization is as highly precise as possible.At this point, it is important to consider how to set up network parameters in order to achieve the optimal tradeoff between energy consumption and synchronization precision.For the synchronization error variance design issue, we look for an optimal clock information exchange rate between synchronization node and reference node, which offers the optimal tradeoff between energy consumption and synchronization precision at synchronization node.
For the issue of clock synchronization, early studies focus on the design of protocols, such as the Time Synchronization Protocol for Sensor Networks (TPSN) [3], the Reference-Broadcast Synchronization (RBS) [4], the Flooding Time Synchronization Protocol (FTSP) [5], and the Pairwise Broadcast Synchronization (PBS) [6].Other researches optimize the classical protocols, such as [7][8][9].In [1], clock synchronization of WSNs is modeled and analyzed by following a signal processing viewpoint in various network delay distributions.At present, the latest research proposes a distributed algorithm, which is scalable with network size.Reference [10] models the accumulated clock offset and skew as the evolution model and proposes a distributed Kalman filter algorithm.The algorithm only requires each node to exchange limited information with its direct neighbors and thus is robust to changes in network connectivity.Reference [11] estimates clock parameters of the global network from the perspective of probability distribution based on belief propagation and puts forward a full distributed algorithm which adopts asynchronous way and does not require any centralized information processing or coordination.In addition, [12] introduces two kinds of control strategy based on the state space model of the clock synchronization.From the perspective of network control, the literature improves the synchronization precision and speeds up the convergence of the synchronization.But these studies rarely analyze the random distribution of the synchronization error variance, let alone the analysis and design issues of the synchronization error variance beyond the designed boundary of the synchronization variance (or the probability of the synchronization error variance beyond the designed boundary of the synchronization variance).In order to solve, analyze, and design issues put forward above, this paper analyzes the clock relationship based on the two-way information exchange mechanism between the nodes in WSNs.Then regarding fixed delay and clock offset as unknown parameters and using the clock synchronization state space model, the paper establishes the model of synchronization error variance analysis and design issues.
The existing literatures of network control theory have carried on a large number of early-stage studies of network control theory model which proved to be effective.References [13,14] introduce problems of the state estimation and stabilization of a LTI (linear time invariant) system with finitecommunication bandwidth constraints.Reference [2] shows that there exists a critical rate of packet arrivals below which the modified Kalman filter diverges and converges otherwise.Reference [15] evaluates the performance of the estimator subject to packet loss from the perspective of probability.Reference [16] considers the presence of observation packet loss and shows the error variance of the minimum mean square error of estimate is less than that of the linear minimum mean square error estimation and the former has wider application.In [17], author describes packet loss as two-state Markov chain process and analyzes the problems of Kalman filter in this case.Reference [18] improves the statistical stability and performance of Kalman filter over a large set of packet loss using multiple description coding.Reference [19] extends the theoretical results in [2] to closed loop control and points out that when the separation principle holds, the optimal linearquadratic-Gaussian (LQG) controller is a linear function of the estimated state; when the separation principle does not hold, the optimal LQG controller is in general nonlinear.These theoretical achievements offer great reference value for analyzing the clock synchronization issue.In view of this, based on the unified framework of the clock synchronization state space model, this paper researches the synchronization error variance analysis and design issues from the perspective of the unified framework of network control.
In this paper, the major contributions are as follows.
(1) By analyzing the clock relationship for the two-way information exchange mechanism in wireless sensor network and based on a unified framework of the clock synchronization state space model, we discuss the analysis and design issues between the synchronization error variance and packet loss rate.
(2) In the analysis issue, we prove that the steady-state error variance of Kalman filter in the statistical property is a monotonically decreasing function of packet arrival rate.Then we find a minimum clock information packet arrival rate by an efficient bisection search algorithm in order to guarantee synchronization precision at synchronization node.
(3) In the design issue, we establish a performance metric between energy consumption and synchronization precision at synchronization node.Then we obtain the optimal solution form of clock information exchange rate in order to achieve the optimal tradeoff between energy consumption and synchronization precision at synchronization node.
This paper is organized as follows.In Section 2, regarding fixed delay and clock offset as clock state variables, clock synchronization system models are established.Section 3 puts forward mathematical model of the synchronization error variance analysis and design issues.Some preliminaries are represented in Section 4. In Section 5, the proposed analysis issue is researched in detail.In Section 6, the proposed design issue is researched in detail.Some examples are given in Section 7. Finally, Section 8 discusses the future work and Section 9 summarizes the paper.

System Modeling
We consider the clock synchronization problem between two nodes.Referencing TPSN [3] synchronization protocol, we also adopt the classical mechanism [1,3,20] of two-way message exchange between two adjacent nodes, which is depicted in Figure 1.And in this figure, we consider that Node A needs to be synchronized to reference Node B. Assuming timing messages are exchanged  times, in the th round of message exchange, Node A sends a synchronization message which carries In the paper, most of basic values we used are listed in Value Definition.And there are three points emphasized.
(1) Assume that   and   obey the independent identically distributed (i.i.d) Gaussian distribution due to the central limit theorem.We take  simples from an arbitrary and i.i.d totality with mean  and variance  2 .When  is large enough, the sampling distribution of sample mean approximatively obeys normal distribution with mean  and variance  2 /.If the delay is the addition of innumerable independent random process, the delay obeys the Gaussian delay model.And the test [4] showed that the variable delays can be modeled as Gaussian distributed random variables with 99.8% confidence.
(2) Assume that the size of data packet which includes the clock message exchange between two nodes is generally equal, and the transmission rate of data packet is the same, so there are the same transmission time and reception time between two nodes.Moreover, propagation time is decided by the distance between two nodes.Suppose that the relative position between two nodes does not change in the process of information exchange, so propagation time keeps invariable.
(  () has no obvious changes in one synchronization period.From the point of control theory, the relative skew () can be processed by system identification parameter estimation.(b) References [8,9] presented the statistical signal processing approaches estimating the clock skew under known fixed delay and unknown fixed delay.The approaches adopting signal processing technology not only apply to the case where the variable delay is the Gauss distribution, but also apply to the case where the variable delay is the exponential distribution.(

Clock Synchronization
To present the linear relationship between  and , we transform the above equations into state space model: Equation ( 3) can be further simplified to where   =  2, / −  1, and   =  4, −  3, /.Define so (4) can also be written as In this paper, the random delay obeys independent identically distributed Gaussian distributions, which have been confirmed above, so it is assumed that its mean is zero and correlation matrix of the covariance is [     ] =  > 0, which is a diagonal matrix.
For (6), we describe all parameters as follows.
(1) We regard two unknown parameters, fixed delay  and relative clock offset , as clock synchronization state  between synchronization node (namely, Node A in Figure 1) and the reference node (Node B in Figure 1).
(3) Affected by the variable delay between nodes, the measurement information  ∈ { 1 , . . .,   } cannot accurately reflect the fixed delay and relative clock offset information, and the error covariance is   .This is equivalent to the fact that we measured unknown things and the measurement information affected by instruments, environment, and methods of measurement has some errors with the true values.We call the errors measurement noises.
To sum up, (6) is described as follows.When measuring the unknown state   , measurement   (time-stamp information { 1, ,  2, ,  3, ,  4, }) is influenced by the noise   (the variable portion of delays).In this paper, the equation is treated as the measurement equation.
Next, we analyze the unknown state .
(1) The state  is a two-dimensional vector and includes two unknown parameters, which are fixed delay  and relative clock offset .
(2) Clock model of sensor node is a linear function of time ,   () =  +  ⋅  [1], where  and , respectively, represent clock offset (phase difference) and clock skew (frequency difference).Modeling the clock relationship for the first order linear function is mainly due to neglecting the effect of clock drift on the clock.Clock drift (variation of the clock frequency), which reflects the stability of crystal oscillator, is the second derivative of the clock.So it has little influences on clock, and we may ignore its influence.
(3) In addition, fixed delay between nodes including transmission delay, propagation delay, and reception delay is related to the power of transceiver, the length of data packet, and the distance between the nodes.Generally, it can be considered to be fixed within one round of time-stamp exchange.
Considering the three aspects above, we assume that the state of clock synchronization between synchronization node and the reference node changes slowly, and the present state linearly relates to the state in previous time instance [19,21,22].Therefore, unknown state is built as a Gauss-Markov dynamic model: where interference part  −1 is modeled as a Gaussian distribution with mean zero and correlation matrix [     ] =  ≥ 0. Assume that the initial state  0 also obeys the Gauss distribution with mean zero and covariance  0 .In order to facilitate the subsequent research, ( 7) is rewritten into Of course, matrix  is an identity matrix.We call (8) the system state equation of clock synchronization between synchronization node and the reference node.
We need to explain that the coefficient matrix , measurement matrix , and the variance of noises  and  in the model are assumed to be known and fixed.It is convenient to the analysis and study.But in the actual environment, the network is complex and changeable, and the local clock is easily influenced by environment and other unpredictable interference, and so forth, so it needs to make the corresponding adjustment according to the actual situation.In the paper, the constant coefficient is treated as an example, without generality.
Above we build the clock synchronization state space model of synchronization node and the reference node, where two nodes are not isolated but are regarded as a whole, forming an orderly system.So, from the point of system, clock synchronization process based on two-way information exchange of sender-receiver can be interpreted as follows (shown as in Figure 2): establish the unknown state   ; then by sending a synchronous request, obtain the measurement information   of unknown state; finally, according to the measurement information, estimate the unknown state and revise the clock of node.

Latest Developments in the Clock Synchronization State
Space Model.Reference [10] established the accumulated clock offset and skew evolution model and expanded the model to sensors network with multiple nodes.Reference [10] presented a distributed Kalman filter algorithm for the clock parameters of the entire network node tracking (the clock skew and clock skew).The model is easy to expand the network size, is robust to changes in network connectivity, and can maintain long-term precision of clock parameters.
The state space model established above (( 6) and ( 8)) and the state space model of [10] have a similar form, but there are still some differences.(a) In this paper, the state vector is a matrix form about the relative clock offset and fixed delay, and, in [10], about the clock skew and accumulated clock offset.(b) In this paper, measurement model ( 6) directly considers the clock skew, and, in [10], the localized timestamp measurement model considers the relationship between the timestamps and the accumulated clock offset.(c) In the paper, the clock offset of the model is relative to neighboring node B (reference node) A (synchronization node)

System
Estimator Observation and in [10] the clock relationship is between one node and the only reference node in the entire network.Among literatures about the clock synchronization, there is little study related to synchronization error variance analysis and design issues proposed in this paper.In addition, variety and complexity of large-scale networks take some difficulties for synchronization error variance analysis and design issues presented in the paper.However, [10] proposed an efficient algorithm to solve the clock synchronization problem of large-scale and distributed network.Therefore, in order to simplify the study of problem and go deep into the essence of problem, the paper firstly uses two nodes as a springboard and focuses on discussing the effect of packet loss on the synchronization error variance in detail, which includes analysis and design of synchronization error variance.After strictly discussing two nodes, we are extending the result to the network with many nodes based on [10].

Clock Synchronization State Space Model under Intermittent Observation.
As above, we have regarded fixed delay and relative clock offset as the unknown parameters and established state space model, but the introduction of wireless network brings many unreliable factors for clock synchronization, such as network delay and packet loss.Obviously, exchanging clock synchronization information must be affected by these uncertain factors.Thereby the estimation of clock synchronization parameters is affected.In this paper, due to adopting the clock synchronization mechanism of two-way message exchange, where one round includes the exchange message which two nodes send to each other, as long as there is one time of communication failure between two nodes, this round is thought of as exchange of failure, namely, packet loss, shown as in Figure 3.If the timestamp information { 1, ,  2, ,  3, ,  4, } arrives at Node A, we think that the information exchange is successful.That is to say that Node A receives the measurement information   successfully.
In the following, we will consider how to modify models ( 6) and ( 8) in two cases mentioned above; namely, Node A receives intermittent observations.
In the first case, as shown in Figure 3, network packet loss is considered.Let   be the random variable indicating whether measurement information   is dropped at time  or not, so   = 0 if the packet is dropped and   = 1 otherwise.We assume   is an i.i.d Bernoulli random variable [23][24][25] with (  = 1) = . represents the probability that the timestamp information arrives at Node A, in short packet arrival rate.
In the second case, there is no packet loss in sensor network.Measurement information always successfully arrives at Node A, but in one round of clock information exchange, there is a fixed unit energy Δ.Let   be the random variable indicating that Node A freely schedules whether it exchanges clock information at time  or not, so   = 1 if Node A exchanges clock information and   = 0 otherwise.It is similar to the first case that we assume   is an i.i.d Bernoulli random variable with (  = 1) = .Herein,  represents the probability that clock information is exchanged between Node A and Node B in one period of the clock synchronization, in short the packet exchange rate.
From the above description,  represents different meanings in the two cases.But in fact, we may transform the angle and we can uniformly think two cases are equivalent from the perspective of absence of clock information.
Therefore, for the two cases have been mentioned above, we modify clock synchronization state space models (6) and ( 8) and obtain the following clock synchronization state space model with intermittent observations: Describing packet loss, we have also considered other forms of description.For example, for the clock synchronization mechanism of the two-way message exchange between Mathematical Problems in Engineering  two nodes, in every step the observation equation includes two times of message exchanges.If, in every one-way message exchange between two nodes, events of packet loss are independent of each other, the probabilities are not necessarily equal to each other, so we may use a matrix to describe communication situations, and it is given by where   and   are the Bernoulli random variables, respectively, indicating whether a packet is dropped from Node A to Node B or not and whether a packet is dropped from Node B to Node A or not, and their ranges are 0 and 1.In the process of communication, as long as |  | = 1, message exchange is successful; otherwise it is dropped.Also event of packet loss was built for the Markov chain model [17].But no matter how we build the model of packet loss, we still adapt the form described in (10), because it is more simple and it abstracts the event of packet loss.
So far, we have established the clock synchronization state space model under intermittent observation, tracking clock state.However, due to the randomness of packet loss, the synchronization error variance is a random variable, which maybe exceeds the designed boundary of the synchronization variance.This does not make some applications depending on clock consistency work normally.Thus, we will discuss the analysis and design issues between the synchronization error variance and packet loss rate based on a unified framework of the clock synchronization state space model in the following work.

Synchronization Error Variance Analysis and Design
In Section 1, we have introduced that this paper researched clock synchronization issues from the point of the synchronization error variance.On the one hand, in the packetdropping network, the synchronization error variance is a random variable.Existing studies about the clock synchronization primarily focused on the design of the synchronization estimation algorithm to improve the estimation error variance.But they rarely analyze the random distribution of synchronization error variance, let alone the analysis and design issues of synchronization error variance beyond the designed boundary of the synchronization variance (or the probability of synchronization error variance beyond the designed boundary of the synchronization variance).Therefore, the research on synchronization error variance is more necessary.On the other hand, the different application backgrounds have different requirements for synchronization error variance in reality.How could we ensure that the synchronization error variance is within the designed error variance border?How could we reasonably reduce the synchronization error variance with a limited resource?Thus, the research on synchronization error variance also has practical significance.
In the following, we begin to analyze two cases mentioned above in this paper.
Firstly, we define the following synchronization state qualities at synchronization node: The random variable   is 0 or 1, representing whether the synchronization node has received the measurement information   .The matrix   is the state estimation error variance, reflecting the estimation precision.The error between estimation state x and actual state value   is smaller, while   is smaller.
Because clock state   contains clock error between two nodes, the estimation value x is much closer to actual value   , which means that the estimation value of clock error is more precise.So, after adjusting, the synchronization error between two nodes is smaller, namely, the higher synchronization precision.Thus, the state estimation error variance matrix   could reflect synchronization precision, that is, the synchronization error variance in this paper.

Synchronization Error Variance Analysis.
In the first case, for a wireless sensor network with packet loss, packet loss has a serious influence on clock state estimation of the synchronization node.The more the packet is lost, the greater the estimation error for the synchronization node is and the lower the clock synchronization precision is.Further, each of the sensor networks has different requirements of synchronization precision according to the different application backgrounds.When the clock synchronization error variance cannot meet the requirements of the desired precision, the network cannot guarantee the normal operation.Thus, if the network packet loss is too large, the synchronization error variance may exceed a desired variance boundary.At this time, we attempt to judge whether the conditions of existing network can meet the requirements of the desired synchronization error variance or not.
The description of packet loss is as the introduction in the first case of Section 2.3.Assume that we can observe the probability that clock information packets in network arrive at the synchronization node, and tentatively consider it is  0 .And the desired clock synchronization precision (the desired synchronization error variance) is  desired .Due to the introduction of random variable   , the estimation error variance of the synchronization node is also a random variable (shown in Section 4.1).It is because   is a random quantity due to the randomness of   , the synchronization error variance may go beyond the desired boundary of the synchronization variance.And because the value of   cannot be obtained offline, the statistical properties of the error variance are considered in this paper.
Particularly, we are interested in the following questions.
Question 1 (synchronization error variance analysis).For any given synchronization precision  desired > 0, find a minimum packet arrival rate  min , satisfying lim where  is the times of clock information exchanges in one period of synchronization.
As to the problem, we will begin with the following critical questions.
(1) Because the exact value of lim  →  [  ] is difficult to obtain, we discuss the certain upper boundary of lim  →  [  ] when  → ∞.
(2) Judge the relationship between the upper boundary and packet arrival rate.
(3) Look for the minimum packet arrival rate using a search algorithm.

Synchronization Error Variance Design.
In the second case, there is no packet loss in sensor network, but the synchronization node freely schedules whether it exchanges clock information with the reference node.The more the clock information is exchanged, the higher the synchronization precision is, while the more the corresponding energy is consumed, which is not expected for sensor node whose energy is limited.So, for the sensor node, the energy consumption and synchronization precision are mutually restricted.At this point, how should we set up the network parameters to achieve the optimal tradeoff between energy consumption and synchronization precision at the synchronization node?
In this issue, the detailed description of the unit energy consumption Δ and the clock information packet exchange rate  is introduced as the second case in Section 2.3.
Then, we will research the following questions.
Question 2 (synchronization error variance design).Find an optimal clock information packet exchange rate between synchronization node and reference node, minimizing (minimizing the trace) where the first part represents the limitation of mean estimation error variance during the synchronization; the second part represents mean energy consumption during the synchronization process.
As to the problem, we will begin with the following critical questions.
(2) Prove that there exists the minimum of the mathematical model ( 14).
(3) Obtain the solution form of the optimal clock information exchange rate that minimizes the mathematical model (14).

Preliminaries
As can be seen from the analysis of the above two sections, the key in the clock synchronization process is that, according to measurement   received, the synchronization node estimates an unknown clock state   with the reference node and then corrects the local clock, making it consistent with the reference node.Therefore, the estimation error variance determines the precision of the clock synchronization.For the two issues in the paper, we define the criteria with state estimation and estimation error variance as shown in (12).

Kalman Filtering under Intermittent
Observations.In the case of   = 1, it is obvious that the standard Kalman filter is the optimal linear state estimation, for the clock synchronization state space models ( 9) and (10), where state estimation process is divided into two steps, namely, innovation step (prediction step) and correction step (update step).It is easy to write the recursive formula of standard Kalman filter [26].However, for the two issues of the paper, it is not really that the synchronization node gets all of the clock information   .When some of   are lost, it will affect the state estimation of the synchronization node.Reference [2] showed that the Kalman filter is still the optimal linear estimator in the setting when possibly   = 0.It is different from the standard Kalman filter that only the innovation step is performed when a measurement packet is dropped.And the modification of the Kalman filter equations is given as follows: Unlike the standard Kalman filter where   is deterministic for any given initial value  0 , the randomness of the packets loss   makes   a random variable as well.

Kalman Filtering in the Statistical
Property.Since {  }  1 is a random sequence, the estimation error variance matrix   is also stochastic and cannot be determined offline.In this paper, the statistical properties of the error variance are considered.For the modified Kalman filter, the estimation error in the statistical property can be expressed as where [  ] =  represents the expectation of random sequence {  }  1 .In Question 1 (clock synchronization analysis issue),  indicates the clock information packet arrival rate, while in Question 2 (clock synchronization design issue), it denotes the clock information packet exchange rate.
The steady-state error variance about ( 21) is defined as Now the concept of asymptotic stability in the error system is extended to the case containing packet loss.The definition of asymptotic stability in the error system is given in the statistical property.Definition 1.For the expectation  with a given random sequence {  }  1 , if the state estimation error (21) in the statistical property is Lyapunov asymptotically stable, it is called that the state estimation error (18) of Kalman filter in the statistical property is asymptotically stable, and the corresponding steady-state error covariance of Kalman filter  satisfies In order to solve synchronization error variance analysis and design issues in this paper, we need to use a basic conclusion.
Consider the following function: Lemma 2 (see [27]).Under intermittent observations, there is a Kalman gain  which makes the system asymptotically stable, if and only if inequality of the matrix variable   >  (, ) exists positive-definite solutions.And steady-state error variance  of corresponding  satisfies where Ω() = { |  > (, ),  > 0}.
Since Kalman filter is the optimal linear estimator, the error variance  of which is minimum, it satisfies  <  for all (, ) ∈ Ω = {(, ) |  > (, ),  > 0} and  is the infimum of Ω.And the corresponding Kalman gain is  kal .

Definitions of Notation.
In order to facilitate the following study of synchronization error variance analysis and design issues, the related formulas and notation are simplified in this section.Suppose (, , , ) is the same as described in Section 2. If the matrix  is positive definite, we write  > 0. We define the following functions as [15] ℎ () ≜   + , g () ≜  −   (  + ) −1 ,  () ≜ g (ℎ ()) . ( Compared with the standard Kalman filtering, it can be easily seen that the function ℎ is a prediction step function of estimation error variance in the standard Kalman filter.And the function  represents an update step function of estimation error variance in the standard Kalman filter.
Therefore, estimation error variance equations of the standard Kalman filter can be expressed using the abovedefined function as follows: Steady-state error variance  of the modified Kalman filter can be written as Namely,  is the unique solution of the following equation:

Synchronization Error Variance Analysis
In this section, we consider Question 1 (synchronization error variance analysis issue) shown as the description in Section 3.1.Firstly, we consider the limited case  → ∞.It is mainly because the time of clock information exchanges is not determined in the process of synchronization and depends on two aspects: the design of synchronization algorithm and the setting of the desired synchronization variance.On the one hand, using high precision synchronization algorithm, the time of clock information exchanges is smaller.On the other hand, if the requirement of synchronization precision is different, the time of clock information exchanges is also different.In fact, there exist some limitations when discussing  → ∞, but it has great value of the theoretical research.( However, unfortunately, it turns out that the exact value of [  ] is difficult to find ever for scalar systems [2]. (1) But we can find the upper bound of [  ] as follows: where the first equation is obtained due to the property of conditional expectation, and the inequality is because () is a concave function of  (Lemma 1-e [2]) and Jensen inequality is used.
According to (29), it can be seen that steady-state error variance   in the Kalman filter is the unique solution to the following equation:

𝑋 = (1 − 𝜆) ℎ (𝑋) + 𝜆𝑔 (𝑋) .
(32) Use induction for inequality (31) and the limit is taken (proof process in detail appears in Appendix A), so it is easy to get lim (2) According to (33), only if we look for the minimum clock information packet arrival rate  min , satisfying will be guaranteed.
To sum up, for  → ∞, the synchronization error variance analysis issue is equivalent to looking for the minimum clock information packet arrival rate  min , making (3) Then, we need to determine the function relationship between   and  such that the minimum clock information packet arrival rate  min is found.

Theorem 3. For any given clock information packet arrival rate 𝜆 ∈ [0, 1], steady-state error variance 𝑃 𝜆 of the Kalman filter is a monotonically decreasing function of 𝜆.
Proof.For the packet arrival rate  1 and Kalman gain  1 , the steady-state error variance   of the Kalman filter satisfies the following equation (from ( 23)): For the Kalman filter, the steady-state estimation error variance is less than or equal to the estimation error variance of prediction step, that is, For any  1 <  2 , If the above inequality takes the equality, it shows   is equal in the case of  1 and in the case of  2 , so   1 =   2 .If the inequality excludes the part of the equality, then According to Lemma 2, we know in the case of packet arrival rate  2 any solution (, ) of the inequality has   2 < .This is because the Kalman filter is the optimal linear estimator and is the minimum value of all of the solution space above.
Contrasting inequalities (39) and (40), it can be seen that (  1 ,  1 ) is a set of solutions at a packet arrival rate  2 , so we judge   1 >   2 . 2 is the Kalman gain in the case where packet arrival rate is  2 .
Therefore, the steady-state error variance   of the Kalman filter is a monotonically decreasing function of packet arrival rate .
(4) Because   is a monotonically decreasing function of , where  ∈ [0, 1], for any given  desired > 0, the minimum  min , which satisfies can be efficiently found through the bisection search algorithm.The bisection search algorithm is a common search algorithm which has the good characteristic of search speed and mean performance.The specific idea of the algorithm can be found in [28].

Synchronization Error Variance Design
During the synchronization process, increasing the transmit power of sensor nodes can reduce the packet loss rate, and the synchronization nodes can obtain more clock information, so the estimation of clock parameters will be more accurate at the synchronization node.However, increasing the transmission power increases the corresponding energy consumption of the sensor nodes.
Since the transmission power of sensor node has an impact on the packet loss rate and packet loss rate also affects the synchronization precision, how should we adjust transmission power of sensor node to make the clock synchronization estimation variance as small as possible?In other words, if there are multiple levels of transmission power, how should we schedule the transmission power of sensor node in order to improve synchronization precision as soon as possible with limited energy?At this point, in order to improve synchronization precision as much as possible, we will design the optimal transmission power scheduling sequence with the restriction condition of limited energy.
It is as any research which needs a gradually in-depth process that, in order to achieve the purpose, we firstly need to fully understand the relationship between energy consumption and synchronization precision and, after all, the energy consumption and synchronization precision are mutually restricted.The more the clock information is exchanged, the more the corresponding energy is consumed, while the smaller the estimation error is.The different application backgrounds have different requirements for synchronization precision in wireless sensor networks and have different restrictions of the energy.The ideal situation is that we can achieve high synchronization precision and do not consume too much energy.Therefore, in order to further have more indepth understanding of the mutually restricted relationship between energy consumption and synchronization precision, we firstly treat energy consumption and synchronization precision with the same importance in the paper.After comprehending the essential relationship between both, we will further extend to the generality.
So, this paper firstly discusses the case where there is no packet loss in sensor networks, but the synchronization sensor node freely schedules whether it exchanges clock information with the reference node.Assuming the energy consumption in one round of clock information exchange for sensor nodes is fixed, the more the clock information is exchanged, the higher the synchronization precision is, while the more the corresponding energy is consumed.On the one hand, we expect that the sensor nodes can consume as little energy as possible; on the other hand, we hope that the clock synchronization precision is as high as possible.At this point, we attempt to reasonably adjust parameters in order to achieve the optimal tradeoff between energy consumption and synchronization precision at synchronization node.Now, we discuss the proposed design issues of synchronization error variance, shown as in Section 3.2 described.
(1) Firstly, we consider the performance metric as follows, which reflects the relationship between clock synchronization precision and energy consumption: where the first part represents the mean estimation error variance in the process of clock synchronization, which determines the clock synchronization precision; the second part represents mean energy consumption in the process of clock synchronization.
(2) Then, seen from the above discussion about analysis issues, it is sure that (a) when discussing  → ∞, it has some significance of the theoretical research; (b) lim  → ∞ [  ] ≤   (33).So to minimize lim  →  [  ] + Δ (minimize the trace), we can replace it with minimizing   + Δ.
(3) In order to find an optimal , minimizing   + Δ, we need to judge the function property of   + Δ, where the function property of   is critical.
Because the function property of   is not easy to be proved, we introduce the function   In the subsequent proof, for simplicity, () is written as ; the derivative   () of () is written as   ; the second derivative   () of () is written as   .In addition, ℎ,  0 , and   represent ℎ(),  0 (), and   (), respectively.
In (4) we have the following lemma.
Lemma 10.If  ∈ [0, 1] and , whose eigenvalues are not less than 1, is a diagonal matrix,  −  is a convex function of , that is, Proof.Consider the following equation: where  −  is the unique solution to the above equation.Taking derivative on both sides of (44) with respect to  leads to After transposition, we obtain the following: And because of Corollary 5 and Lemma 9, we get Taking again derivative on both sides of (46) with respect to  leads to At the same time, according to (46) and (48), we have After transposition, we obtain the following: According to Lemma 9,(47), and [(ℎ  −   0 − ) −1 ] 2 ≥ 0, if we prove  2 / 2 ≥ 0, only we can prove And according to Lemma 7, Lemma 9, and (47), to prove (51) holds, we just need to prove Because of (47), Because ℎ  () =   and , whose two eigenvalues are not less than 1,  is a diagonal matrix; therefore And because  ∈ [0, 1], (52) is set up; thus In other words,  −  is a convex function of .
In (5) we have the following lemma.
Lemma 11.If  ∈ [0, 1] and , whose eigenvalues are not less than 1, is a diagonal matrix,   is also a convex function of ; that is, for any  ∈ (0, 1), Proof.Firstly, from Lemma 10, we have  −  =     +  which is a convex function of ; then according to Lemma 6, Lemma 11 can be obtained.
Next, we state a main result.In (6) we have the following theorem.Theorem 12.  * which minimizes   + Δ can be obtained by solving the following two equations: Proof.Equation (56) can be obtained according to the definition.Because   is a convex function of  and Δ is linear relationship with respect to ,   + Δ is also a convex function of .Thus,   + Δ takes derivative of  and then makes it equal to zero: that is, According to (46),  * satisfies (57).
In one word, synchronization precision and energy consumption of sensor nodes are mutually restricted for clock synchronization.By solving the two equations ( 56) and (57), we can find an optimal clock information exchange rate, optimally trading off between synchronization precision and energy consumption of sensor nodes.

Simulation Analysis
In this section, for synchronization error variance analysis and design issues, we will simulate and illustrate the theories and algorithms proposed in the previous sections by some examples.Firstly, we start with analysis issue.
Three graphs in Figure 4 indicate the relationships between the trace of Kalman filter steady-state error variance Tr(  ) (when  → ∞) and clock packet arrival rate  as well as the relationship between the mean error variance [  ] (when  → ∞) and clock packet arrival rate  with different circumstances of the system noise and the same observation noise as  = diag(10 −3 , 10 −3 ), where [  ] (when  → ∞) is obtained by Monte Carlo simulation.As can be seen from the figure, with different system noise, Tr(  ) is tight approximation to [  ] (when  → ∞).And with the weakening of system noise, the effect of replacing [  ] with   (when  → ∞) approximately is more and more perfect.Two diagrams in Figures 5 and 4(b) represent that the observation noise is different and the system noise is the same as  = diag(10 −5 , 10 −5 ).From the comparison of figures, the change of observation noise has no effect on the degree of approximation between Tr(  ) and [  ] (when  → ∞).Seen from the comparison and analysis of Figures 4 and 5, Tr(  ) can be used to replace [  ] approximately (when  → ∞), and Tr(  ) is a monotonically decreasing function of .It shows again that the higher the probability that clock information arrives at the synchronization node is, the higher the precision of clock synchronization is.Assume that the loop termination condition of bisection search algorithm  = 0.01, the system noise correlation matrix  = diag(10 −5 , 10 −5 ), and the observation noise correlation matrix  = diag(10 −3 , 10 −3 ).The simulation results show that the algorithm can obtain the minimum  after five steps.For example, while  desired = 1.5 * 10 (61) We also draw the relationship between Tr(  +Δ) and .As is confirmed in Figure 6, Tr(  + Δ) is a convex function of .And it can be seen easily from the figure that the optimal  that minimizes Tr(  + Δ) is the same as the  * calculated from (56) and (57).

Future Work of Synchronization Error Precision Analysis and Design
This paper deeply researches certain respect on the synchronization error variance analysis issue from the perspective of statistical mean.At the same time, we are aware that it has a certain limitation in practice.For example, we assumed that packets are dropped independently in this paper, which is certainly not true in the case where burst packets are dropped or in queuing networks where adjacent packets are not dropped independently.Besides, we also use the mean of the synchronization error variance as the measure of performance.Reference [15] pointed out that this can conceal the fact that events with arbitrarily low probability can make the mean diverge, and we should ignore such events with extremely low probability.

Investigating Synchronization Error Variance Analysis from the View of Probability.
From the front analysis, it is seen that there exists packet loss such that   is a random variable.It is because   cannot be determined in one synchronization process that the analysis from the perspective of statistical mean only shows statistical synchronization error variance of multiple information exchanges and may omit some of small probability events.Statistical synchronization error variance of multiple information exchanges does not represent all of synchronization error variance which is not beyond the desired boundary of the synchronization variance.In a period of synchronization, there exists the possibility that some of synchronization error variance goes beyond the desired boundary.For high reliability, if the synchronization error variance goes beyond the desired boundary, it brings serious hidden peril for sensor networks.Motivated by [15] which analyzed that packet loss affects the state estimation variance from the perspective of probability and by [11] which estimated clock parameters from the perspective of probability distribution based on belief propagation, can we analyze the probability that the synchronization error variance goes beyond the desired boundary by the same way?Therefore, in future research, based on the latest synchronization state space model [10] or the research framework in [11], we could discuss the probability distribution of synchronization error variance under the condition of packet loss and analyze the probability of the synchronization error variance beyond the designed boundary of synchronization variance.Then Question 1 proposed in this paper is shown as follows.
For a given packet arrival rate, we estimate a different performance metric Pr[  ≤ ], that is, the probability Pr[  ≤ ] that   is bounded by a given variance , where notation Pr[⋅] takes the probability.
Compared with the performance metric [  ], which maybe omits some of small probability events, we will discuss the synchronization error variance from the point of probability.Due to including small probability events, the high reliability requirement for synchronization precision boundary can be satisfied.

Optimizing the Performance Metric of Synchronization
Error Variance Design.Combining synchronization precision and energy consumption into a cost function, as the performance metric ((42) in the paper), reflects the tradeoff between energy consumption and synchronization precision at synchronization node.However, in practice, the energy used to synchronize is limited and we prefer to improve the synchronization precision with the limited energy as much as possible.In fact, the latest literatures have preliminary study, but there is no in-depth study about clock synchronization.Thus, in future research, we need to further optimize the performance metric built in the paper.
Since the transmission power of sensor node has an impact on the packet loss rate and packet loss rate also affects synchronization precision, how should we adjust transmission power of sensor node to make the clock synchronization estimation variance as small as possible?In other words, if there are multiple levels of transmission power, how should we schedule the transmission power of sensor node in order to improve synchronization precision as soon as possible with limited energy?At this point, in order to improve synchronization precision as much as possible, we will design the optimal transmission power scheduling sequence with the restriction condition of limited energy.

Conclusion
In this paper, regarding fixed delay and relative clock offset as the unknown clock state variables and based on a unified framework of clock synchronization state space model, we discuss the analysis and design issues between the synchronization error variance and packet loss rate.
In the analysis issue, we theoretically prove that the steady-state error variance of Kalman filter in the statistical property is a monotonically decreasing function of clock information packet arrival rate.And in order to guarantee the desired synchronization precision of sensor node, we find a minimum clock information packet arrival rate by an efficient bisection search algorithm.In the design issue, in order to achieve the optimal tradeoff between energy consumption and synchronization precision, we obtain the optimal solution form of clock information exchange rate.
It is as indicated in the sections of the synchronization error variance analysis and design issues in this paper.It has great theoretical significance to discuss the synchronization error variance in limited case from the perspective of statistical mean and the performance metric considering both energy consumption and synchronization precision, but it has a certain limitation in practice.However, the estimation performance metric with the view of probability in network control theory brings another research perspective for the analysis and design issues proposed in this paper.In addition, in order to simplify the study of problem and go deep into the essence of problem, the paper firstly uses two nodes as a springboard and focuses on discussing the synchronization error variance analysis and design in detail.For multinode wireless sensor networks, we can use the latest clock synchronization system model.So, based on the latest model of distributed clock synchronization system, we will further discuss the influence of packet loss on synchronization error variance analysis and design issues from the point of probability and assess the reliability of the synchronization error variance beyond the designed boundary of the synchronization variance in future research.
There are some works further researched.Discuss the possibility of the synchronization error variance beyond the designed boundary of the synchronization variance from the view of probability.Design an optimal transmission power scheduling sequence of sensor node to make the synchronization precision as high as possible with the limited energy of sensor nodes.The synchronization error variance analysis and design issues will be extended to the distributed network.

Figure 1 :
Figure 1: Two-way timing message exchange between two nodes.

Figure 2 :
Figure 2: Clock synchronization process of message exchange.

Figure 3 :
Figure 3: Clock synchronization process with intermittent observations.

7. 1 .
Analysis Issue.Consider the system parameters of clock synchronization state space model with

Figure 4 :
Figure 4: Mean error variance and clock information packet arrival rate with different circumstances of the system noise.

Figure 5 :Figure 6 :
Figure 5: Mean error variance and clock information packet arrival rate with different circumstances of the observation noise.
1, to Node B at  1, .Node B achieves that message at  2, and then replies to Node A at  3, .The reply message contains both  2, and  3, .Finally, Node A gets the reply message at  4, .Note that  1, and  4, are the local clock of Node A, while  2, and  3, are the local clock of Node B. After exchanging  times, Node A receives a set of time stamps { 1, ,  2, ,  3, ,  4, }  =1 .The above procedure can be mathematically modeled as So in the section, we look for a minimum clock information packet arrival rate  min , satisfying lim  →  [  ] ≤  desired for  → ∞.
) If we can find a minimum clock information packet arrival rate  min , satisfying lim  → ∞ [  ] ≤  desired when  → ∞, then the  min is also treated as the minimum clock information packet arrival rate, satisfying lim  →  [  ] ≤  desired .