# Congestion Control and Traffic Differentiation for Heterogeneous 6 TiSCH Networks in IIoT
## 3 The Proposed Congestion Control Mechanism
### Detecting and Controlling Congestion
#### 3.1.2 The LB-Criterion
Empirically, we consider \(\delta=0.5\), which means that a new parent \(P_{i}^{*}\) should be selected when the congestion level is above 50%. A higher value of \(\delta\) could cause a delayed detection of congestion. However, a lower value of \(\delta\) could trigger unnecessary parent change actions when the network can support the current traffic load, which incurs increased overhead. Next, we introduce a new routing metric \(R^{LB}(p_{i})\) to consider load balancing when selecting \(P_{i}^{*}\):  
\[R^{LB}(p_{i})=\underbrace{H(p_{i})+1}_{RANK(p_{i})}+ETX(n_{i},p_{i})+ \lambda BF(p_{i}), \tag{7}\]where \(\lambda\) is a weighting coefficient that controls the effect of \(BF(p_{i})\) on the parent selection process. Since we have \(0\leq BF(p_{i})\leq 1\), we should have \(\lambda>1\) for \(BF(p_{i})\) to have a notable effect compared to \(H(p_{i})\) and ETX factors. The impact of \(\lambda\) is discussed later in Section 5. Then, when a congestion is detected, i.e., Equation (6) is satisfied, a new parent \(P_{i}^{*}\) is selected as:  
\[P_{i}^{*}=\min_{p_{i}\in Parent(n_{i})}\left\{R^{LB}(p_{i})\right\}. \tag{8}\]  
When congestion occurs at \(P_{i}\), it is better not to select \(n_{i}\) as a parent by its neighbors since all its traffic is eventually forwarded to \(P_{i}\), which is already congested. To address this case, \(n_{i}\) updates its \(BF(n_{i})\) after each parent selection as:  
\[BF(n_{i})=\max\left\{BF(P_{i})-\Delta,\frac{Q(n_{i})}{L(n_{i})}\right\}, \tag{9}\]  
where \(0<\Delta<1\) is a small factor. This way, children nodes can be aware of those congested ancestors located up to \(\left(\lceil\frac{1}{\Delta}\rceil-1\right)\) hops and avoid selecting parents directly connected to them. When utilizing only the LB-criterion to detect the congestion and select a new parent, a number of nodes may simultaneously change to the same parent with the minimum routing metric according to Equation (8). This in turn causes a congestion problem for that new parent. Accordingly, these nodes detect the congestion and change their parent once more, with the minimum backlog factor resulting in congestion again. This may lead to an indefinite cycle of parent changes without achieving a balanced network, a phenomenon that is known as the thundering herd problem [34]. This problem can be illustrated by the scenario shown in Figure 3. To the left, node \(B\) is congested since it is attached to many children nodes. According to Equations (7) and (8), the children nodes handle the congestion event by changing to a new non-congested parent. The problem is that all the children nodes may simultaneously change to the same new parent, i.e., node \(A\) as shown in the right side of the figure, which again results in a congestion in that node. In that case, those nodes may continue to change their parent indefinitely without achieving load balancing. To evade this problem, we introduce a probability-based parent switching mechanism. When the LB-criterion in Equation (6) is satisfied, a node chooses to change to a new parent according to Equation (8) with the following probability:  
\[P_{switch}=\max\left\{\Gamma\left(BF\left(P_{i}\right)-BF\left(P_{i}^{*} \right)\right),0\right\}, \tag{10}\]  
where \(0<\Gamma<1\) is a small coefficient that represents the node combativeness to change its parent to avoid congestion. The effect of \(\Gamma\) on the network performance is evaluated in Section 5. When both the HL-criterion and the LB-criterion are satisfied, the selection mechanism in Equation (8) is applied, because in this case, balancing the network load is more important, as mentioned earlier.