### 2.1. Time Delay for Local Time Information Exchange

The DCTS algorithm requires local time information exchange between two or more nodes in a wireless sensor network. This exchange can occur using either MAC layer time-stamped packets or via physical layer pulse signals. In either case, the delay between two network nodes is defined as the interval between when the time information is generated by the sender node and when this information is determined by the receiver node. Furthermore, in either case, this delay can be comprised of a deterministic and a random portion. In the following, we discuss the delay sources at the two layers and argue that, in both cases, a common underlying model of Gaussian delay uncertainty can be adopted. (We have separately examined the performance of the DCTS algorithm considering alternate delay distributions, e.g., exponential delay distribution [7]. Results show similar performance bounds as those presented in this paper for the Gaussian assumption. For this reason, we constrain our discussion here to the more common Gaussian delay model.)

#### 2.1.1. Physical Layer-Based Time Delay

Sender nodes using physical layer synchronization algorithms convey local time information to receiver nodes by transmitting pulse signals according to their local clocks. The receiver node, however, estimates the arrival time of the pulse signal as the clock of the sender node. As shown in Figure 1, there is an offset between the transmit time of the pulse at the sender and the arrival time estimate at the receiver.

One source of this lag is , the propagation delay between the sender and receiver nodes. The propagation delay is related to the distance between the two nodes such that , where is the distance between nodes and and is the speed of light. Once the pulse signal propagates to the receiver, the receiver node takes some time to reliably detect the pulse signal and to make an arrival time estimate. We assume the arrival time estimation procedure at the receiver will automatically compensate for this detection and estimation delay. However, since the pulse signal is received in noise (and may additionally experience fading over the wireless link), the actual arrival time estimate produced at the receiver will have an associated error. It is known from parameter estimation theory that any maximum likelihood (ML) estimator is asymptotically unbiased, and an ML estimate is asymptotically Gaussian distributed [8]. Thus, if an ML arrival time estimator is employed at the receiver, the arrival time estimation error can be modeled as a Gaussian random variable, , with zero mean and variance (the variance of arrival time estimator). In the physical layer delay model used here, we assume such an estimation error and write the total delay between the transmit time and estimated arrival time of a pulse signal as

#### 2.1.2. MAC Layer-Based Time Delay

At the MAC layer, local time information at a sender node is clocked and incorporated into a packet during packet formation. The overall delay between two nodes exchanging such time-stamped packets is, therefore, the time interval between when the sender time is clocked and when the receiver node decodes this time information from its received packet [9]. The sources of delay during this interval are shown in Figure 2.

The major sources of random delay at the MAC layer are , the transmission processing time; , the channel access time; and , the receiver processing time. The delay in processing a packet (at either the transmitter or receiver) depends on several factors such as the protocol processing time, the CPU load, and delays in the operating system. , on the other hand, is the time the sender node that must wait to access the transmit channel, which is determined by the MAC protocol in use as well as the current network traffic. Here, we assume the overall delay, results from the additive effect of delays introduced by several independent random processes (e.g., the instantaneous workload on the sender/receiver CPU, packet generation processes at other network nodes, etc.). Using the central limit theorem, we model this delay as a Gaussian random variable with mean and variance . Additionally, the packet experiences a propagation delay of ; the overall MAC layer delay is therefore given as

In the following, we use a general delay model that incorporates the two delay calculations for the physical and MAC layers, that is, we assume

where is a constant equal to zero for physical layer-based schemes and for MAC layer-based schemes; and is a zero mean Gaussian random variable. The variance of , , is equal to for physical layer schemes and to for MAC layer-based schemes.

### 2.2. DCTS Algorithm With Gaussian Delay

In each iteration of the DCTS algorithm, each node processes and decodes the time-stamped message from its neighbors in the MAC layer-based approach or estimates the arrival time of its neighbors' pulse signals in the physical layer scheme. Each node then updates its local clock time using the weighted average of the time differences with its neighbor nodes. It is well known that in a connected network with nonrandom delay between nodes, this DCTS algorithm can reach *average consensus* [10]; that is, all nodes converge to the average of the initial timing differences between the nodes.

Our study focuses on the operation of the DCTS algorithm when there are both deterministic and random (Gaussian) delays during local time information exchange, as described above. In this case, the timing update rule of the DCTS algorithm at each node is given as

where is the local time at node during iteration ; is the set of neighboring nodes that can communicate reliably with node ; ; is the constant delay defined above; is the constant step size for each iteration; are i.i.d Gaussian random variables, with zero mean and variance . Local time information exchange between nodes and under this delay model is shown in Figure 3.

The DCTS algorithm in (4) can be rearranged as

where . It should be noted that and might not be independent between nodes and since the two nodes might have identical noise coming from some potentially overlapping neighbors.

### 2.3. Network Model and Some Preliminaries

In the following, we model a wireless sensor network as an undirected graph , consisting of a set of nodes and a set of edges . (The convergence properties presented here can be easily extended for a directed graph. We omit this extension here.) Each edge is denoted as where and are two nodes connected by edge . We assume that the presence of an edge indicates that nodes and can communicate with each other reliably. We assume here a connected graph; that is, there exists a path connecting any pair of distinct nodes in the network.

Given this network model, we denote as the adjacency matrix of such that

Next, we let be the graph Laplacian matrix of which is defined as

where is the degree matrix of . Specifically, is equal to the number of neighbors of node with which it can communicate reliably, that is, . Given this matrix , we can show that and , where and . Additionally, is a symmetric positive semidefinite matrix (implying its eigenvalues are all nonnegative), and for a connected graph, the rank of is and its eigenvalues can be arranged in increasing order as [11]. We now define vectors and . Based on these definitions, the evolution of DCTS algorithm in (5) can be written as

where is called a Perron matrix of a graph with parameter [3]. Here, denotes the identity matrix. The eigenvalues of are and can be ordered in decreasing order: . It is worth mentioning that the constant step size which minimizes convergence time is given as [12]. (Note that the optimal is generally difficult to obtain as it involves computing the eigenvalues of the Laplacian matrix . However, in practical applications, a numerical solution can be obtained offline based on node deployment within a given wireless sensor network, and this can then be flooded to all nodes before they run the DCTS algorithm.) Let us define and , where . Then the noise vector in (8) is given as .

When there is no Gaussian delay between nodes, it can be shown that [10, 12], for a time-invariant, connected, undirected network, when , *average consensus* can be asymptotically achieved by the DCTS algorithm, that is, In our discussion, we also assume an undirected, connected network with a constant step size unless otherwise stated.

In the following analysis, we use the following matrices: , and . For matrices and , it is straightforward to show that the eigenvalues of agree with those of except that is replaced by ; such that ; and and .