## 4 Design of TLQoS  
### Overview of TLQoS  
TLQoS is a thermal-aware localized routing protocol aiming to provision QoS for diverse traffic types based on their requirements. To meet the objective, the protocol is designed following a modular approach. Figure 2 illustrates the basic architecture of TLQoS. TLQoS exploits the cross layer interactions between layer-2 and layer-3.  
Considering delay and reliability as the primary QoS constraints, a module is devoted to each of these constraints as depicted in Figure 2. The temperature module deals with the regular packet, (no delay and reliability constraints) and ensures that the packet reaches to the BC with a lower temperature route. The QoS-aware packet classifier classifies the packet according to their QoS demands and passes it to the respective module for further processing. The neighbor manager module runs the HELLO protocol that enables exchanging information among neighboring nodes, and maintains a neighbor table. This module interacts with delay estimator, reliability estimator and temperature estimator modules in layer-2 for acquiring the respective parameter values of a node. Upon exploiting the parameter values,  
Figure 2: Protocol Architecture.  
the neighbor manager builds the HELLO packet. It also passes the neighbor table information to the delay module, reliability module and temperature module respectively to locally select the most appropriate neighboring node among the available candidates. The queuing manager module maintains two queues namely, Delay Constrained Queue (DCQ) and Regular Queue (RQ), and implements priority multi-queuing strategy that provides differentiated priority for diverse traffic types.  
To implement the localized routing, TLoQoS adopts the potential based routing policy. The potential based routing is first proposed by [PERSON] _et al_. [19] in the context of traditional network. However, this work defines an exclusive virtual potential field for each arbitrarily distributed destination that incurs huge overhead. Later on, [PERSON] _et al_. proposed TADR [20] that exploits the potential field for localized routing decision in the context of Wireless Sensor Network (WSN) with a single sink. TADR mainly focuses on integrating congestion avoidance mechanism with routing functionalities. This work motivates us to adopt the potential based routing policy for QoS provisioning along with thermal-awareness in the context of WBAN having _in-vivo_ nodes. In this policy, a node measures potentials for different parameters, and the trajectory of the packet is determined by the _force_ from the potential fields. TLQoS defines four routing potential fields namely hop count potential, delay potential, reliability potential and temperature potential. The delay module, reliability module and temperature module respectively compute the related potential and forces for all the neighbors and choose the most suitable candidate that has the maximum force. While selecting the candidate node from the neighbors, all the modules avoid the hotspot node even if it has the maximum force. The process is repeated hop-by-hop until the packet reaches to the BC satisfying the requirements of desired QoS. Since, TLQoS employs greedy approach for choosing the next-hop node, and the QoS parameters as well as temperature parameter are time-variant, hence, routing loops might occur. However, integrating the QoS potential fields with time-invariant hop-count field, and controlling a configurable parameter can prevent the routing loops, and reduce the large number of hop traversal along the network. In the subsequent sections, we present how the potential fields and the relative forces are constructed, and then how the different modules compute the integrated potential and forces to decide a suitable loop-free route satisfying the respective QoS, also avoiding the hotspot.