## 6 Teletraffic Analysis of the WSN
### Throughput Analysis  
Now we can obtain the main performance metrics of the system, namely, throughput, idle slot probability, and collision slot probability. Hence, we first calculate the probability that there are \(N_{On}\) active nodes, which are the nodes that can transmit data to the sink node. This probability is given by the steady-state probability of the Hyper-Exponential Markov Chain described above. Recall that the packet transmission success probability considering an S-ALOHA random access protocol, occurs when only one of the active nodes transmits \begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Next State** & **Transition Rate** & **A Node in State** & **Turns** & **To a State of** \\ \hline \((N_{On}^{(1)}+1,\ldots,N_{On}^{(k)},N_{Off}^{(1)},\ldots,N_{Off}^{(k)}-1)\) & \(N_{Off}^{(k)}\lambda_{On}\) & \(Off^{(k)}\) & \(\mathit{On}\) & \(\mathit{On}^{(1)}\) \\ \((N_{On}^{(1)}-1,N_{On}^{(2)}+1,\ldots,N_{On}^{(k)},N_{Off}^{(1)},\ldots,N_{Off}^ {(k)})\) & \(N_{On}^{(1)}\lambda_{Off}\) & \(\mathit{On}^{(1)}\) & \(\mathit{Off}\) & \(\mathit{On}^{(2)}\) \\ \((N_{On}^{(1)},\ldots,N_{On}^{(k-1)}-1,N_{On}^{(k)}+1,N_{Off}^{(1)},\ldots,N_{ Off}^{(k)})\) & \(N_{On}^{(k-1)}\lambda_{Off}\) & \(\mathit{On}^{(k-1)}\) & \(\mathit{Off}\) & \(\mathit{On}^{(k)}\) \\ \((N_{On}^{(1)},\ldots,N_{On}^{(k)}-1,N_{Off}^{(1)}+1,\ldots,N_{Off}^{(k)})\) & \(N_{On}^{(k)}\lambda_{Off}\) & \(\mathit{On}^{(k)}\) & \(\mathit{Off}\) & \(\mathit{Off}^{(1)}\) \\ \((N_{On}^{(1)},\ldots,N_{On}^{(k)},N_{Off}^{(1)}-1,N_{Off}^{(2)}+1,\ldots,N_{ Off}^{(k)})\) & \(N_{Off}^{(1)}\lambda_{On}\) & \(\mathit{Off}^{(1)}\) & \(\mathit{On}\) & \(\mathit{Off}^{(2)}\) \\ \((N_{On}^{(1)},\ldots,N_{On}^{(k)}N_{Off}^{(1)},\ldots,N_{Off}^{(k-1)}+1)\) & \(N_{Off}^{(k-1)}\lambda_{On}\) & \(\mathit{Off}^{(k-1)}\) & \(\mathit{On}\) & \(\mathit{Off}^{(k)}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Valid State Transitions for the Erlang Model. Figure 9: Markov chain of the transition process of a node which depends on the birdsongs behavior, Erlang case. in a given time slot with probability \(\tau\). Building on this, the throughput can be obtained as Equation (26):  
\[ \begin{split}\tilde{S}&=\{\text{Only one of the active nodes in the network transmits in a given time slot}\}\\ &=\sum_{N_{On}=0}^{N}\binom{N_{On}}{1}\tau(1-\tau)^{N_{On}-1}Pr( \text{There are $N_{On}$ nodes in the system})\end{split}  \tag{26}\]  
In the scenario proposed, the throughput (Equation (27)) depends on the probability of success (\(P_{s}\)) that only one of the active nodes in \(N_{On}^{(1)}\) state transmits in a given time slot and any of the nodes in \(N_{On}^{(2)}\) state transmits in a given time slot or only one of the active nodes in \(N_{On}^{(2)}\) state transmits in a given time slot and any of the nodes in \(N_{On}^{(1)}\) state transmits in a given time slot (See Equation (28)). \[ \begin{split}\tilde{S}=\sum_{\forall n\in\text{valid}}P_{s}(N_{ On}^{(1)},N_{On}^{(2)},N_{Off^{\prime}}^{(2)}N_{Off^{\prime}}^{(2)})\pi_{(N_{ On}^{(1)},N_{On}^{(2)},N_{Off}^{(1)},N_{Off}^{(2)})}\end{split}  \tag{27}\]  
\[ \begin{split} P_{s}(N_{On}^{(1)},N_{On}^{(2)},N_{Off^{\prime}}^{( 1)}N_{Off^{\prime}}^{(2)})=&\binom{N_{On}^{(1)}}{1}\tau(1-\tau)^{ N_{On}^{(1)}-1}\binom{N_{On}^{(2)}}{0}\tau^{0}(1-\tau)^{N_{On}^{(2)}}\\ &+\binom{N_{On}^{(1)}}{0}\tau^{0}(1-\tau)^{N_{On}^{(1)}}\binom{N_ {On}^{(2)}}{1}\tau(1-\tau)^{N_{On}^{(2)}-1}\\ =& N_{On}^{(1)}\tau(1-\tau)^{N_{On}^{(1)}-1}(1-\tau) ^{N_{On}^{(2)}}\\ &+(1-\tau)^{N_{On}^{(1)}}N_{On}^{(2)}\tau(1-\tau)^{N_{On}^{(2)}- 1}.\end{split}  \tag{28}\]  
A free slot (\(F\)S) occurs when there are no transmissions in that slot, Equation (29) corresponds to the probability of having an idle slot (\(\tilde{PF}\)), and the Equation (30), refers to none of the active nodes in \(N_{On}^{(1)}\) state transmit in a given time slot neither the nodes in \(N_{On}^{(2)}\) state transmits in a given. \[