# Predictive Energy-Aware Routing Solution for Industrial IoT Evaluated on a WSN Hardware Platform
## 4 PEAR Solution: Model Design and System Implementation  
The PEAR algorithm leverages the ISA100.11a routing and resources allocation mechanisms to balance the energy consumption and to add energy awareness by signaling appropriate topology changes. The ISA100.11a standard defines a centralized network architecture where the network formation is the responsibility of the SM. The network topology and communication routes decisions are based on periodic network reports received from field devices indicating the quality of wireless links from a device perspective regarding their immediate neighbours. While the structure and interpretation of network reports are standardized, the routing and resource allocation decisions are implementation-specific. Two routing schemes can be adopted within an ISA100.11a network, namely, source and graph routing [2]. The former specifies each hop along the path from the originating device to the destination. However deterministic, source routing is not adaptable to changes such as wireless conditions and hardware failure. Each hop along the path becomes a single point of failure affecting the system reliability and resilience to failure. Source routing is better suited for transitory communication such as the initial attachment of field devices to the ISA100.11a network. Graph routing specifies a communication path from one node to another along directed graphs representing a set of directed connections between devices called links. The links between two devices represent scheduled and cyclic communication opportunities during one or more timeslots (TS) of 10 ms. A neighbour is considered the device at the other end of a communication link; therefore, each device has a set of neighbour devices as candidates for packet forwarding. Routing redundancy is implemented by overlapping graphs and assigning preferred and backup neighbours indicating that the preferred link should be used even if a backup link is available sooner. The graphs are allocated by the system manager and each field device keeps a graph table to route packets to the next applicable neighbour. For the inbound traffic, from field devices to the system manager, redundant links are allocated whereas, for the outbound traffic, from the system manager to field devices, only redundant paths (i.e., sequences of links) are allocated. PEAR algorithm implementation adopts graph routing due to its failure resilience and configuration flexibility that makes it better suited for a dynamic ISA100.11a mesh network. Alongside the neighbour table, each device has associated a neighbour candidates table. It specifies the quality of the physical link in terms of RSSI (received signal strength indicator, a measure of SNR) and RSQI (received signal quality indicator, a measure of bit error rate), with at least five devices in the network [2]. Each candidate can become a neighbour if it respects physical communication quality criteria, and the system manager updates the graph routing scheme to include a communication link with the candidate device. The PEAR algorithm is constrained to generate an energy solution having available only a subset of devices, namely the ones indicated in the neighbour and candidate device tables. These tables are dynamically allocated depending on the physical environment, setup and installation. In this regard, PEAR is also a dynamic algorithm adapting to the variance in network conditions and resources. PEAR is designed to provide energy management for an ISA100.11a network that can be abstracted as a multilayer mesh topology employing graph routing and having redundant links, preferred and backup, for all inbound traffic. Each field device is configured to have dual ISA100.11a role namely, input/output and router. Therefore, each field device can send its sensor data packets as well as forward the sensor data packets of their neighbour devices.