# A Hybrid Scheme for Disaster-Monitoring Applications in Wireless Sensor Networks
## 5 Theoretical Analysis
\begin{array}{l}g_{i+1}(j)=\lambda_{j}\mu_{i}+\lambda_{j}g_{i}+g_{i}(j )+\lambda_{j}h_{i}g_{i}(i)+\lambda_{j}h_{P1}g_{i}(P1)+\lambda_{j}h_{P2}g_{i}(P2 )\\ g_{i+1}(i)=\lambda_{i}\mu_{i}+\lambda_{j}\varepsilon_{i}+\lambda_{j}h_{i}g_{i }(i)\\ g_{i+1}(P1)=\lambda_{P1}\mu_{i}+\lambda_{P1}\varepsilon_{i}+\lambda_{P1}h_{i}g_{ i}(i)+\lambda_{P1}h_{P1}g_{i}(P1)+\lambda_{P1}h_{P2}g_{i}(P2)\\ S_{i+1}(P2)=\lambda_{P2}\mu_{i}+\lambda_{P2}\varepsilon_{i}+\lambda_{P2}h_{i}g_{ i}(i)+\lambda_{P2}h_{P2}g_{i}(P2)\end{array} \right.. \tag{14}\]  
The above equation represents the relationship between the mean queue lengths of the different nodes. We then combine the first and second equations in Equation (14) with \(i\) = \(j\), \(j\) + 1,..., \(i\) - 1, \(i\), and the following is obtained:\[g_{i+1}(j)=\lambda_{j}\mu_{j}+\lambda_{j}s_{j}+\lambda_{j}\mu_{j}s_{j}(j)+\sum_{k= j+1}^{i}[\lambda_{j}\mu_{k}+\lambda_{j}s_{k}+\lambda_{j}\mu_{k}g_{k}(k)+\lambda_{j} \mu_{P1}g_{k}(P1)+\lambda_{j}\mu_{P2}g_{k}(P2)], \tag{15}\]  
where, when \(j>i\), the following is attained:  
\[\sum_{k=j}^{i}=\sum_{k=j}^{N}+\sum_{k=1}^{i}. \tag{16}\]  
When the ordinary nodes in the token ring network are symmetric, that is, \(\lambda_{i}=\lambda\), \(\mu_{i}=\mu\), \(h_{i}=h\), and \(s_{i}=s\), and the system is in the equilibrium state, the following can be set:  
\[\left\{ \begin{array}{l}g(P1)=g_{i+1}(P1)=g_{i}(P1)\\ g(P2)=g_{i+1}(P2)=g_{i}(P2)\\ g=g_{j}(j)\end{array} \right.. \tag{17}\]  
With Equations (14)-(17), the following is obtained:  
\[g(P2)=\frac{\lambda_{P2}(\mu+s+hg)}{(1-\lambda_{P2}h_{P2})}. \tag{18}\]  
Additionally, \(g(P1)\) is given by the following:  
\[g(P1)=\frac{\lambda_{P1}(\mu+s+hg)}{(1-\lambda_{P1}h_{P1})(1-\lambda_{P2}h_{P 2})}. \tag{19}\]  
From Equations (14), (18) and (19), we obtain  
\[g=\frac{(\lambda\mu+\lambda s)(N-\rho_{P1}-\rho_{P2}+\rho_{P1}\rho_{P2})}{(1- \rho_{P1})(1-\rho_{P2})-\rho(N-\rho_{P1}-\rho_{P2}+\rho_{P1}\rho_{P2})}. \tag{20}\]  
Equation (20) is the mean queue length of node \(k\) when ordinary node \(k\) (\(k=1\), \(2\),..., \(N\)) begins to transmit data. Substituting Equation (20) into Equation (19) yields  
\[g(P1)=\frac{\lambda_{P1}(\mu+s)}{(1-\rho_{P1})(1-\rho_{P2})-\rho(N-\rho_{P1}- \rho_{P2}+\rho_{P1}\rho_{P2})}. \tag{21}\]  
From Equations (18) and (20), \(g(P_{2})\) can be expressed as  
\[g(P2)=\frac{\lambda_{P2}(1-\rho_{P1})(\mu+s)}{(1-\rho_{P1})(1-\rho_{P2})-\rho (N-\rho_{P1}-\rho_{P2}+\rho_{P1}\rho_{P2})}. \tag{22}\]  
When an ordinary node \(k\) (\(k=1\), \(2\),..., \(N\)) begins transmitting data, Equations (21) and (22) are the mean queue lengths of superior nodes \(P_{1}\) and \(P_{2}\), respectively. Thereafter, we can derive the mean cycle time of the token ring network when the ordinary nodes are symmetric and the system is in an equilibrium state:  
\[T_{c}=N\cdot[\mu+s+hg+h_{P1}g(P1)+h_{P2}g(P2)]. \tag{23}\]  
Substituting Equations (20)-(22) into the above equation, the following is obtained:  
\[T_{c}=\frac{N(\mu+s)}{(1-\rho_{P1})(1-\rho_{P2})-\rho(N-\rho_{P1}-\rho_{P2}+ \rho_{P1}\rho_{P2})}. \tag{24}\]  
Equation (24) represents the mean cycle time of the HT-MAC scheme, and the mean cycle time indicates the extreme case of frame delay in a virtual ring network. Because the nodes are comparatively close to each other, the radio propagation delay can be ignored. In the worst case, a frame waits for one period to be transmitted to an ordinary node; therefore, the mean upper bound of the frame delay in the ordinary node is as follows:  
\[T_{ub\_on}=\frac{N(\mu+s)}{(1-\rho_{P1})(1-\rho_{P2})-\rho(N-\rho_{P1}-\rho_{P2} +\rho_{P1}\rho_{P2})}+h. \tag{25}\]  
We can judge the frame delay in the system using the mean upper bound to satisfy the delay requirement. Unlike an ordinary node, a superior node has a higher priority; therefore, it has the chance to transmit frames in each period.