## 3 Results: Network Performance
### Throughput  
The number of transmissions or receptions in a frame is the number of positive or negative elements of Equation (11). With the proposed method, Equation (11) can be easily built for any N and realize that this number is \(2(N-1)\). A more rigorous explanation is based on counting the negative valued elements (receptions) in Equation (11). Since there are two negative elements in each Equations (7)-(10), and the right end column of the matrix has no negative values, in a string network with \(N\) nodes, the optimal scheduling in Equation (11) will have \(2(N-1)\) transmissions/receptions in the frame. Since the period is four time slots, the theoretical average throughput (1) is given by:  
\[S=\frac{2\;(N-1)}{4}=\frac{N-1}{2}\;. \tag{13}\]  
The throughput in Equation (13) is close to the throughput of the perfect schedule, which has a value of \(N/2\), impossible to obtain in a linear network, as discussed above. The difference is \(100/N\) per cent: the larger \(N\), the smaller the relative difference between the throughputs of both schedules. Obviously, since a node cannot transmit and receive simultaneously, the upper bound of the throughput is \(S_{max}=1/2\). We denote \(\lambda_{j}\) to be the packet generation rate of node \(j\) and consider equal offered traffic by all sensor nodes. In order to achieve this upper bound, the packet generation rate of the \(j\) node, \(\lambda_{j}\), can be calculated as:  
\[(N-1)\cdot\lambda_{j}=\frac{1}{2}\;\;\;\Rightarrow\;\;\lambda_{j}=\frac{1}{2(N -1)}\;. \tag{14}\]  
For comparison purposes, we can consider a simple fair schedule where every sensor node only transmits one self-generated packet to the Gateway in a frame (Figure 8). The frame length of this scheduling is given by:  
\[T=\left\{\begin{array}{rl}&7+5\;\frac{N-4}{2}\;\;\;\mbox{if $N$ even,}\\ &4+5\;\frac{N-3}{2}\;\;\;\;\mbox{if $N$ odd.}\end{array}\right. \tag{15}\]  
Equation (15) is obtained by inspection of the graphics shown in Figure 8, up to \(N=7\). Due to the regularity of the network structure, it is also true for larger networks. A packet generated in node \(j\) will be relayed \(j-1\) times to reach the Gateway. Therefore, the total number of transmissions in one frame is:  
\[\sum_{j=2}^{N}j-1=\frac{N(N-1)}{2}. \tag{16}\]  
The average throughput is the number of transmissions in a frame divided by the frame length. Using Equations (15) and (16) we obtain:  
\[S=\frac{\frac{N(N-1)}{2}}{T}=\left\{\begin{array}{rl}&\frac{N(N-1)}{5N-6}\; \;\;\mbox{if $N$ even,}\\ &\frac{N(N-1)}{5N-7}\;\;\;\;\mbox{if $N$ odd.}\end{array}\right. \tag{17}\]Figure 9 compares the throughput results of both optimal and simple fair schedules and the perfect schedule, showing that the optimal is the non-perfect schedule with the highest average throughput in the network. The reason not to achieve the throughput of the perfect schedule lies in the border effect: the last node never receives data from another node.  
Figure 8: Simple fair schedule (one frame) examples for different string network sizes (\(N\)): (**a**) \(N=3\) (\(T=4\)), (**b**) \(N=4\) (\(T=7\)), and (**c**) \(N=5\) (\(T=9\)). The \(Q\) matrix is shown for each case. For \(N=2\), the solution is trivial with period \(T=1\). The three states for the nodes are represented keeping the convention used in Figures 5 and 6.  
Figure 9: Throughput obtained by the optimal (cross marker) and simple fair (square marker) schedules in a \(N\)-nodes string network. In order to compare both with the ideal limit, the throughput for a perfect schedule (circle marker) is also shown.