# End to End Delay and Energy Consumption in a Two Tier Cluster Hierarchical Wireless Sensor Networks
## 5 The Intra-Cluster Communication
### The Contention Process  
For the contention process in the CONT sub-frame, many random access protocols can be considered [2]. For our study, we borrow the proposal presented in [33] where the FSA is adopted. Here we have derived the corresponding output of the contention process at each CH. Let \(M_{c}(r_{\max})=M_{s}/N_{c}(r_{\max})\), in short \(M_{c}\), be the number of sensors in a given cluster. Then, we have identified a Markov chain where the observation points are located at the beginning of a \(\mathcal{C}\) slot, see Table 4, third column. Let us assume that at the beginning of a given Combi-Frame, we have \(i\) data packets ready for transmission, that is, \(i\) sensors each one with one data packet. Then, with probability \(r\) each packet will choose the actual Combi-Frame to try the access and with probability \(1-r\) the packet will defer the access to the next Combi-Frame. This permission probability could be estimated by means of some centralized control and broadcast by the CH to all terminals in the cluster. Then, the probability that \(j\) data packets (\(0\leq j\leq i\leq M_{c}\)) get permission to access is given by a binomial distribution, \(B(i,j,r)\). Then, each of the \(j\) terminals with positive permission probability will choose one of the \(V=N_{msC}\) mini-slots with probability \(1/V\). Let \(S(j,k,V)\) denote the probability that \(k\) among \(j\) data packets get a successful access, \(0\leq k\leq j\leq M_{c}\) and \(k\leq\min(j,V)\). \(S(j,k,V)\) can easily be obtained in a recursive way, see reference [34]. Combining both actions in a single expression we have,  
\[D_{k}^{i}(r,V)=\sum_{j=k}^{i}B(i,j,r)S(j,k,V). \tag{3}\]  
In Equation (3) \(D_{k}^{i}(r,V)\) is the probability to have \(k\) successful transmissions from a total of \(i\) data packets ready to transmit at the beginning of a given Combi-Frame. Using the short notations, \(B_{j}^{i}(r)=B(i,j,r)\), \(S_{k}^{i}(V)=S(j,k,V)\) we write equation Equation (3) in matrix notation,\[\mathbf{D}(M_{c},r,V)=\mathbf{B}(M_{c},r)\mathbf{S}(M_{c},V)\left[ \begin{array}{cccc}D_{0}^ {0}(r,V)&0&\ldots&0\\ D_{1}^{1}(r,V)&D_{1}^{1}(r,V)&\ldots&0\\ \vdots&\vdots&\ddots&\vdots\\ D_{0}^{M_{c}}(r,V)&D_{1}^{M_{c}}(r,V)&\ldots&D_{M_{c}}^{M_{c}}(r,V)\end{array} \right] \tag{4}\]  
with \(\mathbf{B}(M_{c},r)\),  
\[\mathbf{B}(M_{c},r)=\left[ \begin{array}{cccc}B_{0}^{0}(r)&0&0&\ldots&0\\ B_{1}^{1}(r)&B_{1}^{1}(r)&0&\ldots&0\\ B_{0}^{2}(r)&B_{1}^{2}(r)&B_{2}^{2}(r)&\ldots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ B_{0}^{M_{c}}(r)&B_{1}^{M_{c}}(r)&B_{2}^{M_{c}}(r)&\ldots&B_{M_{c}}^{M_{c}}(r) \end{array} \right] \tag{5}\]  
and \(\mathbf{S}(M_{c},V)\),  
\[\mathbf{S}(M_{c},V)=\left[ \begin{array}{cccc}S_{0}^{0}(V)&0&0&\ldots&0\\ S_{0}^{1}(V)&S_{1}^{1}(V)&0&\ldots&0\\ S_{0}^{2}(V)&S_{1}^{2}(V)&S_{2}^{2}(V)&\ldots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ S_{0}^{M_{c}}(V)&S_{1}^{M_{c}}(V)&S_{2}^{M_{c}}(V)&\ldots&S_{M_{c}}^{M_{c}}(V) \end{array} \right] \tag{6}\]  
Next we need to take into account the arrival process during a Combi-Frame. We recall that for a given sensor, the probability to generate at least one data packet per Combi-Frame is given by, from Equation (2), \(a=1-(1-p_{act})^{N_{m\!=\!CF}}\). Notice that for a fixed Poisson rate \(\lambda\), \(a\) increases with \(N_{msCF}\). Also, we remember that if a given sensor senses more than one data packet per Combi-Frame, only one of them is considered as candidate to be transmitted; the other packets are lost since each sensor is equipped with a unit size buffer. Using matrix notation for the arrival process, with \(A_{j}^{i}(a)=B(i,j,a)\) (binomial distribution), we have,\[\mathbf{A}(M_{c},a)=\left[