SiMple: A Unified Single and Multi-Path Routing Algorithm for Wireless Sensor Networks With Source Location Privacy

Wireless Sensor Networks (WSNs) experience two different patterns of traffic with different requirements: 1) Event-driven traffic from sensor nodes to the base-station (BS) in the form of single-path uni-cast packets, and 2) Query-driven traffic from BS to sensors that better matches multi-casting and generates multi-path traffic. In this paper, we propose SiMple, a unified algorithm to jointly route single- and multi-path packets in WSNs. SiMple establishes a square destination area to control the degree of path multiplicity as well as the number of intermediate nodes between the source and destination nodes. When performing single-path routing, SiMple considers the direct line connecting source and destination nodes to select the closest sensor node to the line as the next carrier of the packet. Otherwise, SiMple directs packets towards the destination node(s) by exploiting multiple disjoint routes where the number of disjoint routes is controlled by the source node. In addition, SiMple introduces virtual source nodes to hide the location of the real source node, which is needed in asset monitoring applications. The conducted extensive NS-2 simulation experiments for mixed single- and multi-path packets confirm that SiMple results in a higher performance level and consumes lower energy when compared to the case of using two separate algorithms to individually route event and query packets.


I. INTRODUCTION
A Wireless sensor Networks (WSN) consists of a large number of tiny and inexpensive sensing devices, called sensor nodes, interconnected through wireless links to perform distributed sensing tasks [1], [2]. These networks have been deployed in many applications, e.g., environmental monitoring [3], real-time target tracking [4], structural monitoring [5], health-care [6] and so on. In most applications, sensor nodes are randomly distributed over the target area to collect information about a desired phenomenon, e.g., physical or environmental conditions. In order to cooperatively monitor a desired phenomenon, the main task of sensor nodes is to sense that phenomenon and transmit their measurements to a data collection node called the Base Station (BS).
A routing algorithm, which is used to construct a path between sensor nodes and the BS or vice versa, has a remarkable effect on the energy and performance efficiency The associate editor coordinating the review of this manuscript and approving it for publication was Mahdi Zareei . of WSNs. Due to the restrictions on hardware and the limited energy of sensor nodes, complicated and energy-hungry routing algorithms cannot be used in WSNs. Also, routing algorithms should provide a level of failure tolerance to combat the hostility of the environment where sensor nodes are distributed in.
Routing algorithms can be classified into single-path and multi-path routing algorithms [7]. Single-path routing algorithms establish a unique path between a source and its associated destination node, whereas in multi-path routing algorithms, several paths are established between the source and the destination nodes. Although, single-path algorithms provide better energy efficiency as compared to multi-path ones, any failures on the relaying nodes along the established path break the path and lead to packet loss. As such, the use of multi-path routings increases the availability, resilience and the reliability of the network [8].
The merits and demerits aside, the suitability of singleand multi-path routings can be largely case-specific; for instance, in event-driven scenarios, every single event is sensed by multiple sensor nodes and is concurrently reported to the BS. In such cases, single-path routings are more efficient as multi-path routings result in a surge of redundant messages leading to network congestion, energy inefficiency, and increase in network delay [9]. As opposed to event-driven communications, in query-driven scenarios where the BS injects queries into the network, multi-path routings seem to be more efficient [10] as query packets are to be delivered to all sensor nodes located in a specific region of the network.
To the best of our knowledge, existing routing algorithms do not support both types of aforementioned traffic patterns (event and query-driven) in a single unified protocol. As such, the support for each traffic pattern needs to be implemented separately by a specific routing algorithm, which can be demanding on the processing and memory resources of tiny sensor nodes.
To address the above mentioned needs of WSNs, we propose a novel routing framework that is customizable to perform both single-and multi-path routings, named SiMple. In SiMple, before a source node (sensors or BS) initiates a particular traffic type (event or query), it forms a logical relaying substrate that starts from the source and terminates at the destination. The messages will be relayed over this substrate. The substrate formation can be controlled by varying a parameter called Destination Area Radius (DAR) which will result in supporting various degrees of path multiplicity. If we set DAR = 0, the relaying substrate is reduced into a simple line connecting the source and destination. Accordingly, the relay nodes along the path will be chosen by an algorithm so that they are closest to this preconceived line. On the other hand, for multi-path traffic, we set DAR > 0 that will form a square area around the destination, and accordingly, the relaying substrate turns into a pyramid containing multiple disjoint paths towards the destination area. Additionally, SiMple considers hiding the real source node of a message by defining virtual source nodes that are placed some hops away from the real source node. This is highly required in asset monitoring applications [11], [12] in which sensor nodes are used to monitor some valuable assets. When a sensor node detects the presence of the asset, it should send a report to the BS using an event-driven traffic pattern without letting adversaries detect the location of the asset. Adversaries may detect the asset location by eavesdropping the network communication and applying traffic analysis techniques to infer the location of the event source.
The contributions of this work can be summarized as follows.
• To the best of our knowledge, SiMple is the first work to propose a unified routing algorithm that supports both single and multi-path routing simultaneously for both types of event and query-driven traffic.
• The proposed routing algorithm is able to introduce a number of virtual source nodes to hide the real source node in situations where the network needs to protect its sensing nodes against traffic analysis attacks. This is a very simple, yet efficient mechanism that helps the network in dealing with traffic analysis attacks.
• The proposed algorithms for constructing the relaying substrate and node selection are particularly lightweight and most suitable for deployment in tiny WSNs with restricted computational and energy resources.
• We have derived a probabilistic model for successful packet delivery ratio by considering the interplay between the proposed DAR parameter, the number of sensor nodes in the field, the field area as well as the coverage range of the sensor nodes.
• Extensive NS-2 experiments are conducted to evaluate the proposed routing framework under various operational conditions. Our simulations also contain comparative experiments against existing related work. The results corroborate our intuition, and showcase the efficiency of our proposed unified routing in WSNs.
The rest of this paper is organized as follow. In Section II, we give an overview on the literature of routing algorithms for WSNs. Section III describes our algorithm and explains how it supports both event and query packets. Sections IV gives an analytical discussion on the proposed routing algorithm. Evaluations of the proposed algorithm using extensive NS-2 simulations are presented in Sections V. Finally, we conclude the paper in Section VI.

II. RELATED WORK
As shown in Figure 1, four different communication models can be considered in WSNs. The models can be used for routing of event and query packets in either uni-cast or multi-cast fashions. Based on these models, data redundancy is a common issue affecting the implementations of WSNs, wasting the network resources and imposing energy and performance overhead on the network. Therefore, researchers have tried to mitigate the adverse effects caused by data redundancy in WSNs.
In [13], an algorithm has been proposed in which the intermediate nodes are capable of eliminating redundant packets/ reports on their way from the sensor nodes toward the BS. Redundant reports are identified and eliminated based on the arrival time of the packets. The authors in [14] have proposed an algorithm to aggregate and forward packets toward the BS. The algorithm controls routing delay according to the amount of currently accumulated data in every sensor node. This method assumes i) sensor nodes periodically generate sensing data and relay the sensed data to the BS node, ii) arrival rate of nodes differs based on their location in the network and iii) each node individually aggregates received packets and transfers toward the BS. This method plays with the delay imposed on incoming packets by controlling the degree of aggregation. The dynamic routing algorithm [15] is designed based on two potential fields: depth potential field which guarantees packets reaching the base-station and queue potential field which makes packets more spatially convergent. As this method uses local information to make decision about routing parameters, its major challenge it how to fully interpret the local information with low/no delay overhead on packet routing. An event-driven routing algorithm has been proposed in [16] which divides the network to couple of cells and assigns at least one virtual coordinate to each sensor node. It aggregates redundant data in each cell and then transfers aggregated data toward the BS. As the data aggregation of this method also relies on the network clusters, the network re-clustering should be done more frequently.
The proposed method in [17] selects routing paths from source nodes to the BS based on the link quality, residual energy, distances to the base, and average network delay. This method imposes extra re-routing overhead in case of path failure. In [18], the source node establishes an association with the BS via a session initiation packet before transmitting the data packets. The session initiation packet informs the BS about the number of flows originating from the node, the type of the data flow, and the transmission rate. The proposed algorithm in [19], operates based on time multiplexing, but it changes the length of time frames according to the number of source nodes. In [20], a sleep/wake-up mechanism has been proposed to improve the network energy efficiency. Obviously, it transmits more coordination packets in the network during routing path establishment. The proposed multi-hop routing algorithm in [21], selects the next hop based on the residual energy, the nodes' available buffer size, and signal-to-noise ratio. Authors in [22] proposed a real-time power-aware routing protocol by dynamically adapting the transmission power and routing decisions. The proposed algorithm in [23] (referred to as ER-SR algorithm) performs some computations at the source node to find a path with high residual energy. Although, this method prolongs the network lifetime, its high computational demand for finding the optimal path can be counterproductive.
The authors in [24] proposed a distributed query engine for WSNs that allows sensor nodes to execute and filter out redundant queries. In the algorithm proposed in [25], the source node (here the BS) propagates data packets across the network and the nodes interested in the data packet may send a request to the advertising node. In directed diffusion routing algorithm [26], the BS floods the query packet to announce attributes of the required data. The source nodes located in the targeted region respond with the data which are then routed along the reverse links. A data-centric and query-driven routing algorithm [27] propagates unresolved queries within the network while resolved queries are recognized and eliminated by sensor nodes.
In order to reduce the hardware and storage requirements of query-driven routings, some researchers tried to avoid reserving routes from the BS to the sensor nodes. The algorithm proposed in [28] distributes queries to sensor nodes by passing data at a relatively slow speed. In case of any data loss, the sensor nodes are allowed to quickly fetch missing segments from their neighbor nodes. A multi-hop routing algorithm from the BS to multiple sensor nodes based on collision avoidance has been proposed in [29]. It searches disjoint paths for multiple sensor nodes. An algorithm based on end-to-end loss has been proposed in [30]. In this algorithm, the BS detects packet losses and requests end-to-end re-transmissions, but the sensor nodes need a huge memory to save their transmission history. In addition, there is high possibility of node failure. Therefore, ACK-based algorithms are not good solutions. In [31], when a node injects a query packet within the network, the neighboring nodes divide the query into smaller components and propagates it within the network until it is completely resolved. Then, the full response is routed back to its issuing node.
While many of the challenges associated with routing in WSNs have been addressed by several researches over the years, to the best of our knowledge, there is no unified scheme for supporting both query-and event-driven traffic types at the same time. Unlike previous works, in our proposed approach, the multiplicity of paths as well as the number of destination nodes (uni-cast vs. multi-cast) can be flexibly chosen by the source of the packet which improves both network delay and energy consumption.

III. THE PROPOSED SIMPLE ROUTING
In this section, we describe the proposed Single and Multi-path (SiMple hereafter) routing algorithm. In order for our SiMple routing algorithm to be applicable, we envision a WSN satisfying the following standard assumptions: • There is a single stationary BS in the network area [32]. • There are a total of M stationary sensor nodes in the network which are randomly distributed over the area [32].
• Sensor nodes are aware of their position within the network which is specified as (x, y) coordinates. Also, every sensor node knows the coordinates of its one-hop neighbour nodes [33].
• The decision on the number of destination node(s) (uni-cast/multi-cast) as well as the path multiplicity (single/multi-path) is determined by the source node.
To establish the paths, the proposed routing algorithm considers an imaginary line connecting the source and destinations nodes. The source node is responsible for determining the degree of multi-path routing and whether the packet is to be disseminated in a multi-or uni-cast style by adjusting a Destination Area Radius, DAR, parameter. The destination area is envisaged as a rectangular area where the destination node is located at the center of this area. In the proposed algorithm, DAR = 0 specifies single-path routing and DAR > 0 specifies multi-path routing. When a source node decides on the value of DAR, it conceives a logical area around the destination node.
More specifically, let the positions of the source and destination nodes be (x s , y s ) and (x d , y d ), respectively. The coordinates of the four corners of the destination area are calculated by Equations (1) to (4): where L, R, B, T stand for left, right, below, and top respectively. The source node also specifies the type of forwarding: multi-or uni-cast packet forwarding. The packets injected into the network in a multi-cast manner need to be delivered to all sensor nodes within the destination area. On the other hand, uni-cast packets will be delivered only to their destination nodes (at the center of the destination area). Both the path multiplicity and casting multiplicity of the packet are set by source node. Armed with this information, the SiMple algorithm undertakes the routing procedure as explained in sections III-A & III-B.

A. SINGLE-PATH ROUTING
In the SiMple routing algorithm, setting DAR = 0 leads to single-path routing from a source node to a destination node. In this case, (4)). For single-path routing, the first sensor node calculates the straight line slope, LS, connecting the source and the destination node, as Equation (5).
The intermediate sensor nodes are chosen based on their adjacency to the straight line connecting the source and destination nodes. To do this, an intermediate sensor node (the same procedure is also done in the source node) chooses the one-hop neighbor among those having the same direction with the straight line and has the minimum slope deviation with the straight line. Equation (6) helps the intermediate node to find the one-hop neighbors along the same direction and Equation (7) calculates the deviation of its i − th one-hop neighbor from the straight line.
where N is the number of one-hop neighbors. Next, the intermediate sensor node forwards the packet to sensor node j that satisfies Equation (8): As shown in Figure 2, in the i − th step, the algorithm searches among α i_1 to α i_N and selects the node with minimal deviation. The source node specifies the type of packet VOLUME 8, 2020 (i.e., uni-or multi-casting packet) by determining MBU (which stands for Multi-cast/Broad-cast/Uni-cast) parameter within the header of packets. This parameter determines the radius (number of hops) that eventually the destination will be considered to flood a packet to its neighbours within the destination area. MBU = 0 and MBU = 2 respectively perform uni-casting and two-hop flooding to the destination node. If the multi-path packet is of a multi-cast type, MBU is set to − 1 to indicate that the packet must be delivered to all nodes within the destination area.

B. MULTI-PATH ROUTING
When DAR > 0, SiMple acts as follows: as before, the coordinates of the destination area is calculated based on Equations (1) to (4). In multi-path routing, more than one intermediate node participates in packet forwarding to deliver the packet to the desalination area. The intermediate nodes form one or two triangular shaped area(s) which are named as intermediate areas. As shown in Figure 3, the number of triangles formed in intermediate area depends on the position of the source node with respect to destination area. For the sample destination area shown in Figure 3, if the source node is located in either of regions R1, R3, R5 or R7, the intermediate area would be a single triangle. Otherwise, the intermediate area would consist of two triangles. Packets are delivered to destination area by passing through the intermediate area.
If a packet is supposed to be a uni-cast packet (as shown in Figure 1b and 1d), it must be delivered to a destination node at the center of the destination area. On the other hand, for a multi-cast packet (cases shown in Figure 1a and 1c), it has to be delivered to all the sensor nodes within the destination area. However, the procedure followed by the SiMple algorithm is identical in the case of both uni-cast and multi-cast packets. The SiMple algorithm forwards the packets towards the destination area using intermediate sensor nodes that are located in the intermediate area.
To do this, the source node for

C. SOURCE NODE HIDING
The proposed routing algorithm can hide the real source node of a message, a feature that is much needed in asset monitoring applications, e.g. [11]. This is achieved by defining virtual source nodes that are placed some hops away from the real source node. As shown in Algorithm 2, N s virtual sources are allowed to forward the packet in exactly the same manner that helps to hide the real source node. The parameter N s can be set during the network setup or it may be determined in runtime based on the security requirements of the network. In Section V, we investigate the impacts of changing the parameter N s on the number of received packets, network energy consumption, and network delay.

IV. ANALYTICAL DISCUSSION
The packet delivery ratio of the SiMple algorithm in both single-and multi-path cases depends on the DAR parameter. A higher DAR leads to an increase in the degree of multi-path routing. Assuming a random-uniform node distribution, in this section, we derive an analytical formula for the packet delivery probability under SiMple. Based on Figure 3, eight regions, R 1 to R 8 , are built around the destination area. Suppose that the source node's location is given. Let IA denote the area size for the intermediate region. We may compute IA based on Equation (9): Assuming the success ratio of z = IA A N where A N is the network area, the probability of having k sensor nodes within the intermediate area, P(k ∈ IA) follows the binomial distribution and is given by Equation (10) where M is the number of sensor nodes within the whole network. Among all nodes in the radio coverage of a given sensor node, some of them might be in the intermediate area and some might not. Figure 4 shows different situations for the radio coverage range of a sensor node within intermediate area. For our calculations, we need to consider that part of the radio coverage which is overlapping to the intermediate area. This area which is called coverage range, S c , for a given sensor node can be calculated by Algorithm 3. With the success ratio shown in Equation (11), we can use Equation (12) to calculate the probability of having r sensor nodes in the coverage range and Equation (13) gives the expected number of sensor nodes within the area:  where S c is the coverage range of the activated sensor node and is determined according to the regional configuration depicted in Figure 3. Hence, on average, E(R) packets are sent towards the intermediate area along E[R] disjoint routes by the activated sensor node. Based on Figure 4, packet forwarding in the intermediate area expands the coverage range of the sensor nodes. This phenomenon in turn increases the degree of multi-path routing when the packet approaches to the destination node. Since the degree of multi-path routing may differ in each intermediate hop, we will use the mean degree of multi-path routing given by Equation (14): From the reliability point of view, the degree of multi-path routing has a direct impact on packet delivery ratio. Equation (15) gives the probability of having a total of q packets successfully received at BS. (15) where LER (Link Error Rate) is the probability of error occurrence in communication links. To see how the probability of packet delivery is influenced by the number of sensor nodes in the intermediate area, we plot the probability of packet delivery using Equation (15).  Figure 6 and Equation (13)). On the other hand, Equation (10) , y a ). Coordinates of the triangular intermediate area denoted by {(x s , y s

P[q successful packet receive]
i ← number of intersection points between an intermediate triangle side and a circle with the center of (x a , y a ) and radius of sensor's radio range; 4 end 5 switch (i) do 6 case i==0 7 x g1 ← direct movement toward line g as much as t r ; 8 y g1 ← y a ; 9 case i== 10 Activated node position (see Figure 3): 11 R1 or R5 or R6 or R8 then 12 x g1 ← x a ; 13 y g1 ← direct movement toward line g as much as t r ; 14 R2 or R3 or R4 or R7 then 15 x g1 ← direct movement toward line g as much as t r ; 16 y g1 ← y a ; 17 case i==2 18 Select one intersection between activated node and destination node as (x g1 , y g1 ); 19 endsw 20 Make a triangle among the activated sensor node and two intersection points (x 11 , y 11 ) and (x 21 , y 21 ) by {A, B, C} sides; 21 Coverage range node a ← θ ×t 2 r 2 ; of disjoint routes in Equation (12) and this phenomenon decreases the packet delivery ratio as Equation (15). Thus according to Figure 5, increasing the number of sensor nodes in the intermediate area and and higher DAR values decreases the packet delivery ratio.

V. EXPERIMENTAL RESULTS
In this section, we evaluate the performance of the proposed routing algorithm using NS-2.35 simulator. As shown in Table 1, we have conducted the simulations in a 200 × 200 m 2 area hosting n = 100, n = 200 sensor nodes. Every sensor node consumes e rx and e tx amount of energy to receive and forward one bit of data respectively [36]. The sensor nodes have been randomly distributed in the terrain with a fixed BS located at the center of the terrain. Also, we need the 33824 VOLUME 8, 2020   sensor nodes to be aware of their 2-dimensional position in the environment. Our wide ranged experimental evaluations are organized as follow. In Section V-A we study impacts of DAR parameter on the network, while in Section V-B, we compare the proposed algorithm against existing method in the literature.

A. DISCUSSIONS
In the first experiment, we investigate the effect of DAR parameter on the percentage of correctly reported events i.e., event delivery ratio to BS. In this experiment, we used DAR = 0, 5, 10, 15, 20 for various packets generation rates. Figure 7a shows the delivery ratio versus the packets generation rate in both single-(when DAR = 0) and multi-path (when DAR > 0) routing cases. As it can be seen in this figure, choosing higher DARs significantly improves the packet delivery chance. We also see in the figure that in all cases, when the packet generation rate grows, the packet delivery ratio drops which is a natural behavior of the network due to the increasing congestion. Figure 7b shows the standard deviation of the energy consumption across the sensor nodes with and without the proposed algorithm. Here, we can see how the proposed routing algorithm results in a better energy distribution when higher DARs are chosen. Routing over single path from a source node to a destination node utilizes a specific path among a group of intermediate nodes. We note that the number of repetitive nodes among single paths is less than that of a multi-path routing. This way, the energy usage will be more evenly distributed across the sensor nodes.
To investigate how the proposed multi-path algorithm helps the network, we counted the number of required single paths (when DAR = 0) to achieve the same delivery ratio (when DAR > 0). The associated results are plotted in Figure 8 and it can be seen that the proposed algorithm saves a large number of paths. For example, to have delivery ratio of 80% when the packet generation rate is 10 events/sec, the event should be sensed and reported by at least 50 sensor nodes which seems impossible. Using our algorithm, the network consumes energy in a balanced manner. However, in multi-path routing, the number of activated nodes is more than when routing is performed across a single path. This increases the standard deviation of the remaining energy of the sensor nodes in the case of single path routing.
In Figure 9, we plot the delay and and energy overheads imposed on the network when (DAR > 0). Increasing the DAR parameter has led to increase in both network delay and energy consumption. This is obviously the cost that we have to pay when high delivery ratios are needed.
We can establish several single paths from the source node to the destination node instead of multi-path routing, i.e., our SiMple algorithm selects several source nodes and makes a specific route from each source node to the destination node. However, the number of source nodes depends on our expected delivery ratio. Figure 8 shows the number of established single paths versus packet generation rate by 20, 40, 60 and 80 percent of the delivery ratio. This figure shows to achieve high delivery ratio, a higher number of source nodes have to make a single path toward the destination node. This approach needs a network with very high density and imposes higher overhead on the network performance. However, SiMple with appropriate DAR for multi-path routing can realize high delivery ratio. In the next experiment, we compare the network delay, network energy consumption, and delivery ratio when BS initiates a query packet to be delivered to 1 to 10 sensor nodes. As can be seen in Figure 10a, performing multi-casting by the use of the proposed algorithm consumes a fixed amount of energy regardless of the number of destination sensor nodes. However, when multi-casting is done by uni-casting, i.e., DAR = 0, our results show a linear energy growth. If multi-casting for at least 5 destination nodes is desired, it is more efficient to do so using the proposed algorithm with 1 ≤ DAR ≤ 15 regardless of the delivery ratio that is needed. For a lower number of destination nodes in the multi-cast operation, we can choose between DAR = 0 or DAR > 0 based on the target delivery ratio.  We see the same trade-off for network delay in Figure 10b. Here again, we see that the network delay increases as the number of the destination nodes in the multi-cast group grows larger. In this experiment, we have 5% multi-cast packets and 95% normal packets. Figure 10c shows the packet delivery ratio in both singleand multi-path routing. Based on this figure, multi-path routing has a higher packet delivery ratio compared to single-path routing. In our algorithm, a source node directs its packets towards a destination node along a unique route. As the number of destination nodes as well as the disjoint routes increases, there would be a sudden increase in the traffic of intermediate nodes as well as an increase in packet loss probability. However, in multi-path routing by the proposed algorithm, the source node engages all the sensor nodes within the destination area in the packet delivery process. Therefore, based on Figure 10c, an increase in number of destination nodes leads to an increase in packet loss probability.
In the next experiment, we implemented the idea of virtual source nodes, useful for hiding the source node in asset monitoring applications, to investigate its performance/energy overheads versus the network delivery ratio. The experiment is repeated with 1, 2, 4, and 6 virtual source nodes (parameter VS in plots of Figure 11 represents the number of virtual source nodes). Based on the fact that having virtual source node(s) farther from the real source node improves the network security against traffic analysis attacks, we have defined another parameter that reflects the distance of the virtual source node(s) from the real one (D in the plots). By setting the distance, D to be 1, 2, and 4, we pick virtual nodes that are 1, 2, and 4 hops away from the real source node. Results of this experiment are shown in figures 11a to 11c. We see that by increasing the number of virtual source nodes, the network consumes more energy and loses its performance which are in fact the expenses to be paid for the purpose of securing the network.

B. COMPARISONS
We have compared the performance of our proposed algorithm with the previously proposed algorithms: RDAG [14], DASDR [15] and ER-SR [23]. To do this, we have implemented these algorithms in the same simulation environment, and have applied the same simulation setup to have a fair comparison. In ER-SR algorithm, the source routing nodes establish routing paths from each sensor node to BS. Figure 12 shows the network end-to-end delay as a function of event occurrence rate. As can be seen, in all simulated algorithms, the higher event occurrence rate imposes higher congestion in the network and through that higher delay. In some cases, the congestion may prevent reporting an event to BS. The results are reported in Table 2 where the average and variance of the event miss ratio for the three algorithms are shown. The miss ratio is defined as the percentage of events that have been not reported to BS at all.
In the last experiment, we study the behaviour of the SiMple algorithm when various percentages of query packets are traversing through the network. We generate joint even/query traffic in the network starting from (1% query, 99% event) to (20% query, 80% event) scenarios to explore all possible working conditions. In this experiment, the SiMple routing algorithm takes care of both traffic types. To make comparison possible, we have augmented the operation of DASDR, RDAG and ER-SR algorithms with a gossiping procedure which enables them to handle both event and query packets.   . Impacts of having virtual sources on (a) the network delay, (b) packet delivery ratio, and (c) the network energy consumption. In all plots VS refers to the number of virtual source nodes and D is the distance in hops between the virtual source node(s) and the real one.
The gossiping procedure works by broadcasting each data packet to a random number of one-hop neighbors until the destination is reached. We select one-hop neighbors with probability of 0.7 as the receiver of the packet. Figure 13 shows the network end-to-end delay under different regimes of query traffic. Query-driven routing needs a high level of reliability as well as massive data transferring toward destination nodes. Gossiping broadcasts more query packets within the network and it increases the network congestion. Therefore, DASDR and RDAG algorithms report the occurred events toward BS by multi-path routing. . End-to-end delay & delivery ratio vs. the percentage of query driven traffic pattern in the network for Simple, RDAG [14], DASDR [15], and ER-SR [23] algorithms.

FIGURE 14.
Network overhead & the network energy consumption vs. the percentage of query driven traffic pattern in the network for Simple, RDAG [14], DASDR [15], and ER-SR [23] algorithms.
Flooding query-driven traffic and multi-path routing for event-driven traffic increases the network congestion as well as end-to-end delay. This figure showcases the efficiency of SiMple routing algorithm i.e., our algorithm sends fewer multi-path packets while it provides better delivery ratio. This phenomenon avoids redundancy within the network according to Figure 14. Therefore, SiMple controls the network congestion and decreases the network end-to-end delay. By single-path routing of event-driven traffic, the SiMple algorithm incurs less overhead and redundancy. Evidently, the network congestion that is resulted from gossiping mechanism and multi-path routing in DASDR and RDAG algorithms decreases packet delivery ratio and imposes more energy consumption.

VI. CONCLUSION
In this paper, we proposed a routing algorithm for wireless sensor networks to handle both event-driven and query-driven traffic patterns. It supports both single and multi-path routing among sensor nodes. In the proposed routing algorithm, the source node defines either a straight line or a pyramid to forward packets toward its destination(s). If the packet belongs to a single-path uni-cast flow, the imaginary line connecting the source to destination nodes helps to find the closest sensor nodes to deliver the packet as fast as possible. However, in multi-cast or multi-path routings, the formed pyramid is the area that the packet can flexibility move to reach the destination(s). By way of extensive NS-2 simulations, we showed the efficacy of the proposed algorithm in handling both traffic patterns at the same time. Also, we found the trade-off point for the proposed algorithm in which the network can benefit from supporting both types of routing within a unified protocol. Comparison with previously proposed schemes confirms the efficiency of the proposed routing algorithm. As continuation of this work, we are planning to utilize machine learning techniques in the process of selecting intermediate nodes. By reshaping the destination area intelligently, we expect a further improvement in the network traffic distribution; i.e., the destination area can be defined with respect to the current traffic of intermediate nodes.