{'fraction_non_alphanumeric': 0.025156964079784735, 'fraction_numerical': 0.008627685473882032, 'mean_word_length': 4.498825739783936, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Proposing a Method for Enhancing the Reliability of RPL Routing Protocol in the Smart Grid Neighborhood Area Networks

The RPL routing protocol is one of the most prominent protocols for low-power wireless networks. It has many benefits, including high flexibility and compatibility with different topologies, quality assurance, automatic configuration, self-healing, avoiding the creation of tree loops, and independence and transparency. Since the RPL's capability to meet the reliability requirements has not been sufficiently investigated and there is not much research about the reliability of this protocol, the purpose of this study is to propose a method for enhancing the reliability of RPL routing protocol in the Smart Grid Neighborhood Area Networks (NAN). We propose three methods for increasing the reliability of the RPL protocol: addition of cache at each node, considering two parents for each node and finally the combination of the two mentioned methods. The type of research is descriptive-analytic. Simulations have been performed in OPNET simulator. The results of this study indicate that the proposed methods significantly increase the reliability of this routing protocol in Smart Grid NAN.


I. INTRODUCTION
Smart Grid is an automated power system that monitors network activities, bilateral power supply, and information between power plants and consumers. Its goal is to provide reliable power and to meet growing customers' needs with the least damage to the environment. Due to the great benefits of Smart Grid, using this technology is becoming increasingly important. Smart Grids communication network consists of three parts: Home Area Network (HAN), Neighborhood Area Network (NAN), and Wide Area Network (WAN). HAN is the network of intelligent electrical appliances and the smart meter inside the home. HAN connects various smart devices to achieve optimal energy consumption and response to demands. NAN connects smart meters, and WAN is the backbone of communication links between the NAN and the control center [1]. [2] NAN's are of great importance in the communication network and should be very reliable. And this is one of the most important goals of these types of networks. For example, consider smart washing machines on this smart grid. The washing machine is one of the devices that can be scheduled by the power system control center. For this, the washing machine first sends a request to the control center, and the control center returns an answer indicating when the device can start working. If control information lost, the device will not work properly, and it may even cause a fire. So reliable information transfer is a key feature. Because of the advantages of wireless communications such as flexibility and low cost, it is a major candidate to be applied in NAN. However, wireless networks are not reliable, and one of the main requirements of the Smart Grid communication network is reliability. Distributed monitoring and control of tools and network resources requires a reliable two-way communications infrastructure. In such a communication system, which is characterized by the connectivity of thousands of devices with limited resources such as smart meters and electrical appliances, routing protocol plays a crucial role in ensuring timely and reliable communication services. RPL is a routing protocol based on the DODAG 1 tree design. It was standardized by the IETF in 2008 for low-power networks. This protocol has many benefits, and many studies have been done on it. The RPL is based on the concept of constructing the DODAG tree. Smart meters are the nodes of this tree that periodically send their measurements to the root of the tree. Each node in this tree can have multiple parents and send the packet to the root of the tree through their parents. Despite the popularity of RPL, RPL's capability to meet reliability requirements has not been sufficiently investigated, and there has been little research on the reliability of this protocol. The purpose of this paper is to provide a method for increasing the reliability of the RPL routing protocol in the Smart Grid NAN. We suggest three methods to improve the reliability of RPL. The first method is to use the cache on all nodes in the DODAG tree. It means, when a packet is generated in a node, it stores that packet in its cache and then sends it. Along the way, any node that receives the packet stores it in its cache before sending it to its parent. When the root does not receive a packet, sends the request for it via the path that is determined by the packets reached to the root. The recipient node searches its cache, and if it is available, it sends it to the root. Otherwise, it will send the request message to its child, and this process continues. The second method is to use two parent nodes in the DODAG tree. In this way, each node in the tree has a second parent in addition to its preferred parent. The packet will be sent simultaneously to both parents. So if one of the links crashes, the packet will be directed to the root via the other link. The third proposed method is the combination of the two mentioned methods.

A. RPL routing protocol
RPL is a distance vector routing protocol and source routing protocol. It can work on different MAC layer mechanisms. RPL is based on the topological concept of DODAG, which is an acyclic and target-oriented graph [3,4]. Its structure includes a tree species which defines network default paths. In DODAG, each node can have more than one parent, while in a typical tree, each node has only one parent. RPL organizes its nodes within a DODAG [5]. The formation of DODAG consists of two steps:

Building upward paths:
To build DODAG, the root of DODAG broadcasts a control message called DIO 2 to advertise graph id and its own rank and let other nodes recognize their position within the network. When this message reaches a node, that node: i) Adds the DIO sender's address to its parent's list. ii) Calculates its rank using the objective function. The node's rank will be higher than the rank of all parents.
iii) Updates the DIO packet by its own rank, and rebroadcasts the updated packet.
This process is repeated to gain the rank of all network 2 Dag Information Object nodes. Each node must select a node from its parent's list as its preferred parent (default parent) to direct data packets to the root. When a node joins the DODAG graph, if it receives a DIO message, it can process it in three ways: i) Removing the DIO packet according to some of the RPL rules.
ii) Processing the message to maintain its position inside the network.
iii) Improving its position by getting a lower rating within DODAG.
Whenever a node lowers its rank, it must remove all parent nodes that their rank is more than the newest rank from its parent list. This act can prevent the creation of a loop on the network. After the end of this step, each node has a default path to the root and can send its data packets to the root. Figure 2 shows the steps for constructing a graph upward.

Building downward paths:
In the DIO message, if the flag of performance type is non-zero, downstream paths from roots to nodes should be supported and maintained. In this case, each node must send a DAO message to its parent to determine return-path information. When the DAO packets move from nodes to the root, they store the address of nodes that meet in upward paths in the DAO packet. When these packets arrive at the root, the full path between the root and the nodes is formed. This message can be verified in the destination by a DAO acknowledgment message (DAO-ACK). RPL has two functional models for keeping downward paths: Storing mode: In this case, the parents that receive the DAO packet can store the content of the DAO message before sending the packet to its parent, and each parent Smart Grid Neighborhood Area Networks Copyright © 2019 MECS I.J. Computer Network and Information Security, 2019, 7, 21-28 node has the address of its children. Non-storing mode: In this case, the DAO message is sent directly to the DODAG root, so the intermediate nodes do not store the DAO message but only store their addresses in return path stack of the DAO packet and direct it to their chosen parent. As a result, no parent has the address of its child nodes, and only the root that receives all DAO packets can store and maintain the downward paths. The RPL protocol for the propagation of messages uses the Trickle algorithm, which is a timebased algorithm [6].

II. RELATED WORK
Despite the popularity of RPL, RPL's capability to meet reliability requirements has not been sufficiently investigated, and there has been little research on the reliability of this protocol. In this section, we will consider some studies carried out on this subject.
In 2018, Maite Bezunartea et al. [7] said that, according to given the recent advances in the IOT world, short-range radio and medium or long-range technologies combine. In their article as a first step, they have made changes to the RPL protocol and the Medium Access Control (MAC) layer.
They allow the node to automatically select the most appropriate radio link, and if more than one link is available, network reliability increases. The results of the test show that more research is needed to evaluate the RPL's metrics for networks with dual-band nodes. In 2016, Barcelo et al. [8], based on the challenge of mobile wireless networks, introduced the new KP-RPL routing strategy for the WSN network in both fixed and mobile nodes modes based on the RPL protocol. The goal of the introduction of the KP-RPL is to provide robust and reliable routing in real WSNs. Simulation results show that reliability and network robustness in difficult conditions have increased compared to geographical routing. Also, KP-RPL reduces the density and number of active nodes simultaneously for positioning. As a result, the infrastructure cost is lower, and the network lifetime extend. In 2010, Wang and his colleagues [5] presented another protocol based on the RPL routing protocol that provides RPL routing protocol with the change in metrics. They have stated in this paper that many energy providers use the Automatic Meter Reading System (AMR) to collect data from power meters [9]. The use of AMR saves the costs of power generation companies compared to the physical periodic travel cost to read the meter. Wang and colleagues also point out that a vital component of the future smart electrical network is the advanced measurement infrastructure (AMI) that provides two-way communication. With AMI, companies can track the power consumption of consumers, and consumers are aware of the latest electricity prices and have remote management in real time [10]. Two-way communication requires a static and multi-hop mesh network that connects a large number of electrical meters to a gateway that is connected to a control center. Such an AMI-based network should provide routing functions, which guarantee high reliability and low latency for two types of traffic: Inward unicast traffic and outward unicast traffic. Tripathi and his colleague [11] have done a study to evaluate the quality of RPL routes with pointto-point traffic. Scalability and latency are sensitive metrics. This research presents several criteria for RPL routing functionality using a discrete event simulator in real-world Smart Grid topology. The routing metrics evaluated by this study are: path quality, control plane overhead, ability to deal with unstable conditions (such as breakage of links) and end-to-end latency between nodes. Herberg and colleagues [12] studied the performance of LOAD [13] and RPL routing protocols with bi-directional traffic in low-power networks, and they compared the two protocols. The purpose of their research is to examine the operation of routing protocols for two-way traffic and also to understand the behavior of the RPL protocol. Another goal of this study is to compare the performance of the LOAD protocol in the same conditions with the RPL protocol. Emilio et al. [14] have also considered the effectiveness of the RPL routing protocol, with a focus on routing stability and reliable performance. In particular, they understand the RPL's behavior and identify the main causes of uncertainty. The results of this study are as follows: The DODAG construction mechanism cannot guarantee that the shortest path for ETX is always selected. The results show that nodes that are away from the root of DODAG do not necessarily experience the path quality worse than those that are closer to the root. In this research, the reasons for the lack of reliability of RPL have been investigated, but they have not proposed a method to solve this and increase the reliability of this routing protocol. Thomas Clausen and colleagues have also done a critical study on RPL [15], in this research studies the defects of RPL.

III. PROPOSED METHOD
In this section, we propose three methods to improve the reliability of the RPL routing protocol in Smart Grid NAN. The first method is to use the cache on all nodes in the DODAG tree. When a packet is generated in a node, it is stored in the cache and then sent toward the root. On the path to the root, any node that receives the packet also stores it in its cache before forwarding the packet. If a packet does not arrive at the root for any reason, the root sends the request for this packet via the corresponding path (path of the packets previously reached to the root). The recipient's node searches its cache and resends it if it is found. Otherwise, it sends the request message to its child. This process may continue until the request message reaches the source node.
The second method is to use two parent nodes for each node in the DODAG tree so that each node in the tree has a second parent in addition to its default parent. When sending a packet, a node sends it to both parents simultaneously. In this way, if a link to a parent fails, the packet will be forwarded via the other link. The root has a cache that stores the received packet ID. If the received packet ID is equal to the ID of a previously received packet, the root discards the received packet.
The third proposed method is the combination of the two mentioned methods. So in the DODAG tree, each node has two parents and also implements a cache. In this method, after the packet is generated and stored in the cache, the packet is sent simultaneously to both parents. Each parent also saves the packet in its cache, and then sends it to its parents in the path to the root.

A. Simulation assumptions
A grid of 5×6 nodes, as depicted in figure 4, is considered for simulation. The nodes are placed in a 200m x 200m environment. Five nodes produce data packets and send them to the root using the RPL protocol. These five nodes generate packets based on the Poisson distribution. IEEE 802.15.4 is used as the Media Access Protocol. Node_0 is the DODAG root. The MAC layer is assumed to be fixed, and we only work on the network layer. It is also assumed that the selection of the parent collection is optimal, and the parents assigned to the nodes are optimal.
The simulation consists of four scenarios. The first scenario measures the reliability of the initial RPL. The second scenario adds a cache for each node. The third scenario considers two parents for each node and the fourth scenario considers two parents and also a cache for each node For all links between nodes in the network, different loss rates are considered. Reliability is calculated for the packet loss rate of 5, 10, 15, 20, and 25 percent. Since packet delivery time must be less than two seconds in NAN, packet delay is also calculated, and if it is more than 2 seconds, the packet will be discarded by the root. For calculating packet delivery time, when the root received the packet, the created time of this packet obtain by the functions in the OPNET simulator. This time value subtracts from the current simulation time (which can be accessed by OPNET functions) is the delay of sending that packet.

B. Simulation Results
In the first scenario, the original RPL is simulated, and the reliability is calculated for each mode of the loss rate for each packet individually. In the results shown in the following, srci represents the source ith of data packets, that i = 1, 2, ..., 5. SUM is the sum of the total number of packets generated by the source nodes, Root is the number of packets received by the Root, and Rel, is the reliability obtained by dividing the SUM into Root that is calculated as follows: (1) At first, the simulation was performed by packet loss = 5%. That is, the probability that the links will reach the correct destination by default is 95%, and 5% of the packets are likely to be lost, the results are as follows. In this table, the reliability is expressed numerically between 0 and 1. By multiplying that number in 100, the reliability value is expressed in the range 0 to 100; in this case, the reliability is 87.47%. Table 2 shows the simulation results when the packet loss is 10%. In this case, reliability is equal to 79.19%, which is lower than the previous one, due to increased packet loss rates.
Tables 3, 4 and 5 show simulation results when the packet loss is 15%, 20%, and 25% respectively.    In the second scenario, the method of using the cache at each node of the DODAG tree is simulated. Whenever a packet is created by a source node, a unique ID is assigned to it. Each packet has two fields in its header. An id field represents the ID assigned to the packet by the source node. The second field is the src field, which determines the node that has produced the packet. The id and src fields together create a unique identifier for the packet. The root node which stores the id and src fields of each received packet can determine if a packet has been lost by looking at the identifier of the currently received packet and the identifier of previously received packets. When the root detects a packet loss, it sends the request for the lost packet which, is propagated through the network as explained before. The simulation results are as follows: Table 6 shows the number of packets generated per source node and the total number of packets that reach root in the simulation period of 300 seconds when probable of packet loss is 5%. The results show that by adding cache when a packet loss is 5%, reliability has increased compared to the original RPL. Tables 7, 8, 9, and 10, respectively, show the results of the simulation of the proposed first method when the probability of packet loss is 10%, 15%, 20%, and 25% respectively.  Figure 6 illustrates the reliability achieved by the first method for different loss rates. By comparing Fig. 4 and Fig. 5, it can be seen that adding cache increases the reliability of the RPL routing protocol. The second method is that for all the nodes in the DODAG tree, in addition to sending the data packet to the default parent, it should simultaneously be sent to the candidate's parent of the highest priority. In this case, the packet is sent from two separate paths to the root, and if one of the paths fails, the packet will be routed from the other path. To prevent redundancy of the data in the root, every single packet is assigned a unique ID as soon as it is produced in the source nodes. Figure 7 shows part of the OPNET simulation results window for the second method.  The simulation results of the second method at 300 seconds, while the packet loss is 5%, is shown in Table  11. The results indicate that in the second method, with the choice of two parents for nodes, when the packet loss is 5% reliability increased compared to the original RPL and the first method. Tables 12, 13, 14, and 15, respectively, show the results of the simulation of the proposed second method when the probability of packet loss is 10%, 15%, 20%, and 25% respectively  Figure 8 illustrates the simulation results related to the second proposed method. In this scenario, each packet is sent via two separate paths to the root, and if one of the paths is destroyed, it can reach to the root from the other path. As can be seen from the figure, the reliability is improved in comparison with the original RPL. In the third method (the combined method), in the DODAG tree, in addition to all nodes have two parents, they have cache too. In the third method after the packet is generated by the source node, store in its cache and sends to both parent nodes simultaneously too. Middle nodes (parent nodes) after receiving the packet, store it in their cache and sends the packets to their parents too. This way, the packet moves toward the root of the tree. The root after receiving the packet, checkouts its cache, if the packet is in the cache, it will remove the packet otherwise the root compares its counter value with the packet's ID, if they were equal, receives the packet, and increase the counter value and requests the packet with the new ID. If the counter value is not equal to the packet's ID, then at first saves the packet in its cache and then sends the packet request with the ID number, equal to the counter value, to down the path. The simulation results of the combined method at 300 seconds, while the packet loss is 5%, is shown in Table 16. The results indicate that in the third method when packet loss probability is 5%, the reliability compared to the original RPL has increased significantly. Tables 17, 18, 19 and 20 respectively show the results of the simulation of the third method when the packet loss probability is 10%, 15%, 20%, and 25% respectively.  The simulation results of the third method, which adds cache at each node and also considers two parents for each node are depicted in figure 9. It is obvious from the figure that reliability has been increased in comparison to the original RPL. It is also seen that the third method achieves superior results in comparison to the first and second method, as expected.
In order to compare the three proposed methods and the original RPL, the simulation results of the three proposed methods, and the reliability of the original RPL is depicted in figure 10. It is observed that the reliability, when packet loss is 5% to 25%, is between 98.39% and 87.19%, and has a very good increasing.

V. CONCLUSION
In Smart Grid, transferring data in bidirectional communication between producers and consumers require high reliability. One of the factors that affect reliability is the routing protocol that is used in the communication network. The RPL routing protocol is one of the protocols that is designed for low power wireless networks and is suitable to be used in the Neighborhood Area Network of Smart Grid communication network. In this paper, in order to increase the reliability of the RPL routing protocol in Smart Grid NAN, we suggested three methods. In the first method, due to increasing of cache, reliability increases compared to the original RPL, but the latency of packets is greater than the second method. The second method is to use two parent nodes in the DODAG tree, and the third proposed method is the combination of the first two. The simulation results illustrated that all three methods increase reliability, and the combined method provides remarkable reliability enhancement.