## 3 ZigBee Protocol Stack Overview and Configuration
### Protocol Stack Configuration
#### 3.2.2 NWK Layer  
The devices in WHAN applications have the capability to communicate with any other device in the network [1, 28], making the mesh topology the proper choice for the network topology. Thus, an important MAC layer setting in the evaluation carried out in this paper is the use of the beacon-less mode, since the ZigBee mesh network topology only supports such a mode, as described in Section 3.1. Most of the devices are FFDs, except for a few RFDs that do not participate in routing. From the mechanisms provided by the NWK layer for the mesh topology, the impact of the routing metric on network performance is evaluated. The default routing metric uses Equation (1) to calculate the link costs. Although an LDR value is required by Equation (1), that value may not be available to a ZigBee node. Alternatively, the ZigBee specification suggests using a mapping from LQI to a link cost, the details of which are not specified and are left to the implementation. A prevalent ZigBee implementation from Freescale, BeeStack [29], calculates the LQI based on the RSSI of a packet and converts it into a link cost, the mapping of which is shown in Figure 2.  
The link cost mapping used in the BeeStack implementation is assumed as the default link cost setting for the evaluations of this paper, the performance of which is compared to the performance achieved with two other interpretations of the ZigBee metric. The first consists in using constant link costs resulting in the HC metric, _i.e._, using Equation (2) as the link cost. The second is a piecewise linear function (PLF)  
Figure 2: Mapping of link quality indication (LQI) to link cost values by the BeeStack [30], hop count (HC) and piecewise linear function (PLF) [31] routing metrics.  
mapping from LQI to LDR derived by the physical experiments in [32] and then applying Equation (1). The LQI value in this case is calculated from the correlation value provided by the radio transceiver as an SNR estimate [33]. The PHY layer implementation obtains the LQI by correlating the first eight symbols after the start-of-frame delimiter of a packet. The PLF mapping is also shown in Figure 2. Note that the BeeStack bases its LQI calculation on the RSSI of a packet, while the PLF metric uses the SNR estimate obtained by the correlation to determine the LQI value. The reader is encouraged to see the survey on radio link quality estimation by [PERSON] _et al._ for detailed information on these metrics and alternative ones [34].  
As an alternative routing metric, the Path-DR metric [35] is included in the evaluations. Path-DR estimates the LDR of each link during a route discovery. In the evaluations, this estimation is also implemented based on the LQI to LDR mapping derived by [PERSON] _et al._[32]. By multiplying the estimated LDR values at each link, an end-to-end PDR estimation is obtained when an RREQ packet reaches the destination node. The Path-DR metric selects the route with the highest estimated PDR. This metric is not ZigBee-compliant, since it does not apply the ZigBee path cost calculation algorithm. The reasons to include this metric in the evaluations are two-fold. First, it has been shown that this metric results in better network performance in an indoor scenario than other route selections metrics, such as HC and max-LQI [35]. Secondly, we consider a metric that is not ZigBee-compliant to be a benchmark for the ZigBee-compliant metrics.