## 7 SensorNC Applications
### TDMA Optimization
#### Analytical Solution in the Fluid Setting  
In the following, we first discuss the ESS relaxation in a simple, yet illustrative example of a two-hop sensor network, as shown in Figure 15.  
We assume the rate-latency curves as fluid approximations for the TDMA service in order to keep the problem analytically tractable. Based on this, we show how in the general sink tree case of fluid service curves we can derive an optimal solution. Figure 15: Two-node example network. Under ESS and in the two-hop network, we obtain the following incarnation of the optimal TDMA problem:  
\[ \begin{array}{ll}\max.&Z=f-s\\ \mathrm{s.t.}&s\leq\frac{f}{2}\\ &d_{2}(f,s|r,b,C)=\frac{\frac{s}{f}C(f-s)+2b}{\frac{s}{f}C-r}+f-s\leq D\\ &\frac{s}{f}\cdot C\geq 2r\\ &f\geq 0\end{array} \]  
Since the objective function is linear, the solution to this optimization problem must lie on the border of the feasible region (it is guaranteed to exist since the feasible region is closed). In Figure 16, the feasible region, as well as a contour line of the objective function are drawn (for \(r=1,b=1,C=10,D=1\)). It can be seen that the optimum must be taken on at the lower border of the feasible region. In fact, we can write the border constituted by the delay constraint as shown in Equation (6),  
\[s=g(f|r,b,C,D)=\frac{\sqrt{C^{2}D^{2}+(6 frC-4 fC^{2})D+4f^{2}C^{2}+(16 bf-4f^{2}r )C+f^{2}r^{2}}+2 fC-CD+fr}{4C} \tag{6}\]  
because the delay constraint is a quadratic form in \(s\) and \(f\), which can be solved for \(s\) with two real solutions of which we take the larger one as it results in a more binding constraint. A moment's consideration exhibits that \(\forall f:\ \frac{\partial s}{\partial f}<1\), since otherwise, an increase in frame size would result in a larger increase of the slot size, which obviously cannot be the case. On the other hand, the partial derivative of the objective function after \(f\) is one, which means that the optimum must be taken on at the corner point of the feasible region where the delay constraint and TDMA integrity constraint intersect. In other words, the TDMA design problem under ESS can be reduced to matching the delay with the TDMA integrity constraint. Analytical Solution for ESS in General Sink Trees  
What remains to be done in general sink trees compared to the two-hop network in the previous setting is to show that the delay constraint again takes on a quadratic form. This then allows one  
Figure 16: Graphical illustration of the optimization problem for Equal slot sizing (ESS). The feasible region is above the delay constraint and below the TDMA integrity constraint. The rate constraint does not affect the feasible region in this example. to easily express the slot size as a function of the frame size, and the same arguments as in the two hop case lead to the conclusion that the optimum solution is given at the point where delay and TDMA integrity constraint are matched. Hence, let us discuss the delay constraint in a general sink tree network. We assume a general sink tree network with each node offering a service curve \(\beta_{jC,f-s}\) and flows starting from each node constrained by an arrival curve \(\gamma_{r,b}\). Looking at a particular flow, we have a situation as depicted in Figure 17. Applying the PMOO analysis results in the following left-over service curve for the flow of interest:  
\[\beta^{\text{Lo.}} = \left[\left[\beta_{R,T}-\gamma_{r_{1},b_{1}}\right]^{+}\otimes \beta_{R,T}-\gamma_{r_{2},b_{2}}\right]^{+}\otimes\ldots\] \[= \beta_{R-\sum_{i=1}^{n-1}r_{i}}\frac{\tau_{(nR-\sum_{i=1}^{n-1}r_ {i})+\tau_{i=1}^{n-1}b_{i}}}{R-\sum_{i=1}^{n-1}r_{i}}\]  
with \(R=\frac{s}{f}\)C and \(T=f-s\) and \(r_{i}=a_{i}r\) and \(b_{i}=c_{i}b+d_{i}rT\). For the latter expressions, the parameters \(a_{i},c_{i},d_{i}\in\mathbb{N}\) depend on the topology. The delay constraint for flow \(n\) (i.e., the one originating at node \(n\)) can thus be expressed as shown in Equation (7).