Energy Efficient Multi-Path Routing Algorithm Using Gray System Theory for Improvement of Routing and Network Stability in Internet of Things

Internet of things (IoT) is a network of smart things. This indicates the ability of these physical things to transfer information with other physical things. The characteristics of these networks, such as topology dynamicity and energy constraint, challenges the routing problem in these networks. Previous routing methods could not achieve the required performance in this type of network. Therefore, developers of this network designed and developed specific methods in order to satisfy the requirements of these networks. One of the routing methods is utilization of multi-path protocols which send data to its destination using routes with separate links. One of such protocols is AOMDV routing protocol. In this paper, this method is improved using gray system theory which chooses the best paths used for separate routes to send packets. To do this, AOMDV packet format is altered and some fields are added to it so that energy criteria, link expiration time, and signal to noise ratio can also be considered while selecting the best route. The proposed method named RMPGST-IoT is introduced which chooses the routes with highest rank for concurrent transmission of data, using a specific routine based on the gray system theory. In order to evaluate and report the results, the proposed RMPGST-IoT method is compared to the ERGID and ADRM-IoT approaches with regard to throughput, packet receiving rate, packet loss rate, average remaining energy, and network lifetime. The results demonstrate the superior performance of the proposed RMPGST-IoT compared to the ERGID and ADRM-IoT approaches.


Introduction
the next revolution, where the interconnection among smart objects creates an intelligent environment. It is estimated and expected to reach 24 billion IoT devices by 2020. As more and more IoT devices are connected and communicated, IoT applications generate tremendous IoT traffic. Since IoT traffic is for the communication between objects, the transmission reliability is critical, especially in a relatively unstable WSN, compared with wired network. We employ 500 sensor nodes distributed uniformly over the area of 3000 * 3000m as seen in Fig. 1. A routing protocol decides how to send packets to other nodes. Routing protocols have two major divisions including Reactive and Proactive routing protocols. Routes are providing by the reactive protocols when it is needed. When it is necessary, control messages are transmitted by the path of data transfer, using these types of protocols. But, the needed time to find the route is increases. In addition, control messages are periodically exchanged by the proactive routing protocols immediately after start in order to search and propagate the routes. Local control messages together with messages across the entire network are sent by nodes to receive local nearby information and to share the structural information in all nodes of the network.
In this research, we propose Multi-path routing protocol (RMPGST-IoT). The developed RMPGST-IoT protocol includes three key sections: a novel approach of distributed cluster discovery which can automatically establish local nodes, an innovative set of algorithms to adjust clusters and their head alternations based on the centralized position and isotropic energy propagation in all the sensing nodes, and a brilliant mechanism to reduce energy loss in long distance telecommunication. Fig. 1 The devices deployed in IoT [3].
The paper presented here is organized as the following. Section 2 introduces some background terms regarding multi-path routing. In Sect. 3 brings the proposed RMPGST-IoT schema. Moreover, parameters utilised for performance evaluation are investigated and simulation results are discussed in Section 4. Finally, in Section 5, the paper is concluded.

Background terms
This section provides an introduction to the central concepts of this paper: multi-path routing, and detection schemes to provide protection for the IoT.

Multi-path routing
A new IoT technique called multi-path routing is capable of solving instability difficulties, narrow bandwidth, and energy protection. By use of this technique, the effect of network connection failures is decreased. It has a significant effect on performance improvement of IoT network. However, multipath calculations are more complicated job than single path calculations. It is difficult because of finding optimal multiple paths. By this method, it is possible to compute multiple paths in an independent and distributed manner. It is established based on multi-path disjunction principle that between the same source-destination pair, the disjunction may be partial or not. The aim of disjunction principle is to guarantee the paths independency; it means connection failure one of the criterion, takes into consideration the resource consumption of each node. Trust criterion increases the network lifetime. Topology criterion is aware of the node positions and enhances loading. Chanel health criterion, due to inappropriate channel conditions, protects the network against harmful attacks. Reputation criterion evaluates each of the participants of specific network operations for identification of specialized attacks. On the other hand, trust criterion, general adaptation, evaluates the fulfilment against hybrid attacks. SCOTRES has two types: one is embedded systems, and the other is real systems. The evaluations represented in this paper demonstrated that this system has the highest protection rate, while maintaining the performance for setting up real applications [6].
ERGID Method: A routing protocol called Emergency Response IoT based on Global Information Decision (ERGID) was suggested in the study of Qui et al. in 2016 to increase the reliability of data transmission performance and efficiency of the emergence response to IoT. Especially, in this study a mechanism called delay iterative method (DIM) which is founded on delay approximation was designed to answer the problem of disregarding valid routes. Additionally, a transfer plan called "Remaining Energy Probability Choice" (REPC) was recommended for balancing the network load together with focusing on the remained energy of the node. Consequences and examination of the simulation indicates that ERGID have better performance with respect to EA-SPEED and SPEED approaches regarding end to end delay, packet dissipation rate, and energy loss. Also, in this study some applied examinations were performed using STM32W108 sensing nodes. It was detected that ERGID can increase the network ability for real-time response [7].
AOMDV-IOT Technique: In this study, the suggested technique called AOMDV-IOT is introduced. It is a routing technique and up to the destination, it can perform as the router. The recommended method is not offered just for the node. The enhancements are mostly appropriate in IoT which is a unique technique for it. The principle object in this technique is detecting and generating effective connections between the nodes and the internet using the AOMDV routing protocol in the IoT. The internet connection table (ICT) is added in the suggested routing protocol to every node. Every node has two tables in this method including: routing table and ICT. ICT consists of four units: terminal node number, terminal node IP address, lifecycle, and hop value. Even though ICT uses extra memory, instead it can store connection counts and consequently decreases transmission delay. Comparison of AOMDV, simulating outcomes show that AOMDV-IOT has improved efficiency with respect to end to end delay, packet loss, and frequency in IoT. In this research, the multi-objective ad-hoc generated distance vector for the internet of things has been enhanced in such an approach that it can dynamically choose the direct internet transmission route by regular update of internet link table. Simulating effects show that while the AOMDV-IOT routing protocol rises the two routing packets, average end to end delay of the route falls [8].
EECRP Method: In the next paper, Shen et al. in 2017 proposed a new and centralized energy-based routing protocol (EECRP) for the internet of things with the help of wireless sensor networks to improve the network performance. They presumed that wireless sensor nodes are randomly distributed in the network. It has also been assumed that each node knows the BS location and the remaining energy value all the time. The proposed EECRP protocol consists of three key sections: a new distributed cluster detection method which is able to automatically organize local nodes, a new set of algorithms to adapt clusters and cluster head rotations based on the centralized location and uniform energy distribution among all of the sensor nodes, and a new mechanism for reducing long distance communication energy consumption. Node energy calculation has been considered in EECRP in order to calculate the centralized location. Simulation results show that EECRP performs better that LEACH, LEACH-C, and GEEC. When the BS is in the network, EECRP can send a significant amount of data with very low energy loss. Therefore, network lifetime is longer for EECRP than it is for LEACH [9].
AOMDV method: A self-correcting path detection and information transferring route is suggested by AlZubi et al. for enabled applications in the Internet of Things (IoT). This routing procedure achieves at device level for self-restore and establishing its communication routes in a large-scale network. The routing practice is naturally opportunistic, need local device information instead of universal update. This opportunistic routing (OR) is built on best-fit traversing (BFT) algorithm to enhance the device availability in a precise way. The best-fit algorithm determines perfect neighbours for restarting interrupted communications in elongated mode [10].
Adaptive Distributed Routing Method: FANET networks are a key part of the IoT and can offer messaging facilities for various devices in the IoT and cyber-permitted applications. But, moving unmanned aerial vehicles (UAV) in FANETs creates random network link and increases complexity of routing algorithms for these applications, particularly in real-time routing. In this research, an effective opportunistic distributed routing technique is suggested to explain the above mentioned problem. For data transfer in this process, only the colleague nodes and local information are used by the transmitter. They maximize network use and preserve the end to end delay less than a stated threshold in order to care for variations of network and channel by designing and solving an optimization problem. Besides, they guess one stage delay for every communication of the transmitter node and use double parsing to alter the integrated problem into a distributed one. By this method, the transmitter nodes are only permitted to contact with local information and approximate delay in packet routs. Simulation outcomes indicate that the introduced routing technique enhances the network performance regarding its energy efficiency, quantity, and end to end delay [11].
REL Method: In the next work, Machado et al. proposed an energy and link quality-based routing protocol (REL) for IoT applications. In order to improve reliability and energy efficiency, REF selects an estimator mechanism based on the end to end link and the remaining energy. Furthermore, REL proposes an event-based mechanism to maintain load balance and prevent premature energy loss in nodes and the network. REF provides an end to end route selection plan based on cross-layer information with minimum overhead. In order to achieve energy efficiency, the nodes send their remaining energy to the neighbouring nodes. In this paper, route selection process is carried out using end to end link quality evaluation and optimal energy information. A new method is used for link quality estimation. REL utilizes the wireless link quality and the remaining energy while routing in order to increase system reliability and support QoS for IoT applications. REL uses a reactive pattern for discovering routes. This results in reduced signalling overhead and improved scaling capability. Route discovery process consists of diffusing RREQ and RREP messages. In large scale networks with high node density, results suggest that in REL, lifetime was improved up to %26.6, latency up to %17.9, and packet delivery up to %12 when compared to AODV and LABILE [12].
NLEE Algorithm: In the paper presented by Vellanki et al. in 2016, the effective energy protocol for improving energy efficiency in internet of things was introduced. The proposed algorithm, makes decisions that minimize upload using shortest paths. This method uses the expected remaining node energy countdown and total number of node transfers as the routing criteria to improve energy efficiency. This method controls the number of transferred and broadcasted packets to discover routes. Furthermore, route discovery is carried out using remaining energies and step counts of the nodes in the routes. Moreover, NLEE algorithm guarantees better utilization of the energy available in the nodes. It also regularizes routing delay while discovering the shortest path in the network [13][14][15][16][17][18]. Table 1, summarizes the investigated efforts to design multi-path routing for IoT.  [3] Layer design and balancing load in order to create load balance and eliminate bottlenecks Load balancing, decreased packet loss, and increased connections Paying no attention to the remaining energy and lifetime of the node [5] Routing in the internet of things based on the AOMDV protocol Detecting malicious nodes and packet transfer based on the energy and improved network efficiency Not taking into account other criteria such as distance etc. along the way of the packet SCOTRES [6] Secure routing with emphasis on energy consumption of the devices and decreasing it Increased network lifetime while using trust criterion in order to prevent hybrid attacks -ERGID [7] Routing based on decisions made with general information Improved data transfer performance and emergency response The need to estimate delay in order to improve delay and network lifetime AOMDV-IOT [8] Discovering and establishing efficient link between nodes and the internet based on the AOMDV protocol Decreased latency and decreased packet loss rate More overhead because of storing two tables in each node and two extra routing packets EECRP [9] Clustering algorithm while taking into account the energy criterion while routing and selecting the cluster heads Distributed clustering and uniform load distribution among all of the sensor nodes Not taking into account criteria other than energy while routing ADRM-IoT [11] Reducing the complexity of routing algorithms using distributed adaptive routing Improved energy efficiency, throughput, and end to end latency The need to carry out exact calculations to calculate delay REL [12] Routing protocol based on link quality and energy Improved reliability and energy efficiency -NLEE [13] Efficient energy protocol for improving energy efficiency in the internet of things Improved latencydecreased power consumption Overhead caused by counting the number of sent and control packets, hop count and remaining energy

The proposed RMPGST-IoT schema
In the following section, we design a RMPGST-IoT schema by employing the Gray System Theory algorithm. The proposed system consists of six steps, such as the assumptions applied in the proposed approach is discussed in Sect, 3.1. Adding new parameters to AOMDV is discussed in Sect, 3.2.
Designing the routing packets in RMPGST-IoT is discussed in Sect. 3.3, Gray System Theory Steps is discussed in Sect. 3.4, Using gray theory in routing is discussed in Sect. 3.5, and the algorithm for the proposed RMPGST-IoT method is discussed in Sect. 3.6.

The assumptions applied in the proposed RMPGST-IoT
The assumptions Considered in the proposed approach include: • Things existing in the network are not static; they should work independently.
• Each thing has limited energy and the initial energy of each thing is where > 0. • Things gather data with a constant rate from the environment.
• Energy reduction and software issues can make a thing faulty.
• In the proposed approach, energy is consumed to transmit local data among the nodes.
• To gain spatial data, each node is equipped with a GPS system.

Adding new parameters to AOMDV
Because most of the devices are wireless, link stability fluctuation caused by movement or transfer medium characteristics in the internet of things affects the network performance. Efficiency of a dynamic routing protocol can be rated based on its ability to handle link unreliability and its computational and reconfiguration/rerouting overhead. Link stability as the basis of routing can lead to a protocol that has the following capabilities: Movement Flexibility: Selected links are durable for longer periods of time against lost connections in moving nodes. Efficient Energy: Fewer disconnected links because of reduced rerouting, resulting in low connection and computational overhead. Stability: In order to reduce the overhead of the routing tables, more effective routes are stored longer. We evaluate the link stability in our work with the energy, step count, signal to noise ratio, and route expiration time parameters corresponding to each route. Signal to noise ratio is presented as SINR . The higher the SINR value is, the higher are the chances of continuous connection and link for longer periods of time. The higher the remaining energy in a node, the higher are its chances of staying alive for longer periods of time and therefore the larger its transmission range. The higher the link expiration time ( LET ) and the lower the number of hops, the higher are the chances of the packets being delivered quickly and soundly. Healthy node: the routes selected to transmit data must not be faulty.
In our proposed method, we estimate the link stability with the following factors: energy, hop count, Signal-to-Interference-Plus-Noise Ratio (SINR), and expiration time of each route. We also evaluate the healthy nodes with the following parameters: the message exchange rate in the transmitter circuit of the node and the fault of the node's sensor circuit. However, it should be noted that a thing with very little energy or low signal-to-noise strength is faulty as well. The higher the SINR, the higher the probability of having more durable connections and links, and the lower the noise of sent data. In fact, the device transmitting data with high noise is not healthy and such data isn't feed practically. On the other hand, the more the remaining energy of the thing, the higher the probability of its longer lifetime and the higher its transfer area. The next parameter is Link Expiration Time (LET) so that the longer LET leads to more durable link and the connection isn't failed during data transferring. Also, the less the hop count parameter, the quicker the data transfer and the higher the probability of having a healthy package in the destination. In addition, when the message exchange rate in the transmitter circuit of the thing is high, it shows that this node is healthy and can communicate with objects around it and don't eliminates data. The last parameter is the sensor circuit status that is calculated based on the measurement difference between a node and its neighbor nodethe less the parameter, the better and healthier the node.
Signal to Noise Ratio: Noise ratio is defined as the ratio of the received signal ( S ) to a combination of noise strength ( N ) and interference ( I ). Definition of SINR is presented in Equation (1): SINR is estimated using the average reception during inactivity period. SINR is used to determine the quality of network links or connections.

Remaining Energy (Re):
One of the most important elements while choosing a route is the remaining energy in the nodes along that route. The higher the remaining energy in the nodes of a route and the lower their consumed energy, the more appropriate that route is to be selected. Remaining energy is calculated using Equation (2).

Hop Count (Hop):
The Hop count parameter is the number of Hops between the origin node and the destination node. The lower the Hop count of a route, the better that route is because less energy needs to be used in order to transmit the packet.

Link Expiration Time (LET):
It is the amount of time for which the links stays stable. The longer this time period is, the more stable the link between the nodes will be. This parameter depends on the movement speed of the nodes. The faster the nodes move, the more unstable the route between them will be and the sooner it will be destroyed. Link expiration time is calculated using Equation (3) based on the transmitted packets between the nodes.
In Eq. (3): The nodes are aware of their location using GPS. In the above equation there are two nodes i and j which are at ( ,

Message Exchange Rate (MER):
in the transmitter circuit of the thing: the MER of a thing shows that whether the thing is healthy or not. Also, the higher MER shows that the thing exchange message with its neighbors properly. The efficiency of the transmitter circuit of the thing is calculated as follows.
Where is the number of received confirmation messages and indicates the time consumed in the network. The origin decides about the MER of a thing dependent on the volume of the test messages sent by the origin in that period. If the MER is low, the node is faulty otherwise, it is healthy.

Sensor Circuit Status (SCS)
: the SCS of a thing is detected by the thing itself. The thing calculates the measurement difference between the ( = 1 … ) neighbor nodes. If measurement difference is less than the threshold (Δ < ) then, Δ = 0. The value of is dependent on the node density and can be different according to the application. In some cases, a high threshold may be needed to analyze the fault of the sensor circuit. The average difference of information is calculated as follows. (5) If the value of the measurement difference is high, the node is faulty. When the measurement difference between a node and its neighbors is lower in a route, this route is better. The related steps are expressed in the following.

Designing the routing packets in RMPGST-IoT
In the proposed method, all of the devices need to be equipped with GPS and have maximum initial energy. AOMDV routing packet format is expanded so that it can be used for RMPGST-IoT routing. This is achieved by adding new fields to AOMDV routing packets. RMPGST-IoT routing protocol, just like the base AOMDV protocol, has four packet formats. However, in the proposed RMPGST-IoT method, these formats are altered and required fields are added to these packets. Details of these packets are presented below. HELLO Packet: This packet is used to discover neighboring devices in regular intervals. Adjacent nodes exchange their location obtained through GPS and remaining energy information using HELLO packets. After exchanging the HELLO packet, each node updates its routing table and the remaining energy of neighboring nodes and also calculates SINR rate based on the received signal from the neighbor and link expiration time ( LET ) with the neighboring node based on its own location and the neighbor's location and also writes them into its table. New format of the HELLO packet is shown in Figure 2.

RREQ Packet:
The second packet is the route request ( RREQ ) packet. Each time a node tries to communicate with other nodes in the network, route discovery process needs to be carried out. Therefore, the node broadcasts the RREQ packet publicly to find an appropriate route to its destination RREQ packets consist of an ID to identify each packet, the destination IP address, sequence number, and network time stamp. Destination sequence number indicates the freshness of a route. We add the remaining node energy, SINR value, and the calculated LET with the last hop based on the HELLO message fields to the RREQ packet. Each node has calculated these parameters based on the Eq. (1) through Eq. (3) upon receiving the HELLO message and saved them in its table. Now, once the RREQ message is received, each node on this route adds these information and transfers to the next node along the route to the destination. New format of the RREQ packet is shown in Figure 3.  consists of an ID to identify unique packets, origin IP address, sequence number, and accumulated routes. In the proposed method, we get the destination of every RREQ packet from different routes and calculate the total number of hops, total remaining energy in each route, and total SINR and LET in the links of each route and add them to the RREP packet. Then, this packet is sent to the origin of that route. Therefore, we add the new total remaining energy of the route nodes, hop count, and total SINR and LET fields to the RREP packet. New format of the RREP packet is shown in Figure 4. RERR Packet: Whenever a node discovers an error, it broadcasts a route error ( RERR ) packet with the destination sequence number and infinite hop count. The origin node or any other node along the route can rebuild the route by sending a RREQ packet. If the origin node or any other node receives the RRER packet, it needs to re-execute the route discovery process. Test Packet: after detecting nodes, the origin sends a test message through all routes in the format shown in figure 5 to take the responses of all the nodes in the routes. In this way, we can calculate two mentioned parameters namely MER and SCS. New format of the Test packet is shown in Figure  5.

Gray System Theory Steps
When units are evaluated using different parameters, some important parameters might be neglected. This happens specially when performance parameters have several values. Also, if the objectives and instructions of these parameters are different, results of analyzing them will be misleading. Therefore, performance evaluation parameters must be converted to a comparable sequence and therefore normalization is required. This is the gray relation creating step. In order to evaluate several devices, if m is the number of devices and n is the number of parameters, then the device number i will be described as ( ) 12 , ,..., ,..., i Y can be converted to a comparable sequence ( ) 12 , ,..., ,..., using Equation (6 ) and Equation (7). In other words, these parameters can be normalized using the presented equations. In Equation (6) and Equation (7), i and j are defined as follows:  (6) is used for positive parameters. In this equation, the bigger ij X is, the better the obtained results will be. In the proposed scheme, this equation is used for the remaining energy, link expiration time, and noise rate parameters. Equation (7) is used for negative parameters. In this equation, the smaller ij X is, the better the results will be. This equation is used for the HOP count parameter. After creating the gray relations using the above equations, all of the performance values, just like normalized values, will be between zero and one. The closer ij X is to one, the parameter will be more desirable. Therefore, the comparative series consisting of all ones will be the best choice. The target series is a series where all of the performance values are equal to one. Equation (9) illustrates the target series ( 0 X ) where all of its parameters are equal to one.
After this step, the main goal is finding a unit which is as close to this target series as possible. In order to find such a unit, gray coefficients must be calculated first. Steps to calculating this parameter are presented in the following section.

Gray Relation Coefficient
In the next step, gray relation value needs to be measured. This value is the gray relation rank. Calculating the gray relation rank requires the gray relation coefficient to be calculated first. Gray relation coefficient is used to determine the proximity of ji X with 0 j X . Equation (10) In these equations, ij  is used to measure the difference between ij x and oj x , while min  is the minimum value among all of the parameters and max  is the maximum value among all of the parameters. in Equation (10) is the detection coefficient which is a number in the  0, 1 interval. In most of the studies, is set to 0.5. After calculating the gray relation coefficient, gray relation rank is calculated for the aforementioned items. In the following section, how to calculate this rank is presented.

Calculating the Gray Rank
Gray coefficient of two parameters is between zero and one in such a way that if this coefficient is one, it means that those two parameters are equivalent. On the other hand, if the coefficient is zero, those two parameters are independent. After calculating the gray coefficient, gray rank can be calculated using Equation (12) and use the resulting value in making various decisions. In this equation, ( ) 0 , i T X X represents the gray relation between 0 X and i X which demonstrates the correlation between the reference sequence and the compared sequence. j W is the weight or importance coefficient which is a parameter determined according to the problem structure. In our method, due to its higher importance, we have set the weight for the energy parameter higher than other parameters in the simulations. Equation (13) (13) In other words, according to the above equation, summation of all the weight values will be equal to one. Gray rank presents the similarity between the compared sequence and the reference sequence. The reference sequence for each evaluated unit represents the best possible performance which can be achieved using the compared sequence. This way, after the rank of every route has been determined according to their remaining energy, hop count, noise rate, and link expiration time parameters, the best route to the destination which has the best devices will be selected. This sequence is repeated until the decision-making process is completed. Because the final values are unities numbers between zero and one, overall rank of the route can be calculated according to the average gray rank of the mentioned parameters.

Using Gray Theory in Routing
As mentioned in the previous sections, in this this research the quality of service, remaining energy level, noise rate ( SINR ), link expiration time, and hop count parameters are used to select the best route for efficient diffusion of information in the internet of things. Studies show that information diffusion using an efficient algorithm can significantly improve the performance of the internet of things. In this paper, several routes get selected for multi-path diffusion of information by checking the quality of service parameters of the devices (nodes). In other words, quality of service parameters of each node is used to select the best route for information diffusion. In related works, one or two quality of service parameters were used for information diffusion in the internet of things. The advantage of the proposed approach is the combination of different Quality of Service (QoS) parameters to select appropriate and faulty-node-free routes to disseminate data. Using several parameters to solve in deterministic optimization problems can lead to optimal or near-optimal solutions. However, it should be noted that using too many parameters can significantly increase the computational complexity and therefore decrease the network performance. The proposed RMPGST-IoT routing method for the internet of things consists of four steps. Neighbor discovery step, route discovery step, data transfer step, and detecting the health information of nodes. We will describe each step in the following sections.

Neighbor Discovery Step
In the neighbor discovery step, nodes (devices) flood the network with HELLO packets to find their neighbors. The HELLO packet includes the origin IP address, remaining energy of the node, node location, node speed, sequence number, and time stamp. After the neighbor discovery step, every device knows all of its neighbors in the network and is aware of their location and remaining energy. The nodes also calculate the SINR value for their immediate neighbors using the received signal and the noise rate and interference values. Also, using the location and speed of the neighboring node in the last step and their own location and speed, each node calculates the link expiration time ( LET ) of its link with the neighboring node. Each node stores this information for its immediate neighbors.

Route Discovery
Step When the origin node decides to send a packet to the destination, it floods the network with RREQ packets to discover the suitable routes. RREQ packet includes the IP address of the origin and destination, sequence number, hop count, remaining energy in the node, LET , SINR , accumulated route, and time stamp. IP address of the origin and the destination are used to identify unique nodes in the network. The destination sequence number is used to show the suitable routes to the destination. Each node after receiving the RREQ packet, retrieves its neighbor information and inserts it into its routing table. Then inserts the new information along with its own information into the RREQ packet and sends it to the next node. Figure 6 demonstrates the flooding of RREQ packets in the network in order to find routes leading to the destination. The destination node received multiple RREQ packets using different routes. Also, the RREP packet includes the node ID to identify unique packets, destination IP address, sequence number, lifespan in the network, and accumulated routes. The accumulated routes are a list of separate routes from origin to destination. Moreover, three new fields, namely the total LET of each route, total SINR , and remaining energy of each route calculated by the destination node using the RREQ packets are added to the RREP packet. After adding these fields, the destination node sends the RREP packet using all of the routes and stores this information in its routing table. The origin node, upon receiving the RREP packets from destination, stores the origin of these multiple routes in its routing table.

3.5.3
The step of discovering healthy information nodes In this step, after detecting the different routes to the destination and gaining the information of hop count, remaining energy, link expiration time, and SINR, we attempt to use the healthy nodes that are better than other nodes to avoid probable issues during data transmission. The most effective and important parameters to detect healthy or faulty nods are energy, SINR, MSR, and SCS. The energy parameter of the node is important because when a node is out of energy, it is useless and cannot send data. the next three parameters indicate the hardware faults of a node. When these parameters don't have appropriate values, the thing is faulty and sends data with noise or even it isn't able to send data at all. To discover this, the first two criteria are detected in the previous step but to determine MER and SCS, the origin sends a test package in every route to the destination multiple times. The IP of the origin node is written in this package and every node receiving this package must send it to its neighbors (whose information is in their table) and send a confirmation package to the origin in response to each package-the measurement difference between the node and its neighbors should be calculated in the confirmation package based on equation 5. in fact, each node compares its measurement data with the measurement data of neighboring nodes and sends its measurement difference in the confirmation message to the origin. If the data measurement difference is less than the threshold, the origin detects that as a healthy node, otherwise, it considers that a faulty node.
According to the Test messages sent by the origin node in that period, the origin node determines the MER of the node based on the equation 4. if the MER is low, the node is faulty, otherwise, it is healthy.

Data Transmission
Step After discovering several routes, the origin node calculates the total value of each parameter for all of the routes and saves them in a table. Table 2 is used to demonstrate the quality of service parameters for the nodes.  Now with the total value of the quality of service parameters for each of the routes to the destination known, gray relation theory is used to solve the problem. Since the abovementioned parameters have different units and therefore cannot be compared directly, a normalization method needs to be used to normalize the values and make them comparable. The normalization methods used in the gray theory are presented in Equation (4) and Equation (5). These equations have several applications. Equation (4) is used to normalize positive parameters while Equation (5) is used for normalization of negative parameters. In this research, three of the parameters are positive parameters which include the remaining energy, noise rate, and link expiration time. However, the hop count parameter is a negative one. In other words, the lower this parameter is, the better and therefore more desirable the final result will be. Therefore, Equation (4) is used to normalize the three positive parameters while Equation (5) is used to normalize the negative parameter. The values yielded after normalization using Equation (4) and Equation (5) for all of the parameters of the routes will be a scalar between zero and one. Value equal to one is the optimal condition and zero is the worst case. Therefore, one is considered as the reference series. As mentioned before, the reference series is presented as where all of the normalized parameters are equal to one. After the most similar series to the reference series is determined for all of the nodes, the main goal is finding a route which is as close to the reference series as possible. Gray coefficient is used to find such a route. How to calculate the gray coefficient is presented in Equation (8). After determining the gray coefficient for all of the routes and their parameters, gray rank is used for ranking all of the routes based on the aforementioned quality of service parameters. How to calculate the gray rank using the parameters for the routes is presented in Equation (10) and Equation (11). The values resulted from this equation is a 1×n column matrix where n is the total number of available routes to the destination. This matrix consists of a decreasingly suitable sequence routes (based on the quality of service parameters) for information diffusion. The routes for multi-path routing of data are selected from the indices of the matrix with the highest gray rank values. These routes are saved in the table. This is repeated until the destination is changed or the route is eliminated.
Selecting the routes with better quality of service parameters, i.e. with high link expiration time, high signal to noise ratio, and high energy levels and low hop count to the destination, while reducing the network latency, improves its performance. After each cycle of data diffusion in the network, values for each of the mentioned parameters are updated for every node and the above steps are repeated for the next information diffusion round.
Selecting the routs with proper QoS parameters i.e. high LET, SINR, energy, MSR, and SCS and less hop count to the destination improves the efficiency of the network and reduces its delay. However, in the proposed approach, we detect the faulty nodes in the routes and remove them from the network in addition to selecting the most appropriate routes for sending data. This is done in a separate phase by the origin and using fuzzy logic and previous information acquisition. Although the six considered parameters in the route selection step lead to selecting the best routes with the highest ranks by the origin, if there is a node with a faulty node among the selected routes, it will be removed from the route table.

Discovery of a faulty node employing fuzzy logic
In the proposed approach, we consider the four following parameters to detect the faulty nodes-SCS fault, MER fault, Battery level/remaining energy fault, and SINR value. These parameters are among the important criteria to detect the healthy and faulty nodes in the Internet of Things (IoT) network. The values of all the four parameters were calculated by the origin in the previous steps based on the control messages and Test message. In the following, we show how to use these parameters. SCS fault: we declared that each node compares its measurement data with the measurement data of its neighboring nodes using a test package. If the measurement difference of data doesn't exceed the threshold, that node is considered a healthy node, otherwise, it is detected as a faulty node. In this way, if the value of the measurement difference linguistic variable is low, the sensor circuit of the node isn't faulty. However, if the value is an average value, it is possible that a sensor circuit fault occurs after a time period.

MER fault:
The origin decides about the MER fault of a node based on the rate of the Test messages sent by the origin in that period. If the MER is low, the transmitter circuit of a node is faulty, otherwise, it is healthy. Battery level/remaining energy fault: if the value of the remaining energy linguistic variable is low, the battery fault occurs. if the battery level is intermediate, it will finish after a while and a battery fault can occur. Finally, if the battery level is high, the status of the battery is good. SINR fault: SINR value is represented by fuzzy logic variables. If the value of the linguistic variable id low, a noise fault occurs. if the value if intermediate, it shows that a noise fault will soon occur. Finally, if the SINR value is high, the status of the node is good and this node sends data properly.
The hardware requirements of the things are evaluated by the fuzzy logic rules explained in the following. Figure 7 shows the fuzzy logic system with four input variables namely MER, SCS, Battery level fault, and noise fault.  After determining the fuzzy logic input parameters, we performed the fuzzy inference phase and developed a rule set using expert knowledge. The fuzzy-rules-based knowledge is designed to integrate the input and output variables; this is done based on the criteria expressed by the origin. Since we have four criteria that each has three levels (low, intermediate, and high), we will have 64 (4 3 ) fuzzy rules in the knowledge base to design the fuzzy inference by the decision-making system. The fuzzy rules have been written based on the If-Then law. Every fuzzy rule includes an "If" term and a "Then" term. The "If" condition is made using predictions and a logical relationship is used to connect an input to the result. The "Then" term determines the degree of membership function and productivity. Some of these rules are presented in Table 3.  According to figure 9, the linguistic variables are organized in four ranges namely dead node, faulty node, normal node, and good node to determine whether a node is faulty or normal. A dead node is a node with an empty battery or a node which hasn't responded to messages at all. A faulty node is a node which has low energy, responded to very few messages, have a significantly high measurement difference or a very weak signal. A normal node has an intermediate value of each criterion. Finally, a good node is a healthy node which has the maximum energy and responded to all messages with low noise, and low measurement difference. In the last phase, the results obtained in the two previous phases by the fuzzy system should be defuzzified in the defuzzification phase to make them understandable for the computer. In our proposed approach, we use the Centroid of Area (CoA) defuzzification method to defuzzify by equation (14) because the CoA defuzzification method has been widely used to defuzzify the Mamdani method.
() (14) In equation 14, is the non-fuzzy output of the fuzzy system ( ) and ( ) is the membership function of the aggregated output. Based on the output value of , the origin node determines whether the faulty node is dead or can be participated in the routing in the network. After detecting the dead and faulty nodes in the network, the origin records the ID of these nodes and checks the routes selected in the previous step; in the case that a route contains such node, it will remove that node from the table. Then, it will disseminate the ID of the dead node to be eliminated from routing. After each round of data dissemination in the network, the values of the expressed parameters are updated for every node and the above-mentioned steps are repeated for the next round of the data dissemination. The data transfer process, route determination process, and faulty and dead node detection process in the proposed approach RMPGST-IoT are shown in the figures 10 and 11.

The Algorithm for the Proposed RMPGST-IoT Method
The overall steps of the algorithm for the proposed method based on the gray system theory for multipath diffusion of information in the internet of things networks is as presented in figure 10. The proposed algorithm is repeated for each round of information diffusion after updating the quality of service parameters. In the proposed RMPGST-IoT method, the traffic is distributed uniformly among the selected routes. This method guarantees that the energy of the nodes along the routes are used uniformly because the sender node will always select the routes with highest gray rank to ensure route reliability with regard to energy, link expiration time, MER, SCS, and also noise rate. In other words, the probability of the links being broken is reduced and therefore it is used more often than other routes. The proposed method also prevents the nodes from dying prematurely and the network being destroyed. The flowchart for the proposed RMPGST-IoT method is presented in figure 11. All of the steps to the proposed algorithm, from start to finish, can be found in this flowchart. The proposed approach avoids network collapse by detecting faulty and dead nodes and preventing using the routes having these Algorithm (4): Pseudo code for RMPGST-IoT proposed schema 1: Routing initialization by the sender node. 2: The sender node checks its routing table to see whether a route to the destination exists? 3: If there is no route to the destination, sending the RREQ and RREP packets for discovering routes between the sender and the destination is carried out. Then go to step 6.

4:
If there are route from the sender to destination, go to step 6. 5: Sending multiple TEST messages in the detected routes to the destination to gain the MER and SCS information of the node through calculating measurement difference. 6: Calculate sum of the parameters for each of the available routes to destination. 7: Normalize the quality of service parameters using the gray theory normalization method. 8: Determine parameter series for each route. 9: Calculate the gray coefficient for each of the series created in step 8. 10: Calculate the gray rank for all of the routes. 11: Select the routes with highest gray rank for simultaneous diffusion of information packets. 12: Send the packets using the chosen routes. 13: Checking the faulty and dead nodes in the network by fuzzy logic 14: Checking whether there is a faulty or dead node in the selected routes or not? 15: There isn't any faulty or dead node in the selected routes. So, data are sent using the selected routes. 16: There is faulty or dead node in the selected routes. So, the route with faulty or dead node is removed from table and data are sent through other selected routes. 17: Declaring he ID of the dead node in the network. 18: Check the acknowledgements to see if the packets were received in the specified time period.

19:
Acknowledgement packet was received, go to step 16.

20:
Acknowledgement packet was not received, return to step 3. 21: Repeat the above steps after updating the quality of service parameters. 22:End nodes. The flowchart of the proposed approach RMPGST-IoT is shown in figure 11 in which all steps of the proposed algorithm are represented-from starting point to end point.

Evaluating the Performance
In the following section, the performance of our proposed RMPGST-IoT approach is evaluated to multi-path routing problem.

Performance metrics
In this section, the effectiveness and performance of our proposed RMPGST-IoT approach is thoroughly evaluated with comprehensive simulations. The results are compared with ERGID and ADRM-IoT approaches proposed in [7] and [11], respectively. The throughput, packet receiving rate, packet loss rate, average remaining energy, and network lifetime are evaluated. Notations utilised here are listed in Table 4.

Average Throughput
Average throughput is the division of the sum of packets sizes received at the destination sensor node, to the difference of simulation stop and start time [19]. Eq. (15)

Packet
Loss rate PLR occurs when one or more packets of data traveling across a computer network fail to reach their destination. PLR is typically caused by network congestion. Packet loss is measured as a percentage of packets lost with respect to packets sent. The lower value of the packet loss means the better performance of the protocol. The PLR is calculated in Equation (17)

Average Remaining Energy
As demonstrated in Eq. (15), unconsumed energy in the node in an arbitrary time instance is the excessive energy maintained in the node following a concluded communication with the receiver. Examples of remaining energies are the energy for transmission, energy for reception, wasted energy in the system ( sys E ), fading effects, etc. The parameters exploited for the ARE are listed in Table 4.  (20) Simulated parameter is set as: di di  , multipath fading effect occurs, and energy is wasted during transmission. However, since the fading scheme is out of the scope of this paper, the distance is considered to be lesser than the Fraunhofers distance. Moreover, the information for channel state is not considered, while transmission efficiency is considered to be 1.

Network Lifetime
According to the definition, the network lifetime is the elapsed time between of communication and sensing commencement with the receiver, and the time in which the final communication link from active node to the receiver is broken. Network lifetime for all active nodes currently in communication with the receiver is the life time aggregate for all the mentioned nodes at any time instance. If the network is clustered, the network lifetime is the total lifetime for all things [25][26][27][28][29][30][31][32]

Simulation setup and comparing algorithms
The difficulties in implementation and debugging IoTs in real networks, raises the necessity to consider simulations as a fundamental design tool. The main advantage of simulation is simplifying analysis and protocol verification, mainly in large-scale systems. In this section, the performance of our proposed approach is evaluated using NS-3 as the simulation tool, and the results are discussed further. It is worth mentioning that all RMPGST-IoT, ERGID and ADRM-IoT parameters and settings are considered to be equal.

Simulation results and Analysis
In this section, we analyze the performance of RMPGST-IoT under the two scenarios (described in Table 5). There are 500 IoT things uniformly deployed in the network area initially. Some important parameters are listed in Table 5.  Table 6-10 compares the performance of RMPGST-IoT with that of ERGID and ADRM-IoT in terms of throughput, packet receiving rate, end to end delay, average residual energy, and network lifetime.  −   10  610  1060  1440  15  730  1207  1600  20  1108  1480  2005  25  1380  1670  2440  30  1604  1790  2700  35  1803  1900  3000  40 1980 2170 3330   10  490  680  900  15  401  610  790  20  335  550  730  25  306  495  697  30  295  415  660  35  250  330  615  40  220  318  604 Average throughput: Figure 12 shows the comparison of the RMPGST-IoT proposed scheme, ERGID and ADRM-IoT models in term of _ AT . (a) Number of Things, (b) Simulation time, (c) Speeds, and (d) Number of CBR sources respectively. As shown in the diagrams, the proposed method outperforms the ERGID and ADRM-IoT methods with regard to throughput as well. On the basis of the results of Figure 12, the _ AT of RMPGST-IoT is 2630 Kbps, ERGID is 2135 Kbps, and ADRM-IoT is 1340 Kbps. This is due to the fact that RMPGST-IoT selects routes on the basis of gray system theory information, with end-to-end link quality estimation (QoS-aware), unlike ERGID and ADRM-IoT models that only chooses paths based on Global Information Decision (GID).    figure 13, the proposed method in this paper (RMPGST-IoT) has better PRR than ERGID and ADRM-IoT. This is because in the proposed method, packet routing is done through the routes with high remaining energy, link expiration time, and signal to noise ratio. Also, there are two reasons for achieving high PRR, stabled routes sustaining over a long period of time are identified in the route discovery plane and the replication is curtailed in the successive plane. This ensures improved message transfer in a unique manner over the same link, increasing the PRR. It exhibits a high-level of performance with a high PRR (more than 95.34%) as compared to ERGID and ADRM-IoT approaches. node come to failure, the PLR of the RMPGST-IoT protocol is 13.5%, which is better than the ERGID and ADRM-IoT. The reason behind the better performance of RMPGST-IoT is, it because it reacts more precisely to congestion than other protocols.  Figure 15 shows the comparison of the RMPGST-IoT proposed scheme, ERGID and ADRM-IoT models in term of ARE . (a) Number of Things, (b) Simulation time, (c) Speeds, and (d) Number of CBR sources respectively. This criterion presents the ARE in the nodes after routing has been carried out and is calculated using equation 13 which is calculated by subtracting the consumed energy from the initial energy. As seen in figure 15, the ARE in the nodes is calculated at 100 and 1000 seconds in every simulation. The simulation results present that the ARE in the nodes for the proposed RMPGST-IoT is higher than the ERGID and ADRM-IoT methods. This is because in the proposed method, routing is carried out using routes which consist of nodes which are better than the nodes in other routes with respect to hop count, noise rate, ARE , and link expiration time criteria. Therefore, taking into account the hop count criterion leads to lower energy consumption, while selecting the route which consists of nodes with higher energy levels controls the network energy and increases the ARE . Therefore, the RMPGST-IoT performs better in this regard as well. The ARE in RMPGST-IoT, ERGID and ADRM-IoT algorithms is reduced by 700, 600 and 470%, respectively, while the number of things is increased by 940, 690 and 550%, respectively.  Figure 16 shows the comparison of network lifetime. The graph proves that the introduced (RMPGST-IoT) approach has a large network lifetime compared to other existing approaches. The network lifetime will decrease by increasing the number of CBR sources. The proposed RMPGST-IoT uses large network lifetime of 5200 rounds in 500 things when compared to existing approach. In 100 nodes, the network lifetime of existing approaches ERGID, and ADRM-IoT are 4800rounds, and 4100rounds respectively. In the RMPGST-IoT method, by choosing high energy routes with fewer hops, premature deactivation of nodes in the network is prevented. Since the routes are selected for data transmission based on their remaining energy and fewer hops while also taking into consideration their noise rate and link expiration time, energy in the network nodes is depleted over a longer period of time and network lifetime is increase. Energy Balance: The energy analysis is through the 50 key nodes collected from the other 500 nodes. The remaining energy and lifetime of time 200, 400, 600, 800, 1000 s are analyzed. The remaining energy and lifetime of RMPGST-IoT are shown in Fig. 17. The energy has a better balance effect by secondary energy amendment strategy.

Conclusion
In reality the devices in IoT are highly heterogeneous and many of them have limited resources and therefore their global connectivity creates an important challenge for the internet of things. Therefore, this network faces multiple challenges regarding energy consumption and reliable connectivity and the inherent features of these networks, such as dynamic topology and energy constraints, has made the routing problem very challenging. In order to tackle this issue, researchers are constantly searching for new and effective methods to solve the problems present in these networks. AOMDC routing protocol is the multi-path version of the AODV protocol. This protocol tries to discover routes with separate links and nodes to send data through. Since multiple routes to the destination are used, in this paper this method has been chosen for routing in the internet of things meaning that AOMDV has been improved by utilizing important criteria such as energy, link expiration time, and signal to noise ratio. Also, gray system theory is used to select the best and optimal routes. In order to create this method, we use the hop count, mid-route nodes energy, link expiration time, and signal to noise ratio parameters for routing in RMPGST-IoT. To use these criteria, AOMDV standard packet format was changed and new fields were added to it. Afterwards, using the gray system theory to rank the routes, best routes were selected to transfer data through. We have analyzed the performance of our RMPGST-IoT scheme using NS-3, and showed that it exhibits a high-level of performance with a high throughput (more than 96.27%)%), and high PRR (more than 95.24%), and low PLR (less than 13.23%), and high average remaining energy (less than 28.11%), and high network lifetime (more than 87.15%), as compared to current approaches.