## 4 A Routing Protocol for LLNs (RPL)
### RPL Objective Functions for Malicious LLNs (MLLNs)  
Security threats, such as PDAs, can significantly impact the reliability of network routing by disrupting the normal flow of data packets between the source and destination. Available security solutions for wired and ad hoc networks may not be applicable to RPL due to nodes' limited resources in terms of memory, CPU processing, and power. Multiple RPL security solutions have been proposed to (i) detect and avoid communication with malicious nodes and (ii) perform within the node constraints in LLNs. [PERSON] et al. [118] proposed the trusted RPL that secures RPL by adding a new trustworthiness metric called RPL Node Trustworthiness (RNT). Trust between nodes participating in routing is a very important factor in maintaining secure and reliable transmission. The new metric represents a trust level for each node in the network, which allows nodes to decide whether or not to trust their neighbour nodes as parent nodes during path selection. However, the proposed metric imposes high costs on the node resources; thus, it can not be applied to the constrained nodes in LLNs. As a result, all the security computations and processing have been offloaded into a small hardware device known as the Trusted Platform Module (TPM). The responsibilities of TPM include two main tasks: (i) ensuring secure cryptography and authentication methods during the transmission of control packets and (ii) performing computations and processing of nodes' behaviours. Although this solution can secure RPL against security threats, it only takes into account the trust level of direct neighbours and does not consider the trust value along the selected path. The latter drawback was overcome in [119], where [PERSON] et al. proposed a trust-based metric, namely the Extended RPL Node Trustworthiness (ERNT), that takes into consideration the trust value of all the nodes forming the path. ERNT is a quantitative and dynamic metric that aims to enhance security in RPL by establishing a trust relationship between the nodes, allowing a node to decide whether or not to trust neighbour nodes in the network. Each node calculates (i) the trust value of its direct neighbour, i.e., first hop, and (ii) the total trust value of all the nodes forming the path. The proposed metric is then integrated into RPL with a new objective function known as the trust objective function (TOF). Owing to the node constraints, a hardware security chip has been embedded in each node to (i) provide authentication and cryptography for control packet transmission and (ii) offload the extra computations and processing for ERNT metric. Experimental results show that TOF has better performance in terms of node trust, leading to the selection of more secured paths compared to MRHOF [85]. However, both solutions [118, 119] impose excessive costs on the nodes; thus, they require an impeded security chip as they can not be applied directly to the nodes. In addition, they only take into account the reliability issues caused by malicious nodes, and did not consider other reliability issues caused by the link quality or node energy. [PERSON] et al. [120] proposed a security framework for RPL known as the Gini Index-Based Trust Mechanism (GITM). GITM uses a layered system as it separates the process of detecting the security attacks from the nodes in a separate layer. The fog layer is assumed to be reliable, secure, and trustworthy. In this layer, three main processes are performed. By adding a fog layer, nodes present in the network do not calculate trust in themselves. Because it consumes a significant amount of energy, network nodes can also be attacked and compromised, leading to security issues. Therefore, all the trust calculations are performed in the fog layer, which is fully trusted. Simulation results show that GITM significantly detects the attacks and improves detection rate, latency, and energy consumption.