# A Deadline-Aware Scheduling and Forwarding Scheme in Wireless Sensor Networks
## 5 A Deadline-Aware Scheduling and Forwarding Scheme
### E2E Delay Distribution  
In this section, we evaluate the E2E delay distribution. Let random variable \(Z\) denote E2E delay of the node in group \(k\). Since packets are forwarded to the first active node among \(m\) potential forwarders that have a smaller group ID than the sender, in the worst case, E2E delay can be approximated as the sum of \(k-1\) one-hop delays:  
\[Z=Y_{k}+Y_{k-1}+...+Y_{2} \tag{14}\]  
where random variable \(Y_{j}\) is the one-hop delay of the node in group \(j\). Note that \(Y_{1}\) is zero, since the sink is always active. In Subsection 5.2, we show that \(S_{2}<S_{3}<...<S_{k}\) with the same value of \(x\). Since \(Y_{2}>Y_{3}>...>Y_{k}\), then \(Z<Z^{\prime}\) with \(Z^{\prime}=(k-1)Y_{2}\). If \(Z^{\prime}\) satisfies the delay requirement, E2E delay \(Z\) satisfies, as well. Let \(\mu_{j}\) and \(\sigma_{j}^{2}\) be the mean and variance, respectively, of one-hop delay \(Y_{j}\). Furthermore, let \(\mu\) and \(\sigma^{2}\) be the mean and variance, respectively, of \(Z^{\prime}\). Thus, \(\mu=(k-1)\mu_{2}\) and \(\sigma^{2}=(k-1)\sigma_{2}^{2}\).  
Therefore, if the value of \(k\) is sufficiently large, the central limit theorem states that the distribution function \(F(z^{\prime})\) approaches a normal distribution with the same mean and variance:  
\[F(z^{\prime})\simeq G\left(\frac{z^{\prime}-\mu}{\sigma}\right)=G\left(\frac{ z^{\prime}-(k-1)\mu_{2}}{\sqrtThen, \(f(z^{\prime})\), the probability density function of \(Z^{\prime}\), is as follows:  
\[f(z^{\prime})\simeq\frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{(z^{\prime}-\mu)^{2 }}{2\sigma^{2}}}=\frac{1}{\sqrt{2\pi(k-1)\sigma_{2}^{2}}}e^{-\frac{(z^{\prime}- (k-1)\mu_{2})^{2}}{2(k-1)\sigma_{2}^{2}}} \tag{16}\]  
where \(\mu_{2}\) and \(\sigma_{2}\) are calculated using Equations (12) and (13), respectively. From Equation (16), \(f(z^{\prime})\) depends on the group ID of sender node, \(\mu_{2}\), and \(\sigma_{2}\). As stated in the previous subsection, the mean and variance of one-hop delay are dependent on duty cycle interval; thus, the distribution function of \(Z^{\prime}\) depends on duty cycle interval \(T\). This means that by adjusting duty cycle interval \(T\), we can keep E2E delay under the delay bound with a given DCSR. If random variable \(Z_{0}=\frac{Z^{\prime}-\mu}{\sigma}=\frac{Z^{\prime}-(k-1)\alpha_{2}T}{\sqrt{( k-1)(\beta_{2}-\alpha_{2}^{2})T^{2}}}\), then \(Z_{0}\) has a standard normal distribution.  
Now, we substitute \(Z^{\prime}\) as the delay bound \(\zeta\); in order to satisfy the delay requirement with a given probability, the duty cycle interval should be expressed as follows:  
\[T\leq\frac{\xi}{(k-1)\alpha_{2}+\sqrt{(k-1)(\beta_{2}-\alpha_{2}^{2})Z_{0}}} \tag{17}\]  
where \(Z_{0}\) is extracted from the standard normal cumulative distribution function table with a given probability and \(Z_{0}\) stands for required DCSR \(p_{s}\). Let \(T_{max}=\frac{\xi}{(k-1)\alpha_{2}+\sqrt{(k-1)(\beta_{2}-\alpha_{2}^{2})Z_{0}}}\) denote the maximum duty cycle interval that satisfies the given delay requirement, _i.e._, at least \(p_{s}\)% of the packets are forwarded to the sink within delay bound \(\xi\). As can be seen from Equation (17), \(T_{max}\) should be a function of delay bound, node density and the required DCSR. In Section 6, using the value of \(T_{max}\), we will present network performance in DASF under different network parameters and delay requirement.