## 2 Background  
### IEEE 802.15.4/ZigBee Cluster-Tree Topologies  
A cluster-tree topology is a special case of a peer-to-peer network. In a cluster-tree topology, nodes/devices are grouped in clusters, coordinated by a FFD node called Cluster-Head (CH). The CH provides synchronisation mechanisms for its associated nodes and centralises all intra-cluster communication. The cluster-tree network formation is initiated by the PAN coordinator, which acts as coordinator for the network, being responsible for all network management activities. According to the IEEE 802.15.4 standard, the simplest case of a cluster-tree network is a single cluster (coordinated by the PAN coordinator). New nodes may be allowed to create their own clusters, increasing the coverage of the network. Within this context, several neighbouring clusters can be used to build wide-scale cluster-tree networks, where the coordinators are connected by parent-child relationships, forming a multicluster hierarchical network structure. Figure 3 shows an example of an IEEE 802.15.4 cluster-tree network. Although considering cluster-tree networks, the IEEE 802.15.4 standard does not discuss the required network formation mechanisms. The ZigBee specification provides these mechanisms, defining a hierarchical addressing scheme and the associated tree routing algorithms, where network addresses are assigned based on address blocks. Thus, each cluster-head has its own block of sequential addresses, which are assigned to its child nodes. Based on this hierarchical addressing, ZigBee also provides a deterministic tree routing scheme. In this scheme, routing is based on the destination address. In case the destination address is a descendant node, the packet is forward to the corresponding child node; otherwise, the packet is forward to the parent node. In cluster-tree topologies, the network operates in a beacon-enabled mode. In this mode, communication exchanges are organised according to a structure called Superframe. A superframe is bounded by beacon frames periodically transmitted by the coordinators (cluster-heads). These beacon frames synchronise the associated nodes, identify the PAN and describe the superframe structure. Figure 4 illustrates the superframe structure. The superframe is described by the _macBeaconOrder_ (BO) and _macSuperframeOrder_ (SO) parameters, where Beacon Interval (BI) and the Superframe Duration (SD) are defined as follows:  
\[BI=a\text{BaseSuperframe}\text{Duration}\times 2^{BO}(symbols) \tag{1}\] \[SD=a\text{BaseSuperframe}\text{Duration}\times 2^{SO}(symbols), \tag{2}\]  
with \(0\leq SO\leq BO\leq 14\). Figure 4: IEEE 802.15.4 Superframe structure. Figure 3: Cluster-tree networking topology. BI defines the interval at which the coordinator periodically transmits beacon frames. In turn, the SD parameter defines the length of the active portion of the superframe. The aBaseSuperframeDuration parameter defines the minimum duration of the superframe when SO is 0. The IEEE 802.15.4 standard defines this parameter with 960 symbols duration, which corresponds to 15.36 ms (assuming a network with bit rate of 250 kbps, frequency band of 2.4 GHz, and one symbol as 4 bits). Each superframe is divided in two parts: the active and inactive periods. During the inactive period, the coordinator and associated nodes can enter in low power mode to save energy (sleep mode). During the active period, nodes can communicate with the coordinator. The active part (communication period) comprises two periods: Contention Access Period (CAP) and Contention-Free Period (CFP). In the CAP period, whenever a device wishes to communicate, it contends with other devices using a slotted Carrier Sense Multiple Access with Collision Avoidance (CSMA-CA) procedure to access the channel. The CFP is defined for applications that require low latency or specific bandwidth. In the CFP period, the coordinator allocates Guaranteed Time Slots (GTS) for specific nodes. In these slots, nodes can transmit data without contending for the channel access.