# A Deadline-Aware Scheduling and Forwarding Scheme in Wireless Sensor Networks
## 5 A Deadline-Aware Scheduling and Forwarding Scheme
### The Distribution of \(M\)  
In order to estimate E2E delay's distribution, we estimate the distribution of random variable \(M\) with given network parameters and the sender's position. First, we define node density \(\rho=\frac{N}{S}\) where \(N\) is the total number of nodes in the WSN and \(S\) is the total area size. As shown in Figure 2,  
Figure 1: Node deployment in a WSN.  
let random variable \(X\) denote the distance between the sender (group \(j\)) and the boundary of group \(j-1\); so that \(X\) has a uniform distribution with the range \(0\leq X\leq c\), where \(c\) is the width of a group. \(S_{j}\) is a forwarding area over which the next hop has to deploy; in other words, \(S_{j}\) is the intersection area between a communication area of the sender and a circular area of the group \(j-1\) that has a radius \(R_{j-1}=R+c(j-2)\). \(S_{j}\) is also the random variable that depends on variable \(X\) and the group ID of the node. Figure 2 illustrates forwarder area \(S_{j}\) as the dashed area.  
According to [PERSON] [21], the number of nodes in certain area \(A_{0}\) follows a Poisson distribution and can be expressed as follows:  
\[P(n_{0})=\frac{(\rho A_{0})^{n_{0}}}{n_{0}!}e^{-\rho A_{0}}\]  
Hence, the probability of finding \(m\) nodes in intersection area \(S_{j}\) is expressed as follows:  
\[P_{j}(M=m)=P_{j}(m)=\frac{(\rho S_{j})^{m}}{m!}e^{-\rho S_{j}} \tag{6}\]  
Let \(S_{j,1}\) denote the circular sector of the communication range of the node with radius \(R\) and central angle \(2\theta_{1}\), \(S_{j,2}\) denote the circular sector of the circle of group \(j-1\) with radius \(R_{j-1}\) and central angle \(2\theta_{2}\) and \(S_{j,3}\) denote the kite area with diagonals \(a\) and \((x+R_{j-1})\). According to Figure 2, we calculate \(S_{j}\) as follows:  
\[\begin{array}{lcl}S_{j}&=&S_{j,1}+S_{j,2}+S_{j,3}\\ &=&\int_{-\theta_{1}}^{\theta_{1}}\int_{0}^{R}rdrdr\theta+\int_{-\theta_{2}}^{ \theta_{2}}\int_{0}^{R_{j-1}}rdrd\theta-a(x+R_{j-1})\end{array} \tag{7}\]  
where \(\theta_{1}=\arccos\Big{(}\frac{R^{2}+(x+R_{j-1})^{2}-R_{j-1}^{2}}{2R(x+R_{j-1} )}\Big{)}\), \(\theta_{2}=\arccos\Big{(}\frac{R_{j-1}^{2}+(x+R_{j-1})^{2}-R^{2}}{2R_{j-1}(x+R_ {j-1})}\Big{)}\) and \(a=2R\sin\theta_{1}\).  
In order to compare the intersection areas with different values of group ID, we can redraw the intersection areas as shown in Figure 3. We keep the position of the circle of group \(j\). When group ID \(j_{0}\) is greater than \(j\), the circle of group \(j_{0}\) is shifted in the direction from the node to the sink by  
Figure 2: Intersection area.  
\(c(j_{0}-j)\). When the group ID \(j_{0}\) is less than \(j\), the circle of group \(j_{0}\) is shifted in the direction from the sink to the node by \(c(j-j_{0})\). All of \(S_{j}\) are intersected at the point where the distance to the node is \(x\). As can be seen from Figure 3, with the same value of \(x\), the intersection area of \(S_{j}\) between the communication range of the node and group \(j\)'s circle is interior to that of \(S_{j+1}\) and exterior to that of \(S_{j-1}\), _i.e._, \(S_{j+1}>S_{j}>S_{j-1}\).  
Equation (6) defines \(P_{j}(m)\) with a certain value of \(X\). Hence, according to [PERSON] theorem, the probability that a node in group \(j\) has \(m\) potential forwarders is as follows:  
\[\begin{array}{rcl}P_{j}(m)&=&\int_{0}^{c}\frac{(\rho S_{j})^{m}}{m!}e^{-\rho S _{j}}\times P(X=x)dx\\ &=&\frac{1}{c}\int_{0}^{c}\frac{(\rho S_{j})^{m}}{m!}e^{-\rho S_{j}}dx\end{array} \tag{8}\]  
where \(S_{j}\) is calculated in Equation (7) as a function of \(x\), group ID \(j\) and other network parameters. From Equation (8), \(P_{j}(m)\) depends on node density, intersection area \(S_{j}\) and the group width.