# Efficient Cluster Tree Topology Operation and Routing for IEEE 802.15.4-Based Smart Grid Networks
## 4 Proposed Scheme
### Proposed Cluster Configuration Scheme  
In the proposed scheme, the principles considered by the device when joining a cluster are as follows.  
First, the device is joined as close as feasible to the gateway. That is, the node joins the side with a small tree level to reduce the network latency and number of hops. Second, the nodes join by balancing loads such that these do not exceed the maximum number of permissible subscription devices. Third, the node joins as a cluster member if channel and SD allocation cannot be made, even if it intends to join the cluster head.  
Figure 6 shows the cluster-joining procedure for the device in the proposed scheme.  
In Figure 6, a node that intends to join the cluster performs the scan process. In this case, a beacon list is obtained using the beacon frames transmitted from the surrounding cluster heads. If no beacon is received, the node cannot join the network. Nodes located close to the gateway receive a beacon frame from the gateway. Therefore, these can join the gateway (to the extent feasible). If the value of the NCM field of the beacon frame received from the gateway does not exceed the maximum value, the SD selection algorithm is executed. In this case, the cluster head becomes the gateway. When assigned its SD, it joins the gateway as a cluster head. Otherwise, other nearby beacon frames need to be searched for. If none are present, it becomes an orphan node. When another beacon frame is received, it joins the cluster head by performing the following procedure.  
The node that intends to join the cluster has the smallest value of the tree-level field among the other beacon frames observed. If the value of the NCM field does not exceed the maximum value, the coordinator is selected as the cluster head. Thereafter, the CH Info field is examined to select the SD that did not overlap. If SD allocation is not feasible, the procedure is repeated for the other cluster heads (except for the corresponding cluster head). If an SD is assigned, the node joins the selected parent cluster head as a child cluster head. Otherwise, these join as cluster members.  
Nodes that intend to join as cluster members also receive beacon frames from nearby cluster heads through a scan procedure. These then select and join a cluster head with as small of a tree-level field value and an NCM field value as possible as the parent cluster head. If no accessible cluster head is identified, the node becomes an orphan node. The tree configuration process continues until the tree covers all nodes within the cluster.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**CH \#** & **SD \#** & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** \\ \hline
2 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
3 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
4 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
5 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
6 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
7 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
8 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
9 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\
10 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\
11 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
12 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
13 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\
14 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\
15 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
16 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The bit string of each CH Info N field.