Hop-by-hop traffic-aware routing to congestion control in wireless sensor networks

One of the major challenges in wireless sensor networks (WSNs) research is to prevent traffic congestion without compromising with the energy of the sensor nodes. Network congestion leads to packet loss, throughput impairment, and energy waste. To address this issue in this paper, a distributed traffic-aware routing scheme with a capacity of adjusting the data transmission rate of nodes is proposed for multi-sink wireless sensor networks that effectively distribute traffic from the source to sink nodes. Our algorithm is designed through constructing a hybrid virtual gradient field using depth and normalized traffic loading to routing and providing a balance between optimal paths and possible congestion on routes toward those sinks. The simulation results indicate that the proposed solution can improve the utilization of network resources, reduce unnecessary packet retransmission, and significantly improve the performance of WSNs.


Introduction
Wireless sensor network (WSN) refers to a group of spatially dispersed and dedicated sensors for monitoring and recording the physical conditions of the environment and organizing the collected data at a central location. In large-scale applications of wireless sensor networks (WSNs), such as environment monitoring or agricultural scenarios, several hundreds of sensor nodes are deployed over a large covered-area [1,2]. Large numbers of nodes become active and transmit data traffic, leading to congested areas.
Congestion in wireless sensor networks has a negative impact on the performance, decreases throughput, increases packet retransmission, and wastes energy. In wireless sensor networks, traffic has the centralized pattern, so bypassing the hot spots is not effective in removing the congestion, because it will reappear near the sink.
Additionally, the traditional centralized approach, in which data traffic from sensor nodes accumulate near one sink [3,4], is not efficient in terms of energy consumption or packet delays and may yet be unacceptable due to limited network capacity. Therefore, using multiple sinks is proposed as a more feasible scheme for such networks [5][6][7][8].
In this paper, we propose a traffic-aware routing algorithm to route packets around congested areas by using the idle or under loaded nodes. The key concept of our algorithm is to construct two independent gradient fields using depth and traffic loading, respectively. The depth (distance cost) is built conventionally as in other gradient-based routing protocols that find the shortest paths for packets. The second factor addresses the traffic loading of neighboring nodes that may become the next forwarder. Once the traffic loading exceeds a threshold, it means that there is congestion at a node in the path toward a specific sink; the packets would flow along other suboptimal paths.
Thus, the traffic gradient field endows our trafficaware solution, and the depth field provides the basic routing backbone to direct the packets to the sink. These two fields will be combined into a hybrid potential field to dynamically make routing decisions. In other words, this method leads to a trade-off between the shortest paths and traffic at overloaded node. Additionally, our algorithm presents a hop-by-hop congestion control scheme, in which congestion is controlled by dynamically adjusting data transmission rate of the nodes.
The rest of this paper is organized as follows: in Section 2, we introduce the related work about congestion control in WSN and summarize the studies related to gradient-based routing. In Section 3, the basic idea is presented, in which the total gradient is built and some properties are analyzed. In Section 4, detailed implementation of the proposed algorithm is described. Simulation settings and numerical results are presented in Section 5. The final section concludes the paper and discusses the scope for future work.

Related works
Since wireless sensor networks work on a limited network bandwidth, traffic congestion frequently occurs during the relay process of sensing data. To solve this problem, several studies have been proposed based on the reduction of data sensing rates in terminal sensor nodes [9,10].
Congestion detection and avoidance (CODA) [10] presents the first detailed investigation on congestion detection and avoidance in wireless sensor networks. CODA includes three elements -congestion detection based on receiving, open loop hop-by-hop back pressure, and closed loop multi-source rate adjustment. As with open loop hop-by hop back pressure, the source gets the back pressure signals depending on the local congestion state. For closed loop multi-source rate adjustment, the source gets an acknowledgement (ACK) from the sink and when the congestion occurs, the sink stops sending ACKs to the source. CODA controls the rate of flow of packets based on the additive-increase/ multiplicative-decrease (AIMD) algorithm. This technique is energy-efficient, but the reliability of the successful delivery of the packets to the destination is not guaranteed, for on receiving back pressure signals (meaning, the signals received by the source node from the intermediate nodes), the nodes drop their packets based on the congestion parameters.
The event-to-sink reliable transport (ESRT) protocol improved the reliability of event data transmission in wireless sensor networks [11]. In this method, all sensor nodes monitor their internal buffers to find traffic congestion. When traffic congestion is detected, the result is sent to the sink node. The sink node periodically configures the source sending rate with broadcasts the congestion state to all sensor nodes. After receiving the broadcast message, each sensor node tries to reduce the data transmission rate. Due to the reduced data traffic, the traffic congestion problem could be alleviated gradually. Similarly, interference-aware fair rate control (IFRC) [12] uses static queue thresholds to determine congestion level and operates congestion control by adjusting outgoing rates on each link based on AIMD scheme. It employs a tree rooted at each sink to route all data. When congestion occurs, the flow rates of the interfering trees are throttled.
When traffic congestion occurs, the above methods lead to the reduction of data sensing rates in the terminal sensor nodes. There have been some attempts to explore mechanisms for congestion avoidance in WSNs but not for the schemes based on reduction of data sensing rates.
SPEED [13] manages congestion by rerouting the incoming traffic around the hot spot. The rerouted path, however, may not have a larger end-to-end channel capacity to accommodate the incoming traffic, leading to congestion. In congestion-aware routing (CAR) [14], authors represent a differentiated routing approach to discover the congested area of the network that exists between high-priority data sources and the data sink and to dedicate this portion of the network to forward primarily high-priority traffic data.
Another scheme is proposed to split the traffic from the source into multiple paths to achieve load balance and increase throughput [15].
To avoid additional costs of multi-path routing when the network is not congested, biased geographical routing (BGR) protocol [16] is presented to reactively split traffic, when congestion is detected. BGR employs the dynamic routing technique to alleviate congestion so as to decrease the additional cost of static multi-path routing. If its drawbacks, such as the blindness during scattering packets and the restrictions on coordinate systems, can be properly overcome, a more effective and practicable congestion control mechanism would be achieved for WSNs. Based on this understanding, many studies have been conducted with the aim of using gradient search to solve the routing problem in WSNs [17][18][19][20][21].
In gradient search, a node builds its own gradient field in response to neighbor nodes in the direction of a specific sink. Data traffic flows along the direction with the steepest gradient in order to reach the sink. The cost model can be designed in terms of hop count from sink to node, physical distance, energy consumption, or cumulative delay, depending on the objectives of routing such as energy consumption, packet delay, or packet delivery ratio [22].
One of the first researches mentioning the concept of gradient for routing protocols in WSNs conducted diffusion technique [18] leading to energy savings by storing and processing data in a network. The gradient field contains a data rate and duration information field from a node to its neighbors toward the sink.
Many research works have been devoted to solve the energy-aware routing in wireless sensor networks. Gradient-based routing protocol for load-balancing (GLOBAL) [22] focuses on energy improvement in large-scale multi-sink wireless sensor networks. It allows a source node to choose the least loaded path in order to avoid overloaded nodes by constructing its gradient field utilizing the weighted factor of the cumulative path load and traffic load of the overloaded nodes over the path. However, the approach based on global information cannot guarantee the correctness of the updated information over the long path because of the network dynamics in high traffic scenarios.
Also, SGF [23] is a gradient-based routing protocol to reach significant energy savings. The authors suggest a new gradient field for nodes without using routing tables. The values are updated on demand by data transmission with little overhead. A cost-aware multi-hop is represented in [24] routing protocol. The cost metrics used to build gradient fields are energy, traffic load, delay, and link reliability. This algorithm leads to a significant improvement in energy consumption. Another scheme to solve energy efficiency and computational complexity in industrial WSN is proposed in [25]. The authors present a new method with two-hop information routing algorithm that takes velocity and remaining energy at each node into account. Gao et al. [26] form clusters via nodes with the same number of hops away from the sink. Each node then takes turns to become the cluster head to balance the energy consumption and the lifetime of sensor nodes in a cluster.
In addition to energy-aware, traffic control is also an important issue in WSNs. Traffic-aware routing to achieve network balancing and congestion avoidance, has received extensive attention in the area of WSNs. The routing algorithm in [21] designs a potential field for traffic-aware routing based on steepest gradient search method in order to create a trade-off between traffic metrics and link costs. It means that the routing algorithm in [21] finds optimal routes by balancing congested areas and the shortest path. It is proved that this algorithm obtains significant improvement in end-to-end delay and jitter over many kinds of networks and traffic conditions with a few overheads. The method, however, is hardly applied to WSNs, because it requires extensive communication and computation, and it is originally designed for the Internet. Park and Jung [27] propose a trafficaware routing protocol (TARP) to increase the data transmission efficiency and improve energy consumption for WSNs. TARP uses a lightweight genetic algorithm to distribute the data traffic away from congested areas. TARP also takes two-hop information of surrounding nodes in route calculation; however, this algorithm focuses on packet loss due to queue overflow and power efficiency and therefore leads to single sink scheme, which is different from our model. Gradientbased traffic-aware (GRATA) routing [28] utilizes the expected packet delay at one-hop neighbor and the number of hops to make routing decisions. However, the routing scheme based on packet delay can be lack of information about traffic condition, which may lead a packet to a new congestion area.
In this paper, we will follow gradient-based search model to solve the traffic-aware routing issues. Compared with the recent researches, our contributions are as follows: Leading to multi-sink WSN applications with heavy traffic scenarios, in which a large amount of traffic may cause black spot on the paths to the sink. Using the number of hops from the local node to the sink, while current traffic information contains the queue length, the congestion degree and the average cumulative queue length construct the gradient field at each node. Adjusting the congestion window and data transmission rate of sender nodes in order to improve overall throughput.

System model
In this section, we will distinguish how to make the gradient-base routing model using depth and traffic loading, respectively, and then how to integrate them together to make dynamic routing decision. First, depth field for a gradient field, which is based on the shortest cost path model, is described. Next, we insert an additional metric into the gradient field to reflect traffic information in each of the neighboring nodes. By monitoring the number of packets in queue, the congestion degree and the average cumulative queue length, a node informs its neighbors about both the distance cost from itself to a sink and possible congestion.
On a multi-sink network, multiple gradients are built corresponding to each sink. The height value in each node implies the minimum cost to reach the final destination.

Depth field
To provide the basic routing function, namely, to make each packet flow toward sink i, we define the depth potential field V i d v ð Þ as: is quite similar to the length of the shortest path, since they both represent the distance from the destination. If the shortest path algorithm chooses the hop count as its routing metric, Depth (v) will actually become the length. Due to the centralized traffic pattern in WSNs, Depth (v) has some special properties. The depth difference between node v and its neighboring node wє nbr(v), namely V i d v; w ð Þ , can only be either −1, 0, or 1, since the neighbors nodes are defined to be one hop away. As a result, the depth field encourages packet to flow directly to the sink via the shortest path.
We will now show that a system based on the shortest path paradigm is loop-free [29], following Theorem 1.
Theorem 1: If field V d (v1) is independent of time, shortest path routing is loop free.
Proof: This theorem is proved by contradiction. Assume that the field V d (v1) monotonically decreases from source to sink and the steepest gradient searches for a neighbor with lowest gradient index. If there is a loop, then packets go in a circle of v1 → v2 → … → v n → v1. However, this closed loop cannot work, due to not meeting the condi- , because the number of hops from a node to sinks is unchanged or time-invariant.
In a special case, if there are two or more next neighbors with the same lowest gradient values, the node chooses the next forwarder randomly in a stochastic scheme, similar to tossing a die [30]. With hop count, each node discovers a list of parents, siblings, and children with respect to each sink from its neighbors, whose hop count is respectively one hop lower, equal, or one hop greater on the path toward a specific sink. The node maintains a table with the relative nodes of each sink. In light traffic, the node should choose routes with the lowest distance to the sink in order to ensure low energy consumption. However, since a large number of nodes become active and send data to the sinks simultaneously, this causes areas of congestion, leading to packet delays or loss. Our target is to consider all candidates and to find possible routes that can be used to avoid heavy traffic regions by incorporating traffic conditions into our calculation.

Traffic loading potential field
Now, we take the second traffic factor into the gradient field. The gradient field contains two types of information: hop count and traffic loading; hence, it is expected to provide better routes and exert the idle or unloaded nodes to alleviate congestion and improve the overall throughput in WSNs. In each node, to obtain the exact loading of traffic, we define three factors: normalized buffer size field, congestion degree, and average cumulative queue length.

Normalized buffer size field
Node v sends a packet to another node x, (x∊nbr (v)), only when node x has enough buffer size to store the packet from v. Therefore, packets will not drop at the receiver due to buffer overflow.
We define the queue length field at node v as: The function Q (v) denotes the normalized buffer size at node v as defined by: The value of Q (v) is in the range [0, 1], which denotes nodes' traffic information. Based on this field, packets will be forwarded toward the idle or unloaded area.

Congestion degree
The objective of the queue length field is to prevent the packet from going to the possible congestion area. In this method, a node chooses one of its neighbors as its next destination by considering the buffer size. In other words, a node chooses one of its neighbor nodes with low queue length to become the next destination in the direction of each sink.
Most of the time, this approach routes packets around the congested area and scatter the excessive packets along multiple paths. Nerveless, it is highly likely that the congestion is caused by burst traffic. For instance, the sensor nodes will generate transient bursts of traffic, when the abrupt events occur. When burst occurs near node v, the queue length of this node may be low, but it is clear that node v is not a proper destination for source nodes to send the packet, because a lot of packets will enter v due to the burst near it and the queue length field cannot distinguish this problem. To this end, we define the congestion degree field.
Congestion degree indicates the changing tendency of buffer queue in a period of time. The function V c (v) denotes the normalized congestion degree at node v as defined in Equation 4: In the above equation, Ta is the interval between the arrivals of two adjacent data packets in media access control (MAC) layer and Ts is the average processing time of data packets in the local node. If V c (v) > 1, the arrival rate is more than the departure rate of data packets, indicating that congestion may possibly happen in the near future in this node. Consequently, this node is not a proper choice as the next destination.

Average cumulative queue length
The field of average cumulative queue length shows the landscape of congestion in the direction of sink. Each node attaches its normalized buffer size in awareness packet (AP) and broadcasts it in order to update its neighbors routing table. The receiver node compares APs received from all neighbors, selects the next destination with lowest potential field, and then calculates the average cumulative queue length in the direction of sink based on Equation 5. Afterwards, this node broadcasts AP that includes the average cumulative queue length. All the nodes are doing it recursively. By using this field in AP, each node has a perspective of upcoming congestion and can make a better choice for next destination. The function V i a v ð Þ defines the average cumulative queue length at node v with respect to sink i as follows: where node v in the direction to sink i, and n is the number of hops in the best path to reach sink i. Now, the traffic loading gradient field at node v in response to sink i is expressed as: where α 1 , α 2 , and α 3 are the weighted factors and independently control the degree of influence of three fields on routing decision (α 1 + α 2 + α 3 = 1). Vq(v) denotes the normalized queue length at node v, Vc(v) represents the congestion degree at node v, and V i a v ð Þ is the average cumulative queue length in response to sink i at node v.

Traffic-balancing routing cost model
As mentioned earlier, the gradient field combines two types of information: hop count distance and traffic loading. Its objective is to exert the idle or unloaded nodes to alleviate congestion and improve the overall throughput in WSNs. Our proposed algorithm builds a gradient value at each node (s) receiving the updated information about the traffic loading from its neighbors. In this approach, a node chooses one of its neighbor nodes to become the next forwarder by considering the depth field and traffic loading information.
An important issue in routing algorithms is the tradeoff between the amount of information that a node should maintain and its effects on the system. In several previous studies in the cost model, only the queue length of nodes has been used to find the next forwarder [19,20]. However, with this limited local information, packets cannot avoid the heavily congested regions. By taking traffic loading information into account, packets can be distributed in directions that avoid heavily congested areas, while still keeping the increase in overhead at an insignificant level.
Once a node (s) has a packet to send toward sink i, it calculates and compares the gradient field of its neighbors v (vє nbr(s)) in response to each sink i following Equation 7.
where β is the weighted factor of traffic cost and V i d v ð Þ is the depth gradient field with the hop number in response to sink i. In our method of traffic measurement, the traffic loading factor V i T À Á is defined as: Finding the value of β is important. The parameter β reflects the weight of the traffic loading factor, and thus naturally decides when traffic-aware method begins to drive packets out of congested path and scatter them in other unloaded or idle areas. The following theorems define the boundary of β.
Theorem 2: When β is chosen to satisfy: then the new gradient field V i (n) at node n does not bring a packet backward to neighbor n + 2 from an interesting sink. Here, ΔV n d 2 j is the difference between node n and its two-hop neighbors in hop number (distance).
Proof: Assume that the field Vd(.) monotonically decreases from source to sink. A similar argument could be used for a monotonically increasing field Vd(.). From Equation 9, we know that . Combing above two inequalities and (7), one obtains:

Remarks:
The last inequality suggests that packets at node n will never go backward to neighbor n + 2 with the steepest search on negative monotonic V d (.).
With an upper bound (9), a packet avoids going backward. However, a problem may rise: packets could travel in a circle, which means jumping through a list of siblings. A simple solution is that for one sending node recording packet ID, for a certain interval if the current node receives that packet again, it breaks the ring by simply omitting neighbors listed on the sibling table of candidates. The lower bound is decided of β with the following theorem.

Theorem 3:
The traffic cost takes effect on the total gradient V i only when: Here j . Similar to Theorem 2, this equation denotes the difference of hop numbers between node n and its one-hop neighbors.
Proof: The theorem is proven by contradiction with a monotonically decreasing function V d (.). A similar argument could be used for a monotonically increasing field V d (.). Assume that there is a point where Δ V n d 1 ð Þ > β (contrary to (10)). With the same argument as in Theorem 2, we have V i (n + 1) > V i (n). That means that routes with new V d (.) behave like those of V d (.), and the adding traffic factor has no impact at this point. Therefore, the total gradient value is affected by the traffic cost only when (10) obtains.
The lower bound at (10) helps the algorithm search for wider candidates compared to the normal shortest path search. To obtain a global effect, (10) can be extended to: Remarks: Equations 9 and 11 set the condition for the weighted factor β so that the traffic cost V i T has an impact on the total gradient field. However, it should be noted that V j T n ð Þ is not always similar to V j T n ð Þ when i ≠ j, but one could choose one value of β for traffic towards any sink.
How the traffic loading field performs in routing decision depends on the way that the above two independent potential fields is combined. Naturally, there are various combination patterns, including linear and nonlinear. It is difficult to find a perfect method to make an optimal combination. Intuitively, whichever combination pattern is adopted, the final routing decision depends on three factors, i.e., the values of depth field and traffic loading field, the combination expression, and coefficients of various items in the combination expression.

Congestion window control
Due to the centrality nature of traffic in wireless sensor networks, just bypassing the intermediate local hotspots has been hard to completely avoid congestion because the hotspots would reappear near the sink if most of the scattered packets approach the sink from different directions simultaneously.
A straightforward solution for this problem is a hopby-hop congestion control scheme, which shares the MAC layer channel information of downstream node with transport layer of upstream node and controls network congestion by adjusting data transmission rate and channel access priority.
The rate adjusting strategy could affect network communication performance metrics such as energy saving, transmission fairness, and network throughput. When the upstream node processes the AP signal received from the downstream node, it should also consider its own congestion condition and adjust the size of local channel and data transmission based on this information.
Assuming that the current node receives AP signal successfully, the local congestion processing method used in our scheme is shown in Algorithm 1, where R is the local node's data transmission rate. Rmax is the maximum data transmission rate of local node during the period of time from the moment it responds to congestion feedback signal to present, and ΔR is the data transmission changing rate that is determined with buffer occupancy ratio and congestion degree value.
Let Br be the buffer occupancy ratio of the current node and B'r be the buffer occupancy ratio of upstream node, which can be attached to AP signal.
If Br > B'r, the current node is more congested than the upstream node. Clearly, the local node should increase its date transmission rate and channel contention window. However, in this case, the congestion degree of upstream node may be greater than the congestion degree of the current node (C' d > C d ), which means that the changing tendency of upper node is greater than the changing tendency of the current node. In this case, using the trade-off between buffer occupancy and the congestion degree, the algorithm decides either to increase or decrease the transmission rate.
In a similar way, Br < B'r indicates that the current node is less congested than the upstream node. Clearly, the local node should decrease its date transmission rate and channel contention window. However, in this case, the congestion degree of upstream node may be smaller than the congestion degree of current node (C' d < Cd), it means that the changing tendency of the upper node is smaller than the changing tendency of the current node. In this case, using the trade-off between buffer occupancy and the congestion degree, the algorithm decides either to increase or decrease the transmission rate. The adjustable φ independently controls the degree of influence of the two fields on data transmission rate and local channel connection window where 0 ≤ φ ≤ 1.

Building the routing algorithm
The present section describes our algorithm implementation in detail. In the proposed algorithm, the packets from a particular node are routed to a predetermined sink through intermediate forwarding nodes. The node first checks the table of surrounding nodes and then calculates gradient fields in response to each neighbor (except for the children and the node forwarding the packet to the current node) using Equation 7, and the node selects the neighbor with lower gradient field as the next destination. After identifying the receiver node, data transmission rate will be determined according to the buffer occupancy and congestion degree.
To achieve these goals, we need the state information from neighbor nodes, such as depth and traffic loading information (queue length, congestion degree, and cumulative queue length), to construct the gradient field. The nodes' hop counts to sink and traffic information interchange between sensor nodes through APs. Each node, including sinks, periodically broadcasts an AP to all neighbors. We take for granted that all nodes in the network are homogeneous and have the same buffer size, thus the proposed algorithm can find the traffic loading information. At the beginning, the depth of the sink is set to 0. The sink sends the AP containing hop count, and then the nodes one hop away from the specific sink calculate their own depth by adding 1 to the depth value in the AP packet. And so, other nodes also obtain their own depth by receiving AP message from their neighbors, which already have a depth in the same path as the nodes one hop away. The proposed algorithm will recalculate the depth when it detects the topological changes. The most uncomplicated manner is to add 1 to the minimum effective depth value remaining in the routing table.
Each node by itself builds the depth and traffic cost fields, respectively, on the routing table T for all neighbors, in response to the specific sink and initializes all fields. Table T stores network information from all surrounding nodes to the local node, including hop-count, one-hop normalized buffer size, congestion degree, and cumulative queue length, respectively.
The excessive update messages will introduce overhead. To exchange messages among direct neighbors and retain this overhead, we design a signaling and some auxiliary mechanisms. Generally, the depth field is quite stable and can be updated in a long-term fashion; the traffic loading field varies just when there is traffic passing by, so it can be updated in a triggered fashion. In our implementation, to keep the pace of updating, we define a maximum updating interval (MUI) and a least updating interval (LUI) between two successive update messages. The update messages should be delivered between a LUI and a MUI since the last one. The LUI prevents sending too many update messages, and the MUI is used to keep the connectivity of the network. If there are more than two MUIs since receiving the last message from a neighbor, this neighbor is considered dead, and proposed method will recalculate the local depth and the routing table. If the elapsed time since sending the last update message exceeds an MIT, the node will send a new one now immediately, whether the depth or the queue length have changed or not. This is invariably employed to maintain the depth utilization field and preserve the connectivity of the network since MIT is a relatively long time. When the depth of a node has changed or the traffic loading variation reaches a predefined threshold, and the elapsed time also exceeds an LIT after the last successful update message, the node will also send a new one.
In summary, it can be said that the proposed algorithm can efficiently reduce the overhead, if placing a large MIT and updating the queue length field in a triggered fashion. Additionally, our algorithm has just exchanged routing messages with its direct neighbors, which further decreases the cost.

Performance evaluation
To assess the performance of the proposed algorithm, we simulate four congestion control schemes, including the shortest path first (SPF) method (a standard protocol for shortest path routing) and more sophisticated algorithms designed for large scale sensor network such as CODA [10], ESRT [11], and GRATA [16] in terms of packet loss  ratio, energy consumption, and end-to-end packet delay using the NS2 simulator. In addition, the influence of various values of traffic factors and data transmission rate are also considered.
The simulation parameters are set as follows: 100 homogeneous sensor nodes (including source nodes and sink nodes) are randomly distributed in a square region of 100 × 100 m with three sinks inside the coverage area. The nodes' communication radius is 20 m, which is considered an effective coverage area for sensor nodes. The transmission rate is 250 kbps in scenarios of constant bit rate traffic and burst traffic. The range of channel contention window size is [1,63]. The total buffer size is 20 data packets. The size of every packet is 50 Bytes. The IEEE 802.15.4 standard is used at the MAC and physical layers. Each node maintains traffic information of its neighbors by APs periodically and uses proposed algorithm to forward packets over optimal paths toward one of the sinks. Through several simulation rounds under high traffic condition, the weighted factors are α 1 = 0.7, α 2 = 0.2, α 3 = 0.1, and φ = 0.7.
We set β = 1.5. With the choice of V d (n) = n i , one finds the upper and lower bounds of β are 2 and 1, respectively. A systematic analysis of the effects of β on the system behavior is not trivial. However, we could use simulation to see the effect of β. It is seen that when β varies between 1.3 and 1.7, the system results are better. This is because the proposed algorithm with sufficient weighting factor value could change the routing to distribute traffic load.
The simulation results are compared with the SPF routing algorithm, CODA, ESRT, and GRATA to show the improvement in network performance with varied traffic rates. Figure 1 depicts packet loss ratios (with respect to time) associated with the five congestion control schemes. The x-axis denotes the various values of packet inter arrival times, while the y-axis denotes the packet loss ratio of the algorithms. The graph indicates that the proposed scheme outperforms the others due to its ability to predict network conditions at the next hops in order to preempt potential congestions. In other words, the proposed algorithm has the capability to route packets around the congested area. In this scenario, traffic is generated following the exponential distribution with mean outcome set from = 0.2 to 0.8 s to show the various packet inter arrival times for packets based on the Poisson distribution. Table 1 denotes that our scheme significantly achieves the lower packet loss ratio compared to SPF, CODA, ESRT, and GRATA. This is because the hops' information utilization scheme attempts to prevent forwarding packets to the next neighbors with high number of packets in the buffer and balanced network traffic as much as possible.

Packet loss ratio
As shown in Table 1 for all methods, when the inter arrival time of packets is high, then the packet loss ratio will be low. This is because all algorithms are using the shortest path method to route packets, therefore, there is not a remarkable difference between various methods. However, when the inter arrival time of packets reduces, or in other words when the number of interval packets increases, the proposed method outperforms the other methods. The reason for our algorithm superiority is its ability to better predict network congestion landscape  and adjust the data transmission rate in high traffic situations.

Energy consumption
In this subsection, we evaluate the medium energy consumption per bit, which is required to transmit a packet to the sink successfully, i.e., the proportion between the total taken energy at all nodes to send or transmit all packets and total bits in data packets which are received at the sink. The energy use is involved in communicating and receiving all packet types including data, ACK, and AP. To judge the energy use of goods and services, we apply the same energy model as in [31], in which the packet transmission energy consumption is set to 50 NJ/bit*k + 100 PJ/bit/m 2 *k*d2 and the packet reception energy is 50 NJ/bit*k, where k is packet length and d is transmitted distance with respect to each packet. The initial energy for each node is set to 1 J. Figure 2 considers the average energy consumption per bit over five routing schemes with various values of packet inter arrival times.
As shown in Table 2, the proposed method consumes less energy than other methods. This difference is significant, because our method can reroute the paths and pass them from non-congested area. Furthermore, our scheme can adjust the packet transmission rate. Figure 3 compares the average end-to-end packet delay through three sinks between the proposed algorithm with SPF, CODA, ESRT, and GRATA, respectively. For readability, the results are represented as the average end-to-end delay of all nodes with six cases of packet inter arrival times in the range of 0.2 to 08 s.
From the graphs, we can conclude that the proposed routing scheme makes a smaller packet delay in comparison with other schemes, especially when data transmission rate is high. This is because the proposed gradient-based scheme attempts to prevent forwarding packets to next neighbors with high number of packets in the buffer and balance network traffic as much as possible and adjust data transmission rate between two nodes. In particular, SPF has the highest end-to-end delay compared to other schemes. This causes a large amount of delay and energy consumption due to a lot of packets which are forwarded by the same nodes on the shortest paths. On the other hand, GRATA tries to reduce the packet delay by utilizing the number of hops and the expected packet delay at one-hop neighbor. However, the routing scheme based on only one-hop information can suffer from a lack of information about the possible congested areas. As it could be seen in the graphs, the end-to-end delay achieved by GRATA becomes worse than the proposed scheme considerably when the network traffic increases. This is because the new method uses the traffic information to scatter the packets and adjust the data transmission rate (Table 3).

Efficient of weighted factors on network performance
The buffer thresholds decide the weighted factors α 1 , α 2 , and α 3 for limiting the number of candidates participating the contest. The technique thus reduces the computation resource at sensor nodes. Nevertheless, this parameter is influenced by experimental trials; it is difficult to guarantee an optimal effect on network operation. In this subdivision, we look at the impact of weighted factors on the packet delivery ratio under several traffic conditions. It should be noted that in our scheme, one-hop queue length is considered to be a more important factor than congestion degree and cumulative queue length. Thus, α 1 is always greater than or equal to the total of α 2 and α 3 in simulation settings.
At first, the influence of α 1 (queue length field) is illustrated in Figure 4 under traffic sending rate = 0.5 s through a range of α 1 , whereas other traffic measurement factors are 0 (α 2 = α 3 = 0). We also show the SPF methods' packet delivery ratio in this figure. With a small α 1 , it is difficult to obtain a high buffer threshold at parent nodes and our method will perform similar to SPF method. On the other hand, a very large α 1 indicates that the incoming packet is prevented from using the shortest path even though the current buffer at parent node is still small. This increases the packet end-to-end delay without improving the packet delivery ratio. Figure 4 shows that the high performance of our proposed system is approximately obtained at α 1 = 0.7 (Table 4). We infer that the influence of choosing factors depends on the current traffic condition in the network and forecasts the forwarding traffic with the congestion degree and the cumulative queue length. Now, we evaluate the influence of α 2 , α 3 on the network performance, as illustrated in Figure 5. The traffic rate at each source is = 0.5 s. We consider α 2 = 0.2 and α 4 = 0.1 and compare these new values with the previous experiment results. In instances of high traffic load, a remarkably higher value of all traffic information factors gets involved in routing decisions. The trade-off between onehop and other traffic information (congestion degree and cumulative queue length) needs to be considered. Nevertheless, it is hard to see an optimal α ratio because it depends strictly on current traffic status. Thus, a strategy founded on network traffic experience that dynamically estimates this ratio after each point of time could be a base of comparative study in future works. It can be seen that on average, when α 1 = 0.7, α 2 = 0.2, and α 3 = 0.1, the packet delivery ratio will be over 0.82. Nevertheless, in general, in low traffic networks, small traffic factors reduce the issue of traffic information along the utilization field, as shown by Equation 7. Routing operation then works in the same way as the shortest path routing. On the other hand, in congested networks, larger values of traffic factors enhance the dynamic traffic property in choosing the next forwarder (Table 5). Figure 6 shows the influence of rate adjusting strategy to average end-to-end delay with different packet enter arrival time. α, β variables in all experiments are similar. The graph indicates that congestion control with data transmission rate outperforms the others due to its ability to decrease or increase data transmission rate in congested or non congested places. Clearly, with considering the data transmission rate factor in all experiments, energy consumption, and average end-to-end delay will also improve (Table 6).

Conclusions
In this paper, we proposed a hop-by-hop gradient-based routing scheme to evenly distribute traffic in WSNs with non-equivalent sink. The key concept herein is to utilize the number of hops and the current traffic loading of neighbors to make routing decisions. The proposed scheme Table 4 Packet delivery ratio with = 0. 5     reduces the number of packet retransmissions and packets dropped by preventing nodes with overloaded buffers from joining in routing calculation. Simulation results indicate that our proposed scheme improves network performance such as end-to-end packet delay, packet delivery ratio, and average energy consumption in comparison to other routing schemes including SPF, CODA, ESRT, and GRATA. To address practical concerns, the proposed routing algorithm can be easily implemented on existing devices without major changes. The limitation of the new method is that the values of traffic factors (α, β, and φ) are chosen based on simulation experiments. Moreover, overhead is a common drawback of proposed algorithms. The proposed scheme needs information about the number of hops and queue information supported from AP. Therefore, a part of network resource is used for sending/receiving this kind of broadcast information. In future work, therefore, we plan to build an analytical model to find the optimal value for these weighted factors.
Moreover, some WSNs are application oriented, and different applications have different requirements. To conform to this diversity, an open framework is needed to consider other factors as well. We suggest that a general framework could be extended to optimize various other metrics through constructing other utilization fields and introducing additional mechanisms for performance enhancement. For example, we can extend our method to support priority-based applications simultaneously through introducing an enhanced mechanism. The packets from different applications can be assigned to different weights carried in the packet header and in the queue. The packet with light weight is well cached with the idle nodes, and higher priority packet with heavy weight travels along shorter paths to approach the sink as soon as possible. These may be possible subjects of future work in this direction.