## 4 Performance Analysis of QoS Metrics
### Evaluation of PDR for the Transmission Power Level (\(P_{\text{Trans}}\)) and Energy Consumption
#### 4.1.2 Energy Consumption and Network Life at Different P\({}_{\text{Trans}}\) Levels  
To analyze the energy consumption better, it is important to understand how the communication is performed, thus a data packet is transferred from a coordinator to an end node or vice versa. The Zigbee protocol is based on IEEE 802.15.4 and Zigbee follows this standard completely for medium access control (MAC) and the physical (PHY) layer. Figure 5: PDR vs. distances for different transmission power levels in (a) indoor and (b) outdoor environments. However, it is modified and different than that of IEEE 802.15.4 in the network (NWK) and application (APS) layer where it allows the Zigbee to form a mesh network and enable multi-hop communication from the end node to the coordinator. However, the energy consumption of a sensor network heavily depends on the PHY and MAC layer, which are the same as the IEEE 802.15.4. Zigbee follows the CSMA/CA to send data from one node to another. In this experiment, data packets of 30 bytes are sent from the coordinator to an end node. For measuring the current consumption and the energy of the total packet reception, the end node is powered up from a 3.5 DC supply and connected to an oscilloscope across a shunt resistor of 9 \(\Omega\). This setup is depicted by Figure 6a, and Figure 6b presents the current consumption during the successful reception of a packet. To send a data packet, at first, the coordinator broadcasts a beacon message in its network [52]. The end nodes are configured in cyclic sleep mode. They wake-up after the predefined sleep time and listen for the beacon message from the sender, which is the coordinator in this case. To wake-up from sleep and receive the broadcasted beacon from the coordinator, the receiver takes some time. During this wake-up time, the receiver stays in radio idle mode as presented by annotation 1, whereas annotation 2 denotes the reception of this beacon message. After that, the receiver sends a data request to the coordinator. After receiving a broadcast beacon, the receiver stays in radio standby mode as annotation 3 until it sends the data request to the coordinator as presented by annotation 4. Then the receiver radio goes to idle mode and stays in idle mode until it receives the acknowledgment of the data request. After receiving the data request from the receiver, the sender (coordinator) waits for a backoff time according to the predefined contention window and then performs the clear channel assessment (CCA) before sending the data. The receiver goes to the receiving mode after the reception of this acknowledgment from the coordinator and remains in that mode until the data transfer is over as denoted by annotation 5. It processes the received data and upon successful reception of the data it sends an acknowledgment back to the coordinator, which is denoted by annotation 6 and then goes to sleep mode again. The receiver can also wake-up upon receiving the broadcast beacon from the coordinator or depending on the configuration, it can follow any predefined sleep time to wake-up at a regular interval. All the different stages of the packet reception by an end node and annotation of Figure 6b are summarized in Table 4.  
Figure 6: (a) Measurement setup and (b) current consumption capture of the successful reception of a packet. The duration of these data reception stages varies according to the \(\mathrm{P_{Trans}}\) level and the packet size. Moreover, the variation of the duration of these stages affects the overall energy consumption of the nodes, thus energy efficiency and network lifetime. The current consumption is also increased by the data encryption, which contributes to decreasing the energy efficiency. The current consumption captures of the packet reception at different \(\mathrm{P_{trans}}\) levels with both 128-bit AES encryption and without encryption are presented in Figure 7. We should also note that the end node can receive the broadcast beacon from the coordinator at any time during its wakeup duration.