## 4 Proposed Scheme
### Identity, Route, and Location Privacy (IRL)  
Our proposed identity, route and location privacy scheme works in two phases. The first is neighbor node state initialization phase, and the second is routing phase. _Route Privacy:_ In initialization phase, let the node \(i\) have \(m\) neighboring nodes in which \(t\) nodes are trusted. So, \(0\leq t\leq m\) and \(M(t)=M(t_{F})\cup M(t_{B_{r}})\cup M(t_{B_{l}})\cup M(t_{B_{m}})\). Here \(M(t_{F})\), \(M(t_{B_{r}})\), \(M(t_{B_{l}})\), and \(M(t_{B_{m}})\) represent the set of trusted nodes that are in the forward, right backward, left backward, and middle backward directions, respectively. These neighbor sets (\(M(t_{F})\), \(M(t_{B_{r}})\), \(M(t_{B_{l}})\), and \(M(t_{B_{m}})\)) are initialized and updated whenever a change occur in neighborhood. For example, the entrance of a new node, change of a trust value, _etc_. Whenever a node needs to forward a packet, the routing phase (Algorithm 1 for source node and Algorithm 2 for intermediate node) of IRL algorithm is called. Whenever a source node (Algorithm 1) wants to forwards the packet, it will first check the availability of the trusted neighboring nodes in its forward direction set \(M(t_{F})\) (Line 2). If trusted nodes exists then it will randomly select one node as a next hop (Line 3) from the set \(M(t_{F})\) and forward the packet towards it (Lines 13:21). If there is no trusted node in its forward direction, then the source node will check the availability of a trusted node in the right (\(M(t_{B_{r}})\)) and left (\(M(t_{B_{l}})\)) backward sets. If the trusted nodes are available then the source node will randomly select one node as a next hop (Line 3) from these sets and forward the packet towards it (Lines 13:21). If the trusted node does not exist in these sets either, then the source node will randomly select (Line 8) one trusted node from the backward middle set (\(M(t_{B_{m}})\)) and forward the packet towards it (Lines 13:21). If there are no trusted nodes available in all of the sets then the packet will be dropped (Line 9:10). When an intermediate node (Algorithm 2) receives the packet (either from the source node or from another en-route node), it will first check whether the packet is new or old (Line 3). If it is new, then the node will first check the availability of the trusted node from the forward direction set (\(M_{F}\)) excluding the \(prev_{hop}\) node if it belongs to forward set (Line 13). If trusted nodes exists in the forward set then the node will randomly select any one trusted node as a next hop (Line 14) and forward the packet towards it (Line 45). If there is no trusted node available in the forward direction, then it will check to which set the sender of the packet belongs to. For example, If the packet, forwarded by a node, belongs to the right backward set (Line 16), then it will first check whether the left or middle backward sets contain any trusted nodes (Lines 17:18). If so, it will randomly select one node from those sets (Line 19) and forward the packet towards it (Line 45). If there is no trusted node in those two sets, then the node will randomly select a trusted node from the right backward set (\(M(t_{B_{r}})\)) excluding the one from which the node received the current packet (Lines 20:21) and forward the packet towards it (Line 45). Similar operations will be performed, if the packet, forwarded by a node, belongs to the left (Lines 25:33) and middle backward or forward (Lines 34:43) sets.