# A Cross-Layer Media Access Control Protocol for WBANs
## 4 The Proposed Cross-Layer MAC Protocol
### Priority-Based Transmission Power Adjustment  
To handle heterogeneous data generated by different sensors, we divide these data into three types: period data, event-triggered data, and emergency data. As shown in Table 2, different priority levels are assigned to these data, corresponding to differentiated initial transmission power. Emergency data have the highest priority and sensors use the maximum power to upload these data to guarantee transmission reliability. Once a packet uploaded by sensor \(n_{i}\) is lost, \(n_{i}\) will determine whether the packet should be re-transmitted. For periodic data transmitted in the CFP, a packet will not be re-transmitted during the CBP if the value of the health parameter is within the reasonable range. Other kinds of data will be re-transmitted once occurring a loss. Figure 3 is an illustration of the data uploading process. Sensors \(n_{1}\), \(n_{2}\), and \(n_{3}\) upload packets during slots assigned to them in the CFP, and a packet containing all the Acks for the received packets is broadcast by the coordinator in the AP. Packets uploaded by \(n_{1}\) and \(n_{3}\) are received successfully by the coordinator, but the packet uploaded by \(n_{2}\) is lost due to a transmission failure. Thus, the packet broadcast by the coordinator during the AP contains the Acks for \(n_{1}\) and \(n_{3}\), and no Ack for \(n_{2}\) is packed since the packet sent by \(n_{2}\) is lost. Then, \(n_{2}\) knows about the transmission failure after receiving the packet as no Ack for itself can be found. No re-transmission is needed if the value of the lost data is within a healthy range. Otherwise, \(n_{2}\) will re-transmit the packet during the CBP. As shown in Figure 3, \(n_{2}\) uploads the packet again during the CBP, Because the coordinator sends an Ack immediately after receiving a packet during the CBP, \(n_{2}\) knows the re-transmitted packet has been uploaded successfully. For event-triggered data and emergency data uploaded during the CBP, sensors always re-transmit the data once a transmission failure occurs. As shown in Figure 3, sensor \(n_{3}\) uploads one packet during the CBP but does not receive the ACK sent by the coordinator. Then, \(n_{3}\) re-transmits the packet again. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Priority** & **Data Category** & **Initial Transmission Power** \\ \hline level 3 & emergency data & \(P_{max}\) \\ level 2 & event-triggered data & \(P_{i}^{*}\) \\ level 1 & period data & \(P_{i}^{s}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Data priority of heterogeneous data. Figure 3: Illustration of data uploading. When a packet is lost and the sender decides to re-transmit the packet, the transmission power will be adjusted during the re-transmission to improve the successful arrival rate of this packet. As shown in Table 2, once sensor \(n_{i}\) generates a packet, an initial transmission power \(P_{b}\) can be gained according to the data type. For emergency data, \(n_{i}\) will upload the generated packet using the maximized transmission power (i.e., \(P_{b}=P_{max}\)) without power adjustment when a data transfer failure occurs. For periodic data, the assumed value of the detected health parameter is \(v\), and the maximum and minimum values of the corresponding health range are \(v_{max}\) and \(v_{min}\). A deviation degree \(\psi\) can be calculated as  
\[\psi=\left\{ \begin{array}{cc}\frac{v-v_{max}}{\
u_{\delta}},&vs.>m_{max}\\ \frac{v_{min}-v}{\
u_{\delta}},&v_{min}>v,\\ 0,&otherwise\end{array} \right. \tag{7}\]  
where \(v_{\delta}\) is a pre-set threshold value for the corresponding health parameter. A comprehensive weight considering data continuity and importance is defined as  
\[\mathcal{W}=\lambda_{1}\psi+\lambda_{2}(1-\mathcal{R}), \tag{8}\]  
where \(\lambda_{1}\) and \(\lambda_{2}\) denote the weight values, and \(\lambda_{1}+\lambda_{2}=1\), \(\mathcal{R}\) denotes the received ratio of the corresponding data during the last \(M\) superframes.