## 4 The Considered Nodes' Synchronization and Data Transmission Protocol
### Optimization of the Activation Times in SYNCH Mode  
In this Section we derive an analytical framework for calculating the optimal activation times \(R_{s}\) for SYNCH operation with the aim of minimizing the sum of energies consumed at each node. To this aim we consider a reference time of a SYNCH packet duration for the calculation of the consumed energies. Since the nodes are expected to be battery powered with an almost constant Voltage value, we can equivalently consider energy consumption or battery capacity depletion as performance metric. Hence, we introduce the following parameters:  
Figure 7: Illustrative example: flow of the DATA packets for the first 6 nodes (the synchronization phase is the same of Figure 6.  
* \(C_{tx}\): Battery capacity depletion for one packet transmission (including overhearing)
* \(C_{lst}\): Battery capacity depletion for listening to the channel for a period of one packet duration (including overhearing)  
Let us make the reasonable assumption that the synchronization errors are independent from each other, and denote by \(f_{\delta}(x)\) the pdf of the synchronization error for a generic node. Given the above we have \(f_{r_{s}}\left(x|R_{s}\right)=f_{\delta}\left(x-R_{s}\right)\). We now propose a density evolution approach to evaluate the optimum wake-up times \(R_{s}\) assuming that both \(f_{\delta}(x)\) and \(p_{s}\) are known. To this aim, denote by \(f_{t_{s}}\left(x\right)\) the pdf of \(t_{s}\), \(t_{s}\) being the time when node \(s\) starts transmitting. For the sake of notation simplicity, \(t_{s}\), \(r_{s}\) and \(R_{s}\) are assumed in the following to be normalized with respect to the packet duration \(T_{P}\). Note that, since the reference node \(1\) starts transmitting as soon as it becomes active, we have \(f_{t_{1}}(x)=f_{\delta}(x)\). Let now denote by \(Q_{tx,s}\) and \(Q_{lst,s}\) the battery capacity depletion wasted by node \(s\) for transmitting in SYNCH mode before node \(s+1\) is active and for listening the channel before node \(s-1\) starts transmitting its SYNCH packet, respectively. We have:  
\[Q_{tx,s}=\left\{ \begin{array}{ll}\left[r_{s+1}-t_{s}\right]C_{ tx}&\text{if }r_{s+1}\geq t_{s}\\ 0&\text{otherwise}\end{array} \right. \tag{9}\] \[Q_{lst,s+1}=\left\{ \begin{array}{ll}\left(t_{s}-r_{s+1} \right)C_{lst}&\text{if }r_{s+1}\leq t_{s}\\ \left[\left[r_{s+1}-t_{s}\right]-\left(r_{s+1}-t_{s}\right)\right]C_{lst}&\text {otherwise}\end{array} \right.\]  
where \(\left[\,\bullet\,\right]\) is the ceiling operator, i.e., \(\left[\,r_{s+1}-t_{s}\,\right]\) is the number of transmitted packets and overhearing periods of node \(s\) before node \(s+1\) is ready to receive. We are now in the position of evaluating the wasted energies in (9) as a function of \(R_{s+1}\) as:  
\[Q_{tx,s}\left(R_{s+1}\right)=C_{tx}\int\limits_{-\infty}^{\infty }\int\limits_{-\infty}^{y}\left[y-x\right]f_{r_{s}}\left(y|R_{s}\right)f_{t_{ s}}(x)dxdy \tag{10}\] \[Q_{lst,s+1}\left(R_{s+1}\right)=C_{lst}\int\limits_{-\infty}^{ \infty}\int\limits_{-\infty}^{y}\left(x-y\right)f_{r_{s+1}}\left(y|R_{s}\right) f_{t_{s}}(x)dxdy+\] \[C_{lst}\int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{y} \left[\left[y-x\right]-\left(y-x\right)\right]f_{r_{s}}\left(y|R_{s}\right)f_{ t_{s}}(x)dxdy\]  
Since the other sources of energy consumption, i.e., the energies due to transmission and reception of data packets, do not depend on \(R_{s}\), the value of \(R_{s+1}\) that minimizes the overall weighted consumed energies can be set as:  
\[R_{s+1}=\underset{R}{\text{arg min}}\,\,\left[w_{s}Q_{tx,s}\left(R\right)+w_{ s+1}Q_{lst,s+1}\left(R\right)\right] \tag{11}\]  
where the set of weights \(w_{s}\) can be chosen to enforce a given degree of fairness among nodes. The solution of (11) can be computed through numerical computation of (10) for each possible value of \(R_{s+1}\). It is worth noting that in order to evaluate all the \(R_{s+1}\) for \(s=1,\ldots,S-1\) in an iterative fashion, it is necessary to propagate the knowledge of \(f_{t_{1}}\left(x\right)\) to subsequent nodes.