## 4 Change Detection Mechanism
### Change Detection  
When the busy channel probability is increased from \(\beta^{*}_{1}\) to some higher detectable value, say \(\beta_{2}\), there are new nodes joining the network. Any existing nodes \(i\) can then use Equation (4) to determine \(\tau_{i}\). With Equation (5) and the approximation in Equation (7), we have:  
\[\tau_{i}=\sum_{k=0}^{m}\beta_{2}{}^{k}\left(\Delta^{*}_{1}\sum_{j=1}^{N-1} \left(1/t_{j}\right)+\sum_{l\in change}\left(1/t_{l}\right)\right) \tag{17}\]  
where node \(j\in\left(1,2,...,N-1\right)\) are all the existing node and node \(l\in change\) are the new nodes. As node \(i\) knows the values of \(\beta_{2}\), \(\tau_{i}\), \(\sum_{j=1}^{N-1}\left(1/t_{j}\right)\) and \(\Delta^{*}_{1}\), it can use Equation (17) to determine \(\sum_{l\in change}\left(1/t_{l}\right)\) and then use Equations (11) and (14) to find the new optimal operating point. As for the new nodes \(l\), a similar procedure can be performed to find the sum \(\sum_{j=1}^{N-1}\left(1/t_{j}\right)\) but they first need to sense the \(\beta^{*}_{1}\) for a short period before starting to transmit packets.  
When the busy channel probability is decreased from \(\beta^{*}_{1}\) to some lower value, say \(\beta_{3}\), there are nodes leaving the network (_i.e._, nodes become inactive), \(\tau_{i}\) can be determined as:  
\[\tau_{i}=\sum_{k=0}^{m}\beta_{3}{}^{k}\left(\Delta^{*}_{1}\sum_{l\in current} \left(1/t_{l}\right)\right) \tag{18}\]  
where \(l\in current\) are the nodes still staying in the network. Using Equation (18), node \(i\) can readily determine \(\sum_{l\in current}\left(1/t_{l}\right)\) and find the new operating point. The complete algorithm is summarized in Algorithm 1.  
Figure 3: Minimal detectable aggregate traffic change _versus_ busy channel probability (TR: Transmission rate; UT: Update interval (s)).  
```
c = 0; for k = 1; k < I; k++ while (c ++ < \(c_{MAX}\))  Perform data transmission and record \(\beta_{k}\)  end if if (k == 1)  \(\sum_{j\
eq i}(1/t_{j})=g(\beta_{k})\)  \(\lambda_{i}\) =RateUpdate(\(\sum_{j\
eq i}\bigl{(}1/t_{j}\bigr{)}\)) elseif (\(|\beta_{k}-\beta_{last}|<\beta_{THR}\))  // Do not change the transmission rate elseif (\(\beta_{k}>\beta_{last}\))  \(\sum_{j\
eq i}(1/\lambda_{j})=g(\beta_{k})\)  Obtain new nodes' traffic: \(\sum_{l\in change}(1/t_{l})=\sum_{j\
eq i}(1/\lambda_{j})-\Delta^{*}\sum_{j\
eq i }(1/t_{j})\)  \(\lambda_{i}\) =RateUpdate(\(\sum_{j\
eq i}\bigl{(}1/t_{j}\bigr{)}+\sum_{l\in change}(1/t_{l})\)) elseif (\(\beta_{k}<\beta_{last}\))  \(\sum_{l\in current}(1/\lambda_{j})=g(\beta_{k})\)  Obtain the current traffic: \(\sum_{l\in current}(1/t_{l})=\sum_{l\in current}(1/\lambda_{j})/\Delta^{*}\)  \(\lambda_{i}\) =RateUpdate(\(\sum_{l\in current}(1/t_{l})\))  end if c = 0 end function\(\lambda_{i}\) =RateUpdate(Traffic)  \(\beta_{last}=\beta^{*}=h\)(Traffic)  \(\Delta^{*}\)= \(\Delta^{*}(\beta^{*},\)Traffic) (using Equation (11))  \(\lambda_{i}=t_{i}/\Delta^{*}\)  end if
```  
**Algorithm 1** Pseudo-code of the proposed algorithm  
In the table, \(k\) is the index of update interval and \(c\) is the time slot counter within an update interval. The change detection mechanism is triggered when the difference of busy channel probability of the current update interval \(\beta_{k}\) and the last-triggered update interval \(\beta_{last}\) exceeds some threshold \(\beta_{THR}\).