# Efficient Cluster Tree Topology Operation and Routing for IEEE 802.15.4-Based Smart Grid Networks
## 2 Overview of IEEE 802.15.4 Standard  
IEEE 802.15.4 is one of the standards for low-rate wireless personal networks (LR-WPANs). It defines the physical and MAC layers. The standard is widely used in communication based on its low price, low power, and low transmission rates. It enables devices to communicate at small distances without additional infrastructure. A LR-WPAN has the following characteristics [19]:  
* Data transmission rates of 250, 100, 40, and 20 kbps;
* Operates in a star or peer-to-peer manner;
* Assigns an address with 16-bit or extended 64-bit length;
* Guaranteed time slots (GTSs) may be allocated;
* The channel is accessed using the carrier-sense multiple access with the collision avoidance (CSMA/CA) mechanism;
* Low power consumption;
* It has 16, 30, and 3 channels in the 2.4 GHz, 915 MHz, and 868 MHz bands, respectively. In the IEEE 802.15.4 standard, the devices are divided into full-function devices (FFDs) and reduced-function devices (RFDs). An FFD is a device that operates as a coordinator or device. An RFD can only communicate with the FFD as a device that can perform a highly simple function. The standard optionally provides non-beacon and beacon modes, depending on how the devices communicate. In the non-beacon mode, the devices communicate freely using the unslotted CSMA/CA method without synchronization. In contrast, the beacon mode maintains synchronization between devices based on the beacon frames transmitted periodically from the coordinator and communicates using the slotted CSMA/CA method. In the IEEE 802.15.4 beacon mode, the interval at which the coordinator broadcasts the beacon frame is called a superframe. It is divided into 16 slots of equal size. Superframes can be divided into active and inactive durations. Figure 1 shows the structure of a superframe. The devices can calculate the active and inactive sections using the superframe order (\(SO\)) and beacon frame order (\(BO\)) values contained in the beacon frame that are transmitted periodically by the coordinator. The equations for calculating the active and inactive intervals are as follows [15]:  
\[\mathit{Beacon\ Interval}(\mathit{BI})=\mathit{aBaseSuperframe}Duration\times 2 ^{BO} \tag{1}\]  
Figure 1: The structure of a superframe. \[Superframe\ Duration(SD)=aBaseSuperframeDuration\times 2^{SO} \tag{2}\]  
In the IEEE 802.15.4 standard [15], the value of aBaseSuperframeDuration in the above two equations is set to 960 slot times, and the ranges of the \(BO\) and \(SO\) are limited to 0-14. Furthermore, the values of the \(SO\) and \(BO\) should be selected appropriately by considering the relationship between the energy efficiency and transmission delay. In the beacon mode, the devices communicate using a slotted CSMA/CA scheme. Figure 2 shows the operation flow of the slotted CSMA/CA. NB is a number that indicates how many backoffs the CSMA/CA algorithm requires while attempting the current transmission. It is initialized to zero before each transmission is attempted. The content window (CW) defines a backoff period during which no channel activity should occur before transmission begins. The backoff exponent (BE) is the number of times the device waits for a backoff period before attempting to access the channel. As shown in Figure 2, the NB and CW values are initialized after checking whether the slot is slotted or unslotted. In slotted CSMA, the node waits at the boundary of the backoff period, delays for a random backoff time, and then performs clear channel assessment (CCA) at the backoff period boundary. If the channel is idle, the CW value is decremented by one, and the same process is repeated until CW reaches zero. If the channel is not idle (i.e., the channel is in use), the NB and BE values are incremented by one, within the limit of macMaxBE, as long as the channel is not idle. If the NB value is less than or equal to macMaxCSMABackoff, the random backoff process is performed again. If the NB value is greater than macMaxCSMABackoff, the channel access fails, and the process terminates.