# Adaptive Data Synchronization Algorithm for IoT-Oriented Low-Power Wide-Area Networks
## 4 Adaptive File Synchronization
### On Double Signature Efficiency
The first column of Table 2 also shows the standard deviation of the results, which is quite uniform for all the considered algorithms except for \(rsync_{32,128}\). This is because \(rsync_{32,128}\) generates an average data traffic that essentially approaches the entire file size of 3 kB, so the deviation is very small. On the other hand, with the other algorithms returning lower average results, the standard deviation assumes larger values. For each considered synchronization event, the file update percentage has been sorted following a log-normal distribution with \(\mu_{ud}=2.5\) and \(\sigma_{ud}=0.8\) (the update percentage associated with the \(s\)-th synchronization procedure, with \(s=1\), \(2\),..., \(30\), indicates how much the file at time \(t=s\) is changed with respect to its previous version at time \(t=s-1\)). The changed bytes within the file have been instead burst-sorted. Furthermore, Table 2 also shows the chunk dimension considered by each algorithm. For AC-_rdiff_ and AH-_rdiff_ the mean value is reported, which is identical since the chunk size is adapted following the same approach (left column of Table 2). Specifically, in Figure 8 it is possible to appreciate how the chunk dimension dynamically changes in time (the figure also reports the chunk dimension considered in \(rdiff_{16,64}\) a reference value). The \(x\)-axis reports 30 ticks corresponding to the 30 synchronization procedures, each one labeled with the respective considered file updated percentage value. The trend of the chunk size adaptation strictly depends on the file update percentage. In fact, for high percentage values the chunk size decreases, while for small updates the chunk dimension grows. When instead the chunk does not change, it means that despite different update percentages, the algorithm has recognized no convenient size variations. \begin{table}
\begin{tabular}{l l l l} \hline \hline  & **Average Traffic (Standard Dev.)** & **Average Traffic Percentage** & **Chunk Dimension** \\  & **(kByte)** & **(\%)** & **(Byte)** \\ \hline \(rsync_{32,128}\) & 2.96 (0.03) & 98.89 & 500 \\ \(rdiff_{32,128}\) & 2.28 (0.49) & 76.31 & 40 \\ \(rdiff_{16,64}\) & 1.85 (0.47) & 61.72 & 20 \\ AC-\(rdiff_{16,64}\) & 1.68 (0.41) & 56.01 & 14 \\ AH-\(rdiff_{16,64}\) & 1.67 (0.39) & 55.94 & 14 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average data traffic generated by different synchronization algorithms. Figure 7: Performance of the considered file synchronization algorithms as a function of the file update percentage. Burst updates distribution within the file is assumed. As an additional comment, we observe that the choice of file dimension equal to 3 kB does not limit validity of the results, since the goal of the proposed analysis is to evaluate the byte traffic-saving percentage provided by the considered algorithms. In fact, file synchronization protocols can handle dimension mismatching between the DIoT and cloud files. In general, it is important to observe that, when the chunk dimension is similar to the entire file size, static chunk-based algorithms are inefficient since it is hard to find matching chunks if a significant part of the file needs to be updated. On the other hand, when the file dimension grows with respect to the chunk, the performance improves. However, thanks to the adaptive approach, AC-_rdiff_ and AH-_rdiff_ are essentially not sensitive to the file size, thus providing good performance in any scenario. ### Power Consumption Performance

The results obtained from the data traffic analysis have been exploited to measure the DIoT power consumption. The reference signatures self-generation approach characterizing the DIoT allows the energy spent for data reception to be neglected, so we have simplified the measure of power consumption of Equation (8) by only referring to the transmission component. By doing so, we can evaluate how the byte traffic saving provided by the different synchronization algorithms impacts on the device power consumption and battery lifetime.