## 4 Protocol Constraints
### Length of the Beacon Interval  
The length of the beacon interval is an important design parameter for setting-up a cluster-tree network. According to the IEEE 802.15.4 standard, the beacon interval and the superframe duration (\(SD_{j}\)) are defined as follows:  
\[ \begin{cases}BI=\alpha\times 2^{BO}\\ SD=\alpha\times 2^{\text{SO}},\quad\text{for }0\leq SO\leq BO\leq 14,\end{cases}  \tag{5}\]  
where \(\alpha\) corresponds to the _aBaseSuperframeDuration_ MAC parameter. From Equation (5), it follows that:  
\[\alpha\times 2^{0}\leq SD\leq BI\leq\alpha\times 2^{14}, \tag{6}\]  
where BI and SD values are given by \(2^{BO}\) and \(2^{SO}\), respectively. The beacon interval must be large enough to ensure that all desired superframe durations can be scheduled, but should also be as small as possible to reduce the end-to-end communication delay of message transfers:  
\[BI\geq\sum_{j=1}^{N_{CH}}SD_{j} \tag{7}\]  
Considering that a message stream \(S_{i}\) generates a new message to be transferred every period \(P_{i}\), and that a node is able to send messages only during its cluster active period, there is a direct restriction imposed by the beacon interval upon the message stream periodicity. As the message generation period is not synchronised with the beacon arrivals, it may occur a message \(M_{i}^{k}\) being generated immediately before the end of the active period of the cluster, and therefore there is no enough time to transmit that message (Figure 5). As a consequence, it would only be transmitted during the next active period. Figure 5: Length of beacon interval regarding message periodicities. Thus, considering \(\delta\) as the maximum required time (contention time plus transmission and acknowledgement times) to transmit message \(M_{i}^{k}\), to guarantee that \(M_{i}^{k}\) may be transferred before the next message generation, period \(P_{i}\) must be larger than the beacon interval plus \(\delta\). Considering set \(\mathbb{P}=\{P_{1},P_{2},...,P_{M}\}\) as the message periods of \(\mathbb{S}\), the following constraint applies upon the beacon interval:  
\[BI\leq min\{\mathbb{P}\}-\delta, \tag{8}\]  
where \(min\{\mathbb{P}\}\) corresponds to the shortest period for the set \(\mathbb{S}\) of defined message streams. Considering that a cluster-tree network is multihop, a message to be transferred from source to sink must go through a sequence of clusters, during a sequence of scheduled active periods. In short, Figure 5 must consider both scheduling schemes illustrated in Figures 3 and 4. A consequence of this multihop operating behaviour is that different scheduling approaches may or may not prioritise upstream traffic. The constraint defined in Equation (8) is adequate for a bottom-up scheduling scheme, as a message generated at the deepest source node is able to reach the sink node in just one beacon interval. However, using a top-down scheduling scheme, the generated message would take several beacon intervals to be delivered to the sink node. Thus, a protocol constraint that must be satisfied by the cluster-tree network would be as follows:  
\[depth_{MAX}\times BI\leq min\{\mathbb{P}\}-\delta,\quad\text{for top-down scheduling} \tag{9}\]  
Therefore, by combining Equations (7)-(9), a Protocol Constraint that must be satisfied by the superframe duration of any cluster in a cluster-tree WSN is:  
\[\sum_{j=1}^{N_{\text{C}H}}SD_{j}\leq BI\leq \begin{cases}P_{min}-\delta,&\text {for bottom-up scheduling}\\ \frac{P_{min}-\delta}{depth_{MAX}},&\text{for top-down scheduling}\end{cases}  \tag{10}\]  
Considering both the protocol constraint (Equation (10)) and the way how MAC parameters can be setup (Equation (6)), the beacon interval may assume just an integer set of values ranging from the sum of superframe durations up to the shortest period of the set of message streams (\(P_{min}\)). This consideration represents an important design constraint for cluster-tree networks. Figures 6 and 7 illustrate this design constraint.