## 3 System Model
### Adaptive Thermal-Energy-Aware Routing Protocol in WBAN
#### 3.2.2 Data Transmission Phase  
In this proposed protocol, the data is forwarded using relay nodes rather than of having direct communication between the source node and destination node to reduce energy consumption and temperature rise. The source node broadcasts the data packet with its ring level. On receiving the packet, the ring level of the relay node is compared with the received data packet ring level. For instance, if the value of the relay node ring level is less and the ID of the relay node, then the packet is processed and broadcast; otherwise, the data packet will be discarded. This operation will continue until the packet is destined to the sink node. If the ring level value of the received data packet is less than the neighbour node ring level value, then the energy, temperature, and IP address are stored by the neighbour node and discard the packet. Afterwards, the information is used to select the optimal next hop for the forwarding data packet. The neighboring nodes only received data packets form the current node whose path in terms of distance to destination is more than itself (current node). Hence, only relay nodes (Pr) among the neighboring nodes accept the setup packet which fulfills Equation (1). \[d(N_{src},N_{dest})<d(P_{r},N_{dest}) \tag{1}\]  
where \(d(N_{src},Pr)\) is the distance between the sending node and the relay node. Every node in the network is categorized based on energy and temperature. These selected nodes later act as a next hop, which is used to forward the data packet. The least rank value node has the highest chance to get selected as a next hop for the source node as presented in Table 3. All of the nodes within the network are ranked on the basis of their temperature and energy. These nodes in the network are categorized based on energy and temperature. Afterwards, the categorized nodes are used as next-hop to forward the data packet. The priority is given to the least categorized node in terms of ranking as a next-hop selection for the source node. The rank value assessed for the next hop selection which is based on the following Equations (2)-(5). \[R_{TN}=min(N_{T})forallnodes \tag{2}\]\[R_{EN}=max(N_{E})forallnodes \tag{3}\]  
\[R_{AN}=R_{TN}+R_{EN}forallnodes \tag{4}\]  
\[O_{N}=min(R_{AN}) \tag{5}\]  
where, \(R_{TN}\) and \(R_{EN}\) represent the rank given to the temperature and energy of each node, respectively. However, the node selection criteria is based on rank value denotes as RAN. Finally, \(O_{N}\) is the optimal node that holds the node with the minimum rank value. The data packet format in this phase includes sourceID, destinationID, temperature, energy, ringLevel, selectedID, and data. The sourceID represents the node which broadcast the data packet, whereas destinationID is denoted as destination address, and temperature represents the temperature of the sender node. Similarly, the energy field indicates the energy of the sender node, and the selected IP address is the address of the relay node. The flow chart of the data transmission phase is illustrated in Figure 4, whereas the algorithm for the data transmission phase is presented in Algorithm 2. Figure 4: Initialization phase. \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Node** & **Node** & **Assigned Rank to** & **Assigned Rank to** & **Assigned Rank to Nodes** \\
**Temperature** & **Energy** & **Temperature** (\(R_{TN}\)) & **Energy** (\(R_{EN}\)) & **(\(R_{AN}=R_{TN}+R_{EN}\))** \\ \hline
37 \({}^{\circ}\)C & 0.5 j & 1 & 1 & 2 \\
38.2 \({}^{\circ}\)C & 0.38 j & 4 & 6 & 10 \\
38 \({}^{\circ}\)C & 0.44 j & 3 & 4 & 7 \\
39 \({}^{\circ}\)C & 0.47 j & 9 & 2 & 11 \\
38.5 \({}^{\circ}\)C & 0.45 j & 5 & 3 & 8 \\
38.7 \({}^{\circ}\)C & 0.4 j & 6 & 5 & 11 \\
38.9 \({}^{\circ}\)C & 0.35 j & 7 & 7 & 14 \\
37.9 \({}^{\circ}\)C & 0.33 j & 2 & 8 & 10 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Ranking of nodes.