# Routing Protocols for Low Power and Lossy Networks in Internet of Things Applications
## 4 Enhanced Routing Solutions for Internet of Things Networks
### P2P Communication Support
After, the root with the lowest absolute angle difference between the source and the destination is selected as the anchor node. Subsequently, the algorithm tries to perform the routing of packet using greedy forwarding. In this mode, the node holding the message tries to send it to its neighbor with one hop to reach the message destination. If this is not possible, the algorithm assumes the GeoRank mode and then forwards the packet to the preferred parent in the path to arrive at the selected anchor. This forwarding process should occur until the message reaches a node closer to the destination than the anchor node. If this condition is attained, the greedy forwarding mode is assumed again. Otherwise, the message reaches the anchor and is forwarded in the face routing mode of GOAFR until it comes to its destination. In GeoRank, due to the use of geometric calculation, all nodes of the network must be static or be equipped with GPS. The use of mobile nodes is possible when they can communicate with a static node using just one hop. Furthermore, the message to be routed must store information about the position of its anchor. Although the authors used smart lighting system as an example of application for using GeoRank, they highlighted that the proposed solution might not meet the requirements of this kind of application. Considering that the majority of P2P routing protocols, including P2P-RPL, flood the network with control packets to create routes, provoking great overhead and energy consumption, [PERSON] et al. [65] proposed the Energy-efficient Region-based Routing Protocol (ER-RPL). The approach aims to allow an energy-efficient P2P communication without harming the network's reliability. ER-RPL presents a hybrid approach, mixing proactive and reactive features based on RPL. The main idea of the protocol is to segment the network into different regions and realize the P2P route discovery, just considering the areas in which the nodes are located. To this end, ER-RPL requires the existence of location-aware nodes (e.g., equipped with GPS) in the network, named Reference Nodes (RN). The protocol uses the coordinates of RNs to partition the network into different regions and to calculate the distance between nodes and RNs. Afterwards, the nodes, based on the distance to RNs, should select their  
Figure 5: Transmission of a P2P message from node S to node D. The dotted lines with an arrow represent the path created by RPL, while the solid lines with an arrow represent the path established by P2P-RPL. regions. A binary number, named the Region Code (RC), identifies each region. This process occurs in an initial stage of the protocol when the RNs floods the network with Region Formation Object (RFO) control messages. For a P2P communication, the source node first should send a P2P route request to the destination node using the root node, i.e., the default route of RPL. This request is made using a control message named Message Request Object (MRO). After receiving the MRO, the destination node should verify whether the existent path is satisfactory based on the route cost. If valid, the destination node, through the reverse path and using an MRO, should inform the source node to start the sending of data. Otherwise, the destination should initiate the process of region-based route discovery. In this process, the destination node uses MRO to create a temporary DODAG just considering the regions between it and the source. Subsequently, this DODAG is used to send the data packets. Note that, at this stage, RN does not realize any task. Thus, ER-RPL functioning, although complex, can reduce the network energy consumption by avoiding the flooding of the whole network with the P2P route discovery packet. Further, the approach allows the sending of P2P messages without the use of a root node, creating near-optimal paths that can fulfill the reliability requirements of applications. For the other traffic patterns, such as MP2P, ER-RPL uses the structure built by default RPL functioning.