Keywords

1 Introduction

Due to the unstable link characteristics of the 6LoWPAN network and the need for low power consumption, the traditional routing protocol is not suitable for 6LoWPAN, so a special network protocol must be developed. To this end, the IETF established a special working group routing over low-power and lossy networks (ROLL) for the development of a low-power lossy network routing protocol (RPL) in compliance with the 6LoWPAN specification and introduced the RPL routing protocol in 2012. The first specification is RFC6550. The specification mainly describes the message frame format, network creation mode, and communication type of the 6LoWPAN network [1]. In addition, the ROLL working group also agreed on the corresponding routing specifications for practical applications in different fields [2]. The RPL routing protocol mainly solves three major problems:

  1. (a)

    Load balancing ensures that most nodes in the PAN maintain low energy consumption.

  2. (b)

    Loop avoidance and ability to converge quickly.

  3. (c)

    Set congestion control mechanism to control traffic transmission.

Load balancing is achieved by designing the corresponding objective function. The loop avoidance mechanism is implemented by the rank mechanism and DODAG. Congestion control is implemented by trickle.

The RPL routing construction process is the DOGAG construction process. The DIO, DIS, DAO, and DAO-ACK messages are used to complete the networking. The routing metric determines the information carried by these types of messages. The routing metric consists of the RPL routing strategy. It is also implemented by the objective function. According to the strategy, OF can have multiple definitions, but the same type of OF can only be used in the same RPL instance. The objective function has always been the focus of people’s research. By combining different metrics and routing constraints to form different objective functions (object functions, OF), a destination-oriented directed acyclic graph (DODAG) is constructed to achieve the improved link transmission efficiency and energy consumption reduction. Since the energy consumption and link quality of nodes in 6LoWPAN have always been the focus of attention, this paper will also reduce the energy consumption, extend the network life cycle, and reduce the packet loss rate. Existing objective functions are researched and improved.

In this paper, network depth is used as a routing metric to balance the relationship between node energy consumption and link quality, and finally create a load-balanced topology. The improvements brought by this paper are:

  1. 1.

    In this paper, expected transfer count (ETX), energy consumption, and hops are used as the metrics of the objective function to construct an objective function of multiple metrics.

  2. 2.

    The value of the hop count is used as a weight to measure the depth of the network where the node is located. Eventually, the node can select the parent node according to the depth.

  3. 3.

    The new routing strategy proposed in this paper balances link quality and node residual energy to achieve load balancing.

2 Related Work

2.1 Basic Objective Function in Routing Protocol for Low-Power and Lossy Networks

The objective function is not a single function, but a collection of functions. All nodes in the same RPL instance use the same objective function. The main task is to establish the selection of the parent node and the calculation of the rank value through the objective function in the process of establishing the RPL routing topology, so as to achieve different networking purposes. This process is triggered when the node detects an event that may occur with neighbor node information updates (node failure, timer expiration, DIO message received).

The calculation method of the rank value is shown in Eq. 2.1:

$$ {\text{Rank}}_{\text{c}} = \left\{ {\begin{array}{*{20}c} {{\text{Rank}}_{\text{P}} + {\text{Rank}}_{\text{increase}} ,} & {\text{non - root}} \\ {0, } & {\text{root}} \\ \end{array} } \right. $$
(2.1)

Rankc is the rank value of the child node, Rankp is the rank value of the candidate parent node, and Rankincrease is the rank increment.

When the network starts, the root node RANK value is defined as 0, and the non-root node calculates its own rank value by obtaining the parent node’s rank value and then adding the rank increment (depending on its own DODAG), and the rank increment cannot exceed threshold, if the new rank calculation result is greater than the existing rank value, the parent node will not be changed.

  1. 1.

    OF0

OF0 [3] is the default routing function of RPL. It can be known from RFC6552 that it uses the hop count as the main metric to make the decision of the parent node. The smaller the hop count of the candidate parent node from the root node, the more likely it is to become. The optimal parent node of the child node calculates the possible rank value of the child node after selecting the candidate parent node and takes the smaller one as the best parent node. The value can approximate the relative distance between the node and the root node. The calculation of the rank value Rc of the child node is 1 and Eq. 2.2:

$$ {\text{Rank}}_{\text{Increase}} = (R_{\text{f}} *S_{\text{p}} + S_{\text{r}} )*{\text{MinHopRank}}_{\text{Increase}} $$
(2.2)

where Rf is the expansion factor, in order to adjust the weight of Sp, the default is 1; Sp is the ladder value, which can be set to be related to the link state between the node and the parent node, the default is 3; the maximum value of Sr is the largest Sp value. The amount of growth, this variable is set to maintain routing diversity, to ensure that there is at least one valid next node, the default is 0, the maximum is 5; MinHopRankIncrease is set to the minimum increment between the child node and the parent node in DODAG, the value is provided by the root node, the default is 1.

It is not difficult to see from the formula that the method of calculating the hop count alone may result in the selection of the node with poor link quality as the parent node. Although OF0 provides the expansion factor such as Sp, if it is dynamically assigned, the routing may be increased. Diversity, but it is also very likely to cause many unstable factors to the network, so it needs to be verified by enough experiments to modify it [4].

  1. 2.

    ETX [5]

The goal of the ETX design is to calculate the expected number of times the node needs to successfully send data to the destination. The total ETX of a link is the sum of ETX between the nodes on the link. The ETX value of the link is calculated by the DIO message. When a node receives a DIO message from a node of another link, and the ETX included in the DIO message changes, the ETX value of the link is recalculated and compared with the ETX of the current link. Finally, select the best parent node.

The calculation formula of ETX is shown as Eq. 2.2:

$$ {\text{ETX}} = \frac{1}{{{\text{PRR}}_{\text{up}} * {\text{PRR}}_{\text{down}} }} $$
(2.3)

PRRdown is the delivery rate of the downlink direction of the data packet (the reception rate of the ACK packet), and PRRup is the delivery rate of the uplink reverse direction of the data packet. It can be seen that the higher the two-way delivery rate, the smaller the value of ETX, indicating that the quality of the link is higher. The two nodes periodically send probe data packets to complete the PRR data collection. The PRR calculation formula is shown in Eq. 2.4.

$$ {\text{PRR}} = \frac{{{\text{S}}_{a \to b} }}{{T_{a \to b} }} $$
(2.4)

where S is the number of packets successfully delivered between nodes a and b, and T is the total transmitted packet data.

  1. 3.

    MRHOF [5]

Unlike OF0, MRHOF is an objective function based on the hysteresis mechanism. By default, the selected metric is the ETX value of the link, which is related to the path cost. In the case of network stability, the node with the lowest link cost is selected as the node, parent node. However, MRHOF weakens the response speed of the objective function of pure ETX. On the relatively stable link of ETX, the hysteresis mechanism is used to weaken the influence of small changes of ETX on topology reconstruction.

The idea of MRHOF is that when a new candidate parent node appears, only the link cost is less than the current optimal link, and the difference of the rank value is greater than the set threshold, the current node will select the node as its own optimal parent. Node, this is the lag mechanism of MRHOF, which can reduce the jitter of the network to a certain extent, thus meeting the characteristics of the scene [6].

2.2 Routing Decision Research

In terms of loop avoidance, a routing loop avoidance mechanism is mentioned in [7]. Although this scheme has certain effects on loop avoidance under certain conditions, after the sensor network scale is further increased. The loop avoidance mechanism that continuously detects the loop has a more serious impact on the network than the route loop. Therefore, for an RPL network with a large number of nodes, the loop avoidance mechanism is unrealistic.

In terms of load balancing, Michel et al. combine the opportunity routing mechanism to adjust the wake-up period of the intermediate nodes in the link, thereby achieving the goal of reducing node energy consumption [8]. However, the algorithm does not take into account other situations in the packet transmission process, so there is no significant optimization effect on the life cycle of the entire network.

In the introduction of new metrics, Capone et al. added the transmission power factor of the node, combined with the original link quality and the energy consumption of the nodes, combined with functional operations to form a new metric L2AM, which is selected during node decision making. The metric is smaller as the parent node [9]. Lova et al. join the data transmission factor between nodes, combined with the original link quality and node energy consumption, and selects the smaller measurement as the decision basis [10].

In terms of routing strategy, Chang et al. proposed the energy-efficient algorithm, which combines the remaining power and the expected number of transmissions with the candidate parent nodes [11], but there is no mechanism to dynamically adjust the weights of the two.

In terms of multi-path transmission, Lova et al. improve the objective function of the ELT in the literature [12] and determine the parent node according to the ELT value. This scheme can improve the utilization of the node to a certain extent, but it is easy to cause the ring. The road, in turn, causes a packet loss. In [13], Gaddour et al. proposed an objective function which combining the multi-path mechanism. Although the experimental results show that the scheme has a significant improvement on the packet delivery rate and the overall energy consumption of the network under a small-scale network, network congestion will still occur frequently.

In terms of reducing node power consumption, Rukpakavong et al. proposed a routing algorithm based on node transmission power consumption, which calculates the minimum power consumption consumed by a sub-node to transmit a data packet, and uses this as a measure factor to select the node on the path with the lowest energy consumption which is the parent node [14], so as to achieve the effect of prolonging the network life cycle. Lova et al. proposed a multi-parent path selection scheme, and the multi-parent node strategy improves the network stability and reduces the overall energy consumption of the network [15]. However, when the node leaves or joins in the network and causes topology changes, incoming to repair and rebuild the routing state will cause a large number of data packets to be filled in the network, thereby increasing the burden on the node. Therefore, the solution is only suitable for a network with stable node conditions.

Chang et al. proposed an energy-oriented RPL routing mechanism R_RPL [16], combining the residual energy index with ETX and setting the fixed weight to make the network more balanced. According to Lassouaoui L et al., the results show that the R_RPL protocol has obvious advantages compared to the objective function OF0 or ETX of a single metric factor [17, 18].

2.3 RPL Performance Test

Hakeem et al. conducted a simulation test on the performance of the RPL routing protocol in packet forwarding and networking which is based on the Cortex M3-nodes node [19]. In the network with about 150 nodes, the experimental results show that the actual application requirements can be met, and the network operation is basically stable.

Gaddour et al. carried out simulation tests on the packet delay, packet loss rate, and energy consumption of the RPL protocol [20]. The results show that as the network scale increases and the number of nodes increases, the protocol cannot cope with the impact of packet growth, and resulting in a sudden drop in performance.

Lova et al. make a detailed test analysis of the RPL’s DIO packet transmission and the end-to-end delay in the network [21]. The results show that the network is started when there is a problem with the link in the network. The repair mechanism will cause a large number of control messages to be flooded on the link. The growth of control packets will greatly reduce the stability of the network and increase the overall energy consumption of the network, resulting in a shorter network life cycle.

Sharma et al. quantitatively test and analyze the ETX-based and RANK-based objective function OF0 in RPL, and find that the objective function with ETX as the measure factor will be based on the minimum route during packet transmission [22]. ETX selects the routing path. Through simulation experiments, it is concluded that the ETX-based objective function is stronger than OF0 in network throughput [23], network delay, and link transmission rate.

In summary, based on the low power consumption and unstable characteristics of the wireless sensor network in the 6LoWPAN system, most of the research on RPL is to improve the network life cycle and the delivery rate of data packets. This paper will also present its own research program for this purpose.

3 RR_RPL Description

As shown in Fig. 2.1, in the ideal 6LoWPAN network, the remaining energy consumption level in operation should be gradually reduced according to the distance from the root node. In reality, the node closer to the root node tends to bear more forwarding tasks, so the energy will consume faster and prematurely exit the network, while the leaf nodes in the edge part may still have more remaining power after the parent node runs out of power. Therefore, we need to optimize the routing decision of the 6LoWPAN network by designing a reasonable objective function to achieve more balanced energy consumption. The ultimate goal is to extend the life cycle of the entire network.

Fig. 2.1
figure 1

Remaining energy of 6LoWPAN

3.1 RR_RPL Calculation Model

Load balancing is critical for RPL networks. In the long-term stable operation of the network, maintaining low packet loss is a necessary function. Therefore, ETX metrics must be taken into account in routing decisions. In actual testing, rank comparison A node with a lower node than a high rank value needs to forward more routing information, which means that the energy consumption is correspondingly increased. In order to prevent the intermediate node in the root node to the leaf node transmission link from depleting energy prematurely, we also need to consider the remaining energy of the parent node in the process of selecting the parent node, so that the network has a longer life cycle. Since the rank value reflects the network level at which the node is located, the rank value is also incorporated into our routing algorithm as an important link metric.

This paper proposes a new RPL routing protocol: RR_RPL (Rank_Remain Energy RPL). The protocol uses the value of the node rank as the weight, combined with the ETX and the remaining energy of the node, aiming at balancing the energy consumption of each node and ensuring the optimal link condition to achieve the purpose of extending the network life cycle. The RR_RPL calculation model is as shown in Eq. 2.5:

$$ M = \frac{{{\text{Rank}}_{\text{p}} }}{{{\text{Rank}}_{ \hbox{max} } }}\left( {\frac{{{\text{ETX}}_{{\left( {\text{n,p}} \right)}} }}{{{\text{ETX}}_{ \hbox{max} } }}} \right) + \left( {1 - \frac{{{\text{Rank}}_{\text{p}} }}{{{\text{Rank}}_{ \hbox{max} } }}} \right)\left( {1 - \frac{{{\text{Energy}}_{\text{p}} }}{{{\text{Energy}}_{ \hbox{max} } }}} \right) . $$
(2.5)

M is the routing metric when the child node selects the parent node. In the routing decision, the child node selects the parent node with the smaller M value among the candidate parent nodes. Rankp is the rank value of the parent node, Rankmax is the maximum number of hops allowed, Energyp is the remaining energy value of the parent node, Energymax is the initial energy value, and ETX(n,p) is the expected number of transmissions from the child node to the candidate parent node. ETXmax is the sum of the most ETXs in the DIO message sent to the alternate parent.

The Rankp value is calculated using the Formula (3.1) in the OF0 objective function, where RankIncrease is set to 1 in the Formula (3.1).

3.2 Comparison of M Metrics and R Metrics

In the R metric, since the b value is a fixed value as the weight, when the different depth nodes are faced, the weight ratio of the two metrics cannot be dynamically adjusted according to the actual situation of the node. Figure 2.2 shows an example of the decision to select a parent node.

Fig. 2.
figure 2

Parent node selection

Suppose P1 and P2 are the potential parent nodes of the A node. By calculating the parameters in Fig. 2.2, you can get:

  1. 1.

    Under the R metric, RP1 = 0.5 and RP2 = 0.55. As a result, the P1 node is selected as the parent node.

  2. 2.

    Under the M metric, if the parent node is at a higher rank level, it is assumed that the rank ratio is 0.2, then RP1 = 0.74, RP2 = 0.58, and the P2 node is selected as the parent node; if the parent node is at the lower rank level, for example, the rank ratio is 0.8, then RP1 = 0.80, RP2 = 0.88, then the P1 node is selected as the parent node.

Therefore, it can be seen that the M metric is a routing decision mechanism that uses different weights for nodes of different rank levels, so that the network can dynamically adjust the routing strategy according to the depth of the network where the node is located and is more flexible.

3.3 RR_RPL Pseudocode Implementation

The source location of the RPL protocol is in the core → net → rpl directory of the Contiki operating system, which contains the source code used for the objective function and topology construction. Table 2.1 is the pseudocode implementation of RR_RPL.

Table 2.1 Pseudo code of RR_RPL

4 Simulation Results and Analysis

In this paper, Contiki’s own Cooja simulator is used to simulate and analyze the ETX-based objective function, R_RPL objective function and improved RR_RPL objective function in several different nodes.

4.1 Simulation Setup

As shown in Fig. 2.3, the nodes are distributed in a square area of 250 m * 300 m. In this area, All nodes are randomly distributed. Three simulations were performed under the same number of nodes, and the results were averaged. The following is the selection and setting of the simulation environment and parameters to compare the network status before and after the improvement. Two dry batteries have a power of about 7500 J, and the two power supply cycles are about 150 days. Complete the simulation test in time, set node 1 as the root node, and set it to the continuous power supply. The initial power of the remaining nodes is set to 6 joules, and the simulation period is 6000 s. The simulation parameters are shown in Table 2.2.

Fig. 2.3
figure 3

Node distribution

Table 2.2 Simulation parameters

Figure 2.3 is an example of 25 nodes as an example to analyze the structure of the network topology.

4.2 Simulation Results

After comparing the simulations under the two objective functions, the topology generated in the initial state of the network is shown in Figs. 2.4 and 2.5.

Fig. 2.4
figure 4

Network topology of R_RPL

Fig. 2.5
figure 5

Network topology of RR_RPL

The objective function is different. The decision of the node to select the parent node is different, and the naturally generated topology is different. However, since RR_RPL and R_RPL are combined with ETX, the remaining power, and the remaining power of each node is sufficient in the initial stage of network construction, the topology structure under these two objective functions is not much different. However, as time passes, the energy of nodes closer to the node decreases rapidly. The improved objective function will replan the topology according to different rank values. The topology of the two objective functions will be greatly different.

Figures 2.6 and 2.7 show the average energy consumption of each node in the simulation environment.

Fig. 2.6
figure 6

Average energy consumption of R_RPL

Fig. 2.7
figure 7

Average energy consumption of RR_RPL

As can be seen in Figs. 2.6 and 2.7, the improved RR_RPL objective function is superior to the R_RPL objective function in terms of overall energy consumption, and intuitively, the average energy consumption of each node is relatively balanced. The simulation results of the life cycle are analyzed.

4.3 Simulation Analysis

In the simulation environment, we simulated the placement of 25, 50, 75, 100, 125, 150, and 175 nodes and performed three different objective functions (RR_RPL, R_RPL, and ETX) for each layout. In contrast, the focus is on the measurement of the life cycle and throughput of the entire network.

As can be seen from Fig. 2.8, as the number of nodes in the network increases, the life cycle of the entire network decreases. The objective function measured by ETX uses only a single metric of link quality as the routing decision of the objective function. Therefore, the routing decision of the node is not changed because the energy consumption of the individual node is high throughout the network cycle. As a result, the network life cycle drops sharply as the number of nodes continues to increase. However, the R_RPL objective function does not take into account the dynamic increase or decrease of the residual energy and ETX weight of the node, which leads to the delay of updating the topology. While the RR_RPL can dynamically set the dynamic according to the three metrics during the network operation, the weights can be dynamically set according to the three metrics to select a better parent node, thus extending the network life cycle accordingly.

Fig. 2.8
figure 8

Comparison of network lifetime

Figure 2.9 shows the comparison of packet delivery rates under the three objective functions. The ETX-based objective function uses link quality as the only indicator. Therefore, when the number of nodes is lower than 120, the performance is optimal. With the growth of network scale, nodes with better link quality will undertake more packet forwarding tasks, and the resulting network congestion will increase the number of retransmissions and packet loss rate.

Fig. 2.9
figure 9

Comparison of packet delivery rate

R_RPL and RR_RPL take into account ETX and residual energy. When the network scale is small, due to the small number of hops and insufficient network depth level, both objective functions consider the residual energy of the node more, so it is not sufficient to show the superiority of routing decisions. As the scale grows, more and more congestion begins to occur in networks based on the three objective functions, so the packet delivery rate is similar at this stage. In the case of further growth of the network scale, the nodes with smaller levels begin to consider the energy of the parent node more, while the nodes with more distant ones consider the link quality more, and the optimization effect of RR_RPL is reflected.

5 Conclusion and Recommendations

This paper introduces the routing process and routing strategy of RPL routing, focuses on the objective function of determining the parent node strategy, and analyzes the shortcomings of the R_RPL metric function.

Furthermore, an objective function optimization scheme RR_RPL based on load balancing and multi-measure factor is proposed, and the specific objective function design is given. Enable the node to select the best parent node according to the network level at which it is located.

After simulation test analysis under different network scales, RR_RPL shows flexible adaptive ability. Compared with R_RPL, the improved routing strategy has optimization effects on life cycle and packet delivery rate.