## 3 System Overview
### Power Consumption
#### 3.9.1 Energy Contribution for Parameters  
Application Layer  
MQTT was selected for our work for the application layer. QoS was set to zero to the achieve lowest possible power consumption. MQTT is based on the publish -subscribe architecture. The publish- subscribe pattern defines the device as either transmitting or receiving data. When receiving data, the IoT device needs to stay connected and ready to receive the data. This will consume more power, and a more complex algorithm is needed to sync the wake-up time of the device with the transmitter. However, when publishing the message, it can be programmed to reconnect with the network as needed.  
The latency of the system is measured from the booting up of the SoC and the initializing of the distance sensor. The SoC takes a few milliseconds to boot, and then the sensor takes another few milliseconds to measure distance and send the value over the I2C bus. Then, according to the programmed logic in the SoC, data begins to be sent over the network.  
The application duty cycle is the amount of time that the device is in active mode. It is a key fact that a device's power consumption will change with the duty cycle. We created an adoptive duty cycle that helps to maintain a balance between real-time data monitoring and energy consumption of the device.  
Protocol  
Every packet has some overhead components. TCP overhead is higherthan UDP overhead due its packet format. Apart from that, TCP data acknowledgement consumes energy, but it guarantees reliable delivery. we use the more efficient protocol, considering and balancing the criteria of power consumption and reliable delivery.  
The amount of data communicated over the network affects the duration of the device's active and sleep periods. A constant data size has the advantage of allowing more accurate planning of the power budget. The data can be sent periodically or non-periodically. According to our adaptive algorithm, data sending is non periodic. Our tissue monitoring device sends the fixed quantity of payload data (5 bytes) through the network when the activity occurs according to our program. So, the application throughput is dependent on the amount of data exchanged through the network in a defined period of time.  
Network Parameters  
The application is deployed on existing network infrastructure. The network response time and link budget are not under the control of the application. However, network infrastructure does impact the energy consumption of the IoT system. Data packets take time to travel across the network from source to destination; this is known as network response time. Network response time is based on network load, capacity and link budget. MQTT is based on TCP /IP protocol. TCP /IP waits for the response as per its protocol rules. Network topology and network traffic mainly drive the response time in TCP/IP networks. Network traffic is affected by the network capacity and load. Reduction in network usage is the one best option to gain some control over these parameters. An IoT system's data can be aggregated into one maximum packet size to reduce the number of transmissions. A higher Wi-Fi data rate can be used to reduce the transmission time, but data rates are dependent on radio technology and are not controllable through the application. Another option is to reduce the re-transmission rate to minimize the network traffic. This is directly related to the link budget. A good quality link can reduce the number of packet errors and maintain balance between energy consumption and data monitoring.