## 5 Evaluation Results: Influence of Each Layer to the Overall Performance
### MAC Layer  
The experiments with different values of _macMaxFrameRetries_, the parameter that defines the maximum number of MAC layer retransmissions, shows an important correlation between the setting of this parameter and the network performance. Changing _macMaxFrameRetries_ affects the overall PDR noticeably, as depicted in Figure 5. As seen in the figure, for the values in the allowed value range from zero to seven, as specified by IEEE 802.15.4 and hence by ZigBee, a higher amount of allowed retransmissions results in a higher PDR. With the default configuration of three, the overall PDR decreases from 94.3% to 85.6% and to 72.9% for low, medium and high traffic, respectively. Moreover, the difference in overall PDR between the default configuration that allows three retransmissions and the two alternatives of using one and seven retransmissions, respectively, becomes larger with increasing traffic. It reaches its peak value at high traffic with a relative degradation of 28.9% when only using one retry and a significant relative improvement of 17.8% when using seven retries. The average end-to-end delay and the energy efficiency evolve correspondingly, as shown in Figures 6 and 7. While the delay is relatively high for a low number of allowed retransmissions, it decreases as more retransmissions are allowed. The energy efficiency improves similarly, as the energy consumption per bit decreases with an increasing value of _macMaxFrameRetries_. The reason for these results can be derived from the average data link delivery ratio (LDR), which depends on _macMaxFrameRetries_. Figure 8 shows that the LDR for different traffic scales increases rapidly with values above one for _macMaxFrameRetries_, flattening out with higher values when considering the allowed range of values for this parameter. As the traffic increases, the benefit of augmenting the number of allowed retries is higher, as packet losses due to intranet work interferences and collisions become more frequent. Since it is necessary to transmit packets over multiple links, the LDR has a major impact on the overall PDR, determining with which probability the packets reach the destination node. The end-to-end delay similarly depends on the LDR. In a theoretical case of a 100% LDR, the end-to-end delay only depends on the number of hops between the source and the destination and on the time spent at each hop. In a practical case, links are lossy and the LDR adopts lower values, like the ones observed during the experiments. If a loss happens, which is more probable in links with lower LDRs, the APL layer end-to-end reliability mechanism will retransmit the packet. However, this requires the source node to wait for the RTO timer of the APL layer to expire, adding significant delay to the transmission. Therefore, as the LDR decreases, the end-to-end delay increases. The energy efficiency shows a similar improvement as PDR and delay for an increasing amount of allowed retransmissions. RFDs apply duty cycling to reduce the current consumption, which means that they spend an important amount of time in the sleep state, where very low energy is consumed. In any other state, the RFDs consume more energy, especially when transmitting and receiving data. The sleep state is interrupted for data packet transmissions (including retransmissions) or to poll the associated FFDs for end-to-end ACKs by sending a data request and waiting for a reply. The amount of data transmissions and polls therefore has an important impact on the energy consumption. Packet losses that lead to APL layer retransmissions and that cause the RFDs to waste polls while waiting for end-to-end ACKs that never will arrive decrease the energy efficiency. On the other hand, an important cross-layer mechanism depends on the value of _macMaxFrameRetries_. According to the ZigBee specification, an unsuccessful MAC layer transmission (after using all retries) is interpreted as a link failure at the NWK layer, which triggers the route repair mechanism.