## 4 Tests and Experiments
### Contacting the Device Disconnected from the Network for a Long Time Period  
The first set of tests was executed to evaluate how the size of the window influences the probability of the packet reception. The repetition of the same reception window three times (denoted on the plot as the uniform scenario) is used as a baseline, where its duration is set to \(<-2\cdot\alpha\cdot\sigma,2\cdot\alpha\cdot\sigma>\) around the time of expected reception of the packet. We evaluated the influence of the scaling parameter \(\alpha\), set in the range from 0.3 to 1.4 in steps of 0.1. We assumed that 5% packets are lost due to radio transmission errors. Random moments  
Next, we evaluated the influence of the packet loss ratio on the effectiveness of the two algorithms. Figure 6 visualizes the dependence of the energy cost on the probability of reception of at least one packet over the three tries for 5 to 30% packets lost due to wireless channel errors. The graph shows the overall advantage of the uniform linear increase of time window scenario (Section 3.1.1) over the shift scenario (Section 3.1.2) when lower overall reception probability is acceptable. However, when the packet loss ratio is low or if the lower probability of message reception is needed the shift algorithm outperforms the linear increase, providing lower energy utilization for any alpha below 0.5. Figures 7 and 8 show a comparison of the probabilities of receiving a package (Figure 7) and energy cost estimates (Figure 8) for both scenarios of window length selection for three consecutive listening windows. Our results show that any attempt to reduce the energy cost is associated with a decrease in the probability of receiving a packet. Depending on the required packet reception probability, \(\alpha\) should be selected in the range \([0.6,1]\). An additional conclusion is a difference in the effectiveness of the strategy depending on the packet loss in the network. The linear increase of the window size scenario is less energy costly in networks with lower packet loss probability and also in a certain range of the \(\alpha\) parameter values, the ends of which are visible on the charts and depend on the adopted packet loss. \begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Days** & \(\mathbf{X}[s]\) & \(\mathbf{\sigma}\) \\ \hline First period & 180 & 15,552,000 & 77.76 \\ Second and third periods & 1 & 86,400 & 0.432 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters used in window length calculations. Figure 6: Dependence of the energy cost on the probability of packet delivery. Numbers above data points denote \(\alpha\) value. Figure 8: Comparison of the energy cost for different packet loss probability for the linear window size increase and window shift algorithms. Figure 7: Comparison of the message reception probability over three trials for different packet loss probability for the linear window size increase and window shift algorithms. Continuous Clock Synchronization and Optimization of Listening Window Size in Periodically Scheduled Transmissions  
In the next step, we evaluated the combinations of the two proposed algorithms for estimation of the point in time at which the transmission occurs (algorithms A1 and A2 described in Section 3.2.1) and the three methods used to determine the listening window length (algorithms W1, W2, and W3 described in Section 3.2.2). The algorithm A2 is based on the average of the reception time of the last few packets, thus we have also evaluated how it performs using means \(\widehat{B}\) calculated from the statistics from 2, 4, 6, and 8 recently received packets. Each time, 1000 simulations of each combination were carried out, where a single simulation had an individual seed for the random number generator set out of 1000, which determined the times of packet transmission randomly selected in the windows 0:00-3:00 and 3:00-6:00 for each simulated day.