## 4 Enhanced Objective Function for Routing in Agricultural Low-Power and Lossy Network
### Scalable Context-Aware Objective Function with Composite Routing Metrics  
By adapting RPL to PA applications, basically, A-LLNs are able to support environmental monitoring and remote control applications in the real world environment. Further efforts are needed for an  
Figure 1: A-LLN scheme. SN2 has to forward the messages from SN4, SN6, and SN7 to the sink. Consequently, it will become inactive due to the hotspot issue. Figure 2: RPAL OF selects the neighbor with the viable ETX and the highest RE to be the preferred parent. investigation of the routing metric combination and proving its efficiency (_i.e._, loop-free, optimality and convergence). For this purpose, Scalable Context-Aware Objective Function (SCAOF) is a lightweight solution to properly utilize a set of metrics in the RPAL model. Apparently, using a composite of the primary routing metrics ETX and RE is not sufficient to mitigate the intricacies of real world A-LLNs. For example, an environmental monitoring application in the experimental field is loss and delay tolerant. Thus, a tradeoff might be performed in these two metrics. Namely, an ETX routing metric can have a higher threshold taking the retransmission mechanism into account. If A-LLN sensor nodes are required to support responding for the sensing data queries or remote control actuators in a parcel of field, the communication reliability is more important than any other performance perspective, including energy consumption. SCAOF in RPAL is a specific algorithm based on a routing algebra and routing metrics composition approach for real world A-LLNs. Moreover, additional resource-aware metrics are combined into the RPAL model through SCAOF, which can provide a more practical upward routing path after integrating context-aware resources into the best parent decisions. In [66], its authors provide a more detailed theoretical background (_i.e._, principles and basic theorems of routing algebra), and methods to prove and evaluate the designed composite metrics. However, an abstract RPL model in JSIM network simulation [37] could only present the performance of combining primary metrics at a restricted level. Therefore, SCAOF will be validated in cross-level simulation using Cooja and evaluated in a hardware testbed, which can introduce more precise properties of realistic wireless network scenarios. Furthermore, our contribution is able to generalize the composite metric manner for application in real world systems. The composite routing metric solution follows the routing algebra stated in [67]. One routing metric defined by ROLL WG [26] can be formally represented as a quadruplet \((S,\bigoplus,\omega,\preccurlyeq)\) path weight structure, where S is the set of paths, \(\omega\) is a OF that maps a path or a link to a weight value, \(\preccurlyeq\) is a special order relation and \(\bigoplus\) is the path concatenation operation. For example, where \(\omega(\alpha)\preccurlyeq\omega(\beta)\) means \"path \(\alpha\) is lighter (better) than or equal to path \(\beta\)\", \(\preccurlyeq\) provides a total order of weights and it can cooperate with \(\omega\) to capture different path and node characteristics (_i.e._, delay, bandwidth, hop count, link reliability, energy consumption, _etc._). The essential purpose of routing algebra is to use appropriate metrics for routing packets along the lightest/optimal path according to the decisions based on an ordered path set. Furthermore, it also introduces two primitive properties of routing metrics composition: monotonicity and isotonicity. Briefly speaking, if a selected metric is monotonic, then the network topology made by this metric can be free of loops. In other words, the monotonic property could ensure network convergence for a routing algorithm. The isotonicity property essentially affects the order of the path weights and could guarantee the convergence is optimal for distance vector protocols like RPL.