## 2 Proposed Link Cost Function  
When applying a conventional approach to power-efficient routing, the power required to transverse a link is used as the link cost. As a result, the routing path from each node to AP is the one which requires the least amount of accumulated energy across the nodes in the path. This is equivalent to optimizing for the EpB parameter. A probable outcome would be that a single node would deplete its power source before all others, thereby setting NL while other nodes still have energy to use. In the proposed cost function, the accumulated energy used by each node is factored in as well. If a node used more energy than the other nodes, its use as a relay for other nodes would be discouraged by increasing the costs of its outgoing links. As in any global routing protocol, link-cost information is periodically gathered at the AP in the form of channel attenuation for each link in the network, and all routing calculations are performed at the AP. Note that for a dynamic network (mobile user and/or changing environment), link-state information should be gathered more frequently (on the order of channel coherence time as implied by the Doppler spread). The channel attenuation for the selected link between node \(j\) and node \(k\), \(\alpha_{j,k}\), is noted in Equation (1), where _RSSI_ is the received power measured by node \(k\) and \(P_{\alpha}\) is the transmitted power used by node \(j\). For each round of collecting link-state information, each node's normalized energy used thus far is calculated as shown in Equation (2), where \(j\) denotes the node ID, \(i\) is the current round, \(E_{i}^{j}\) is the accumulated energy of node \(j\) at round \(i\) normalized to packet time, \(\alpha_{j,k}\) is the channel attenuation for the selected link, and \(RSSI_{T}\) is a predefined target RSSI needed to achieve a required reliable performance level. Note that \(P_{\alpha}\) as implied in Equation (2) is a simple power control mechanism ensuring use of minimum required power to transverse a single link while meeting target RSSI:  
\[\alpha_{j,k}=\frac{RSSI}{P_{tx}} \tag{1}\]  
\[E_{i}^{j}=E_{i-1}^{j}+\frac{RSSI_{T}}{\alpha_{j,k}} \tag{2}\]  
The accumulated energy used is incremented by the energy used to transmit a single packet while maintaining \(RSSI_{T}\). The link cost between node \(j\) and node \(k\), \(C_{j,k}\), is computed by calculating the energy that would be used by the node if that link is selected, and multiplying it by a cost factor as depicted in Equation (3):  
\[C_{j,k}^{i}=\frac{RSSI_{T}}{\alpha_{j,k}}\times\left(\frac{1+\left(\frac{E_{i} ^{k}}{E_{i}^{min}}\right)^{M}}{2}\right) \tag{3}\]  
The cost factor is derived by dividing the accumulated energy used by the destination node, \(E_{k}\), with the minimum accumulated energy across all nodes, \(E_{i}^{min}\). This ratio is then raised to the power of \(M\geq 0\), which determines how strong the effect of energy imbalance would be. If the energy spent by a specific node is much greater than the current minimum, it is more likely to be avoided as a relay for other nodes, because its incoming link cost would be very high. The cost factor is normalized so that when \(M=0\) it reduces to the conventional cost function which is the power required to transverse the link regardless of accumulated energy across nodes in the network. _Quality of Service_ (QoS) is an important topic in traditional networking applications. However, in WBANs the vast majority of applications present no redundancy (all nodes are equally important) and no sensitivity to latency (the number of hops times transmission time is very small compared to the bandwidth of sampled physiological signals). QoS can still be implemented in the proposed protocol by manipulating the cost factor on outgoing links from preferred nodes. For example, a direct link from preferred node to AP can be made to be lower by decreasing \(M\) on its outgoing link cost.