# A Deadline-Aware Scheduling and Forwarding Scheme in Wireless Sensor Networks
## 5 A Deadline-Aware Scheduling and Forwarding Scheme
### One-Hop Delay Distribution  
In this subsection, we describe the estimation of the one-hop delay distribution of node \(A\) in an arbitrary group \(j\) (\(2\leq j\leq k\)). Let \(m\) denote the number of potential forwarders of node \(A\) (\(1\leq m<N\)). Node \(A\) selects the next hop among \(m\) potential forwarder(s). Let random variable \(D_{i}\) denote the wake-up time of the \(i\)-th node among \(m\) potential forwarder(s) (\(1\leq i\leq m\)). Since sensor nodes randomly and independently choose the wake up time, \(D_{i}\) are independent and identical variables. The distribution function of \(D_{i}\) is \(F_{D_{i}}(d_{i})=P(D_{i}\leq d_{i})=\frac{d_{i}}{T}\) if \(0\leq d_{i}\leq T\). Let random variable \(Y_{j}\) denote one-hop delay of the packet at group \(j\), then \(Y_{j}\) will be defined as follows: \(Y_{j}=min(D_{1},D_{2},...,D_{m})\). Let \(P(Y_{j}<y_{j}|m)\) define the probability that one-hop latency is shorter than \(y_{j}\) given \(m\), _i.e._, the probability that there exists at least one \(D_{i}<y_{j}\) if the node has \(m\) potential forwarder(s). Then, the distribution function \(F(y_{j}|m)\) of \(y_{j}\) given \(m\) is expressed as:  
\[\begin{array}{rcl}F(y_{j}|m)&=&P(Y_{j}\leq y_{j}|m)=1-\text{the probability that all }D_{i}>y_{j}\\ &=&1-\prod_{i=1}^{m}\left(1-F_{D_{i}}(d_{i})\right)\big{|}_{d_{i}=y_{j}}\\ &=&1-(1-\frac{y_{j}}{T})^{m}\end{array} \tag{9}\]  
Now, the distribution function \(F(y_{j})\) can be obtained using [PERSON]'s theorem, that is:  
Figure 3: Intersection area with different groups.  
\[F(y_{j}) =\sum_{m=0}^{N-1}P_{j}(m)F(y_{j}|m) \tag{10}\] \[=\sum_{m=0}^{N-1}P_{j}(m)\left[1-(1-\frac{y_{j}}{T})^{m}\right]\]  
where \(N\) is the total number of nodes in the given area and \(P_{j}(m)\), calculated in Equation (8) is the probability that node \(A\) in group \(j\) has \(m\) potential forwarders. From Equation (10), we calculate the probability density distribution \(f(y_{j})\) as follows:  
\[\begin{array}{l}f(y_{j})=\frac{dF(y_{j})}{dy_{j}}\\ =\sum_{m=1}^{N-1}P_{j}(m)\frac{m}{T}(1-\frac{y_{j}}{T})^{m-1}\end{array} \tag{11}\]  
Because each node randomly chooses the active time in the duty cycle interval period, the one-hop delay should be less than the duty cycle interval or \(0\leq Y_{j}\leq T\). Thus, the mean (\(\mu_{j}\)) and variance (\(\sigma_{j}\)), respectively, of one-hop delay \(Y_{j}\) are calculated as follows:  
\[\begin{array}{l}\mu_{j}=\int_{0}^{T}y_{j}f(y_{j})\,dy_{j}\\ =\int_{0}^{T}y_{j}\left(\sum_{m=1}^{N-1}P_{j}(m)\frac{m}{T}(1-\frac{y_{j}}{T}) ^{m-1}\right)dy_{j}\\ =\sum_{m=1}^{N-1}P_{j}(m)\frac{T}{m+1}\\ =\alpha_{j}T\end{array} \tag{12}\]  
\[\begin{array}{l}\sigma_{j}^{2}=\int_{0}^{T}(y_{j}-\mu_{j})^{2}f(y_{j})\,dy_ {j}\\ =\int_{0}^{T}y_{j}^{2}f(y_{j})\,dy_{j}-\mu_{j}^{2}\\ =\sum_{m=1}^{N-1}P_{j}(m)\frac{2T^{2}}{(m+1)(m+2)}-\mu_{j}^{2}\\ =\beta_{j}T^{2}-\alpha_{j}^{2}T^{2}\end{array} \tag{13}\]  
where \(\alpha_{j}=\sum_{m=1}^{N-1}P_{j}(m)\frac{1}{m+1}\) and \(\beta_{j}=\sum_{m=1}^{N-1}P_{j}(m)\frac{2}{(m+1)(m+2)}\). Note that \(P_{j}(m)\) is a function calculated in Subsection 5.2. Then, from Equations (12) and (13), the mean and variance of one-hop delay \(Y_{j}\) can be obtained as a function of the duty cycle interval with given network parameters.