## 4 Testbed Results
### Impact of Compression on Cellular Communications Latency
Based on the evaluation results described above, a 60-80% reduction in data packet size can be achieved with the Huffman coding algorithm which requires less than 20 ms processing time for data packet sizes up to 2 KBytes. In this research work, we have compared wireless last-mile communication technologies as shown in Table 7, based on estimated latency and data rate values that can be found from the literature and previous research work [23; 25]. According to the references [23; 26; 27] MCL (signal strength) can impact significantly on the value of the latency. The latency for two standard protocols--the transmission control protocol (TCP) and user datagram protocol (UDP)--have been simulated for a smart grid IoT network in [28]. Our experimental results are for 3G and 4G links using a standard TCP implementation with [PERSON]'s algorithm activated. Results with and without compression techniques with different data packet sizes are illustrated in Figures 8-10. Our prediction for NB-IoT is based on our experiments on 3G and 4G technologies. \begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline
**Platform/Data Size** & **50 B** & **100 B** & **500 B** & **1 KB** & **2 KB** & **4 KB** & **6 KB** & **8 KB** & **10 KB** \\ \hline RPi (LZW-DeComT) & 2 & 2 & 6 & 9 & 13 & 16 & 14 & 17 & 20 \\ RPi (LZW-ComT) & 3 & 5 & 13 & 24 & 42 & 75 & 91 & 100 & 106 \\ RPi (Huff-DeComT) & 2 & 2 & 11 & 24 & 47 & 78 & 89 & 101 & 116 \\ RPi (Huff-ComT) & 1 & 1 & 2 & 5 & 12 & 23 & 34 & 40 & 39 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Compression (ComT) and Decompression (DeComT) Time (ms). \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline \hline
**Platform/Data Size** & **50 B** & **100 B** & **500 B** & **1 KB** & **2 KB** & **4 KB** & **6 KB** & **8 KB** & **10 KB** \\ \hline Huffman & 55 & 65 & 77 & 79 & 80 & 80 & 80 & 80 & 80 \\ LZW & \(-91\) & \(-46\) & \(-3\) & 22 & 32 & 50 & 57 & 59 & 62 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Percentage of Space saving. Figure 8: 3G (**a**) and 4G (**b**) median latency without and with Huffman and LZW compression techniques (CTS stand for Client-to-Server (Uplink)). Figure 10: CDF plot for different data packet size both for 3G (**a**) and 4G (**b**) using LZW Compression. Figure 9: CDF plot for different data packet size both for 3G (**a**) and 4G (**b**) using Huffman Compression. This prediction has been proved from a practical experiment applying two compression algorithms on different data packet sizes shown in Figure 8. This figure shows the median latency value and compares latency measurements for different data packet sizes using the TCP protocol with and without applying compression techniques. Figure 8a,b show that using Huffman coding, especially for data packet sizes less than 4 kbytes, are much more efficient than using LZW on the client side. Figures 9 and 10 show the Cumulative Distribution Function (CDF) of collected latency measurement from the testbed in detail for both 3G and 4G cellular network using LZW and Huffman coding algorithms. The red line plotted in the figures represents a 90% confidence latency value for the obtained results. The 4G test TCP results in Figures 9 and 10, for both Huffman coding and LZW shows more predictable behavior than the 3G results. It can be seen that Huffman coding generally provides a 10-20% lower latency than the LZW method and the uncoded case. Increasing the size of the data packet will increase the latency values. The very high latency results for 3G wireless technologies in Figures 9 and 10 mainly is because of higher data packet loss that in detail has been presented in [23] for transmitted data without using compression techniques.