# Predictive Energy-Aware Routing Solution for Industrial IoT Evaluated on a WSN Hardware Platform
## 4 PEAR Solution: Model Design and System Implementation
### PEAR Algorithm Description  
The PEAR algorithm is a post-network-formation mechanism examining the energy consumption across the network and signaling the appropriate changes to respect the consumption constraints of each energy profile. PEAR logically separates the network in energy clusters and uses the ISA100.11a standard management mechanisms for projecting the energy constraints into the network routing graphs. The energy consumption can be balanced, with priority, among the field devices belonging to different profiles but also within the same profile. This approach creates higher flexibility and number of available routing changes at the possible cost of longer algorithm convergence time and a higher number of routing changes. ISA100.11a field devices report their energy consumption using periodic communication links. If a device reports a consumption rate larger than its corresponding energy profile, the PEAR algorithm will attempt to lower the consumption by routing one of its children to another parent. The expected outcome of this change is that a device that accepts more traffic load will become the new parent of the rerouted child whereas the old parent will have fewer packets to route and thus, a lower energy consumption. The new parent candidate must have its consumption rate within its energy profile. However, due to data publish configuration or network management changes, there is no guarantee that, after accepting the traffic load from its new children, the new parent will remain within its profile consumption limits. If the new parent exceeds its profile consumption rate after a change, it becomes a candidate for energy correction. The routing and topology algorithms are proprietary to Control Data Systems and cannot be disclosed. However, as presented in the paper, the implementation-specific configurations such as (1) energy diagnostics update period, (2) number of topology layers and (3) bandwidth allocation were not altered since PEAR aims to be an adaptable and non-intrusive algorithm. Running an ISA100.11a network requires frequent execution cycles, under one second, for core and time-critical tasks such as data publishing as well as larger execution cycles, over one minute, for the supporting tasks such as network status reporting. The PEAR algorithm aims to provide energy balancing support without interfering with the control and monitoring performance. The evaluation period was empirically set to one minute, which is considered large enough not to affect the efficiency and performance of the ISA100.11a management modules and small enough to provide more routing change opportunities for the PEAR algorithm. Moreover, given that CDS VR950 Gateway [10] collects new energy information from field devices every 30 s, a one minute evaluation period ensures that for each evaluation cycle the energy information is updated. Within each evaluation cycle, the energy consumption is assessed for a maximum of 10 field devices to limit the processing load. The field devices are configured to provide periodical reports comprising the number of Tx and Rx timeslots used within an implementation-specific update period of 30 s. The reported consumption rate is compared with the corresponding energy profile. The energy consumption is considered within the profile limits if both the DPDU Tx and Rx rate are below the energy threshold. If the energy consumption of a field device exceeds the profile threshold, PEAR initiates the energy correction procedure. When the energy profiles are properly set, the additional energy consumption is generated by routing the traffic of other devices. More specifically, the Tx timeslots used by the children devices represents the additional Rx timeslots carried by the parent device. The PEAR strategy is to unload the overconsuming device from the data traffic generated by the children having the highest Tx rate.