# A Reconfigurable Formation and Disjoint Hierarchical Routing for Reshapeable Bluetooth Networks
## 5 Disjoint Hierarchical Routing
For the packet transmission of inter-subnets, two shortest routing paths of mesh-subnet are generated to deliver the packets from one subnet to the sink node. In the tree-subnet, the packets are delivered with an optimal path from source to destination in its own subnet by its own root. In the mesh-routing algorithm, two equal disjoint paths with rechargeable modules are used to improve the network operation time. During packet transmission, each master node periodically exchanges its energy arrival rate and battery capacity with harvested solar energy. Two battery capacity counters, \(c1\) and \(c2\), are defined for each master node, specifying the energy cost from two disjoint routing paths to all destinations. Several applications can be operated using this mesh-tree network, such as _ad hoc_ or sensor networks. If the destination node is located at the mesh-subnet for sensor network application,the master will select the path to the destination with the larger counter value, either \(c1\) or \(c2\), and deliver packets to the destination as the sink directly. However, if the destination node is located at another tree-subnet for _ad hoc_ network application, each new root will first pass the packets to its directly-connected master with the largest counter value in the mesh-subnet. This master then examines the destination ID, checks the \(k\)-hop routing table of the destination, and passes the packet to the next master, since each master has the \(k\)-tier routing information. With the routing assistance of masters in the mesh-subnet, the packets from a source node will be delivered to the correct destination root of the tree-subnet. Finally, the new root passes the sensor packets to its downstream nodes to their final destination. The procedures described above can achieve the packet transmission over inter-subnet communication. The detailed operation diagram of two disjoint paths routing is shown in Figure 7.  
For WSN application, a source node with ID = 1 transmits packets to the sink with ID = 10. The source node owns two equal paths, including 1-2-3-4-10 and 1-6-7-8-10, to reach the sink and all forwarding nodes of the two paths are independent. When the event is triggered and the packet is generated from ID = 1, the source node selects the path to the destination with the larger counter value, either \(c1\) or \(c2\), and delivers packets to the destination as the sink directly. Within a tree-subnet, the routing algorithm for packet transmission is as follows: When any node starts to transmit packets or receive routing packets, it examines its routing information first. If a destination is contained in its routing table, a packet is delivered to the corresponding downstream node. Otherwise, this packet is forwarded to its upstream master. Since the new root possesses the complete spanning tree-subnet routing information, a packet will eventually reach the destination node or pass to the mesh-subnet. The detailed operation diagram of tree-subnet routing is shown in Figure 8.  
Figure 7: Flow diagram of two disjoint paths routing in a mesh-subnet.