## 2 System Modeling
### Modeling of Energy Consumption for NB-IoT according to 3 GPP Standards  
Essential requirements such as lifetime, available energy, and reduced cost need to be considered in modeling IoT applications energy consumption. For example, the power consumption of NB-IoT devices for a battery with 5 Wh capacity and certain traffic conditions has been predicted in [5]. The assumption of the analysis is that UE periodically transmits a single data packet of a given size. For example, the battery life of UE, communicating 200-bytes of uplink data per day on average with this MCL can last for up to 10 years [5].  
Our simulation using a Point-to-Point Communications (PPC) [15] model for a communication scenario with an Ideal MAC layer, an interference-free channel and a single hope data link. We worked on the 3 GPP power consumption model, which is well understood by the research community and discussed in several papers. For example, in [19] the authors presented the first empirical NB-IoT power consumption model to measure the battery lifetime. According to this published paper, the power consumption in the first generation of NB-IoT devices is slightly higher than the 3 GPP model. As a result, the authors measured a 10% shorter battery lifetime for this generation of NB-IoT hardware. We proposed D2D links and small cell deployment to improve the coverage for users in outage and increase the battery lifetime by reducing the required power to communicate to BS via a nearby device or small cell.  
In addition, data compression techniques including Lempel-Ziv-Welch (LZW) and Huffman have been evaluated in our simulations and practical implementation for their processing time and compression performance.  
(1) Lempel-Ziv-Welch (LZW): This compression method is an algorithm that taking advantage of symbol repetition to compress data [20]. It operates by creating a \"dictionary\" of symbols and associated codewords both for compression and decompression. The process of data size reduction in LZW is straightforward; it assigns a codeword for each string and using single codewords instead of repeated strings based on the primary dictionary, and adding new codewords to the existing dictionary with the unique reference number. Therefore, by compression of each new string, the LZW dictionary is updated with new codewords for incoming longer strings, and it replaces them with smaller codewords. By continuing to compress the data in this way, the LZW algorithm can compress data on the fly. LZW performs very well for compression of data sequences with repetitive substrings such as text and numeric files.  
(2) Huffman (Huff): The basic principle of Huffman coding is to allocate bit patterns to characters according to their repetition frequency [21]. Therefore, two passes are required for compressing the file--one pass to find the rate of recurrence of each character and generate the Huffman tree and a second pass to actually compress the file. Huffman coding suffers from the fact that the decoder needs to have knowledge of the mapping of bit patterns to the characters. Sending this information with the codewords increases the overall bit rate. Conversely, if this information is unavailable, it will not be possible to decode the compressed data. In this practical implementation, for simplicity, we have implemented the Huffman compression technique. Still, in our other research work [17; 19], to solve the problems associated with this technique, we have used an improved variant of Huffman coding called Adaptive Huffman (AH).