# CCAIB: Congestion Control Based on Adaptive Integral Backstepping for Wireless Multi-Router Network
## 3 CCAIB Algorithm  
Backstepping is a control method based on [PERSON]'s second method. That is, if a Lyapunov function is designed to be positive definite and its differential is negative definite, then the quadratic terms of the Lyapunov function can be proved to converge to zero. In the first step of CCAIB, a virtual control law is used to construct the quadratic term of Lyapunov function. In the second step of CCAIB, the queue length convergence error is the quadratic term of Lyapunov function. By these two steps, the queue length is stable at a certain value. Step 1:  
Choose a Lyapunov function as  
\[V_{i,1}=\frac{1}{2}K_{i,0}x_{i,0}^{2}+\frac{1}{2}x_{i,1}^{2}+\frac{1}{2} \Gamma_{i,1}\big{(}\theta_{i,1}-\hat{\theta}_{i,1}\big{)}^{2} \tag{4}\]  
with \(K_{i,0}\) and \(\Gamma_{i,1}\) being positive design parameters and \(\hat{\theta}_{i,1}\) being the estimation of \(\theta_{i,1}\). The purpose of introducing the Lyapunov function is that if we can prove that the Lyapunov function is positive definite, and its derivative is negative definite, then the value of the Lyapunov function will converge to 0. If each of its terms is nonnegative, then each of its terms will converge to 0. Specifically, for the last term of the Lyapunov function, this means the error between the actual and the estimated packet loss ratios of wireless links will converge to zero, and the target of estimating the packet loss ratios of wireless links will be satisfied. It is easily seen that \(V_{i,1}\) is positive definite. Then, it needs to be proved that \(\dot{V}_{i,1}\) is negative definite. Differentiating \(V_{i,1}\) gives  
\[\dot{V}_{i,1} = K_{i,0}x_{i,0}x_{i,1}+x_{i,1}[f_{i,1}+(g_{i,10}+g_{i,11}\theta_{ i,1})x_{i,2}]+\Gamma_{i,1}\big{(}\theta_{i,1}-\hat{\theta}_{i,1}\big{)}\left(- \dot{\hat{\theta}}_{i,1}\right) \tag{5}\] \[= x_{i,1}[K_{i,0}x_{i,0}+f_{i,1}+(g_{i,10}+g_{i,11}\theta_{i,1})(x_ {i,2}-\alpha_{i,1})\] \[+\big{(}g_{i,10}+g_{i,11}\hat{\theta}_{i,1}+g_{i,11}\big{(}\theta _{i,1}-\hat{\theta}_{i,1}\big{)}\big{)}\alpha_{i,1}]+\Gamma_{i,1}\big{(}\theta _{i,1}-\hat{\theta}_{i,1}\big{)}\left(-\dot{\hat{\theta}}_{i,1}\right)\] \[= x_{i,1}[K_{i,0}x_{i,0}+f_{i,1}+\big{(}g_{i,10}+g_{i,11}\hat{ \theta}_{i,1}\big{)}(x_{i,2}-\alpha_{i,1})\] \[+\big{(}\theta_{i,1}-\hat{\theta}_{i,1}\big{)}\left(x_{i,1}\alpha _{i,1}g_{i,11}-\Gamma_{i,1}\hat{\theta}_{i,1}\right)\]  
To ensure that \(\dot{V}_{i,1}\) satisfies negative definiteness, we set  
\[K_{i,0}x_{i,0}+f_{i,1}+\big{(}g_{i,10}+g_{i,11}\hat{\theta}_{i,1}\big{)}\alpha _{i,1} = -K_{i,1}x_{i,1} \tag{6}\]  
\[x_{i,1}\alpha_{i,1}g_{i,11}-\Gamma_{i,1}\hat{\theta}_{i,1} = 0 \tag{7}\]  
where \(K_{i,1}\geqslant 0\) (\(i=1\cdots M\)) are design parameters. A simple calculation yields:  
\[\alpha_{i,1} = \frac{-K_{i,0}x_{i,0}-K_{i,1}x_{i,1}-f_{i,1}}{g_{i,10}+g_{i,11} \hat{\theta}_{i,1}} \tag{8}\] \[\dot{\hat{\theta}}_{i,1} = \Gamma_{i,1}^{-1}x_{i,1}\alpha_{i,1}g_{i,11} \tag{9}\]Substituting (8) and (9) into (5) leads to  
\[\dot{V}_{i,1} = K_{i,0}x_{i,0}x_{i,1}+x_{i,1}[f_{i,1}+(g_{i,10}+g_{i,11}\theta_{ i,1})x_{i,2}]+\Gamma_{i,1}\big{(}\theta_{i,1}-\hat{\theta}_{i,1}\big{)}\left(- \dot{\hat{\theta}}_{i,1}\right) \tag{5}\]0  
Step 2:  
Constructing a Lyapunov function  
\[\dot{V}_{i,1} = K_{i,0}x_{i,0}x_{i,1}+x_{i,1}[f_{i,1}+(g_{i,10}+g_{i,11}\theta_{ i,1})x_{i,2}]+\Gamma_{i,1}\big{(}\theta_{i,1}-\hat{\theta}_{i,1}\big{)}\left(- \dot{\hat{\theta}}_{i,1}\right) \tag{5}\]1  
where \(\Gamma_{i,2}>0\) and \(\tilde{\Gamma}_{i,1}>0\) are both constants. \(\theta_{i,1}\) and \(\theta_{i,2}\) are estimated by \(\ddot{\theta}_{i,1}\) and \(\dot{\theta}_{i,2}\) respectively.