Cluster Comput DOI 10.1007/s10586-009-0115-x
Self-adapting maximum flow routing for autonomous wireless sensor networks Alessandro Bogliolo · Saverio Delpriori · Emanuele Lattanzi · Andrea Seraghiti
Received: 14 January 2009 / Accepted: 7 December 2009 © Springer Science+Business Media, LLC 2010
Abstract Autonomous wireless sensor networks are subject to power, bandwidth, and resource limitations that can be represented as capacity constraints imposed to their equivalent flow networks. The maximum sustainable workload (i.e., the maximum data flow from the sensor nodes to the collection point which is compatible with the capacity constraints) is the maxflow of the flow network. Although a large number of energy-aware routing algorithms for ad-hoc networks have been proposed, they usually aim at maximizing the lifetime of the network rather than the steady-state sustainability of the workload. Energy harvesting techniques, providing renewable supply to sensor nodes, prompt for a paradigm shift from energy-constrained lifetime optimization to power-constrained workload optimization. This paper presents a self-adapting maximum flow (SAMF) routing strategy which is able to route any sustainable workload while automatically adapting to time-varying operating conditions. The theoretical properties of SAMF routing are formally proved and a simulation model is developed on top of OMNeT++ (http://www.omnetpp.org/) in order to enable simulation-based assessment and design exploration. Simulation results are reported which demonstrate the applicability of the proposed approach.
A. Bogliolo () · S. Delpriori · E. Lattanzi · A. Seraghiti ISTI, University of Urbino, Piazza della Repubblica, 13, 61029 Urbino, Italy e-mail:
[email protected] S. Delpriori e-mail:
[email protected] E. Lattanzi e-mail:
[email protected] A. Seraghiti e-mail:
[email protected]
Keywords Autonomous wireless sensor networks · Maximum flow · Routing · Self-organization 1 Introduction and previous work Sensor nodes are usually designed in order to meet tight constraints in terms of size, cost, and lifetime, which translate into resource constraints imposed to the algorithms running on top of them [28]. The wide range of possible applications and operating environments of wireless sensor networks (WSNs) makes scalability and adaptation essential design goals [7]. Since the main task of any sensor network is to gather data from the environment, the routing algorithm applied to the network is one of the most critical design choices, which has a sizeable impact on power consumption, performance, dependability, scalability, and adaptation. In general there are two phases in the operation of a WSN: dissemination, which is the diffusion of control information to be used to dynamically change the sampling task (namely, the sampling area, the sampled nodes, the sampling rate, . . .) and collection, which is the transmission of sampled data from sensor nodes to one or more collection points [17]. Both of them are deeply affected by the networking solutions adopted. The research efforts devoted to the development of specific routing algorithms for WSNs are documented in many comprehensive surveys [1, 6, 28]. Levis et al. [17] point out the emergence of “networking primitives” in WSNs and discuss the efficiency of a “polite gossip” policy to drive both dissemination and collection with a limited control traffic overhead. Energy efficiency is a primary concern in the design of routing algorithms [19, 27]: If the routing algorithm requires too many control packets, chooses suboptimal routes, or requires too many computation at the
Cluster Comput
nodes, it might end up reducing the lifetime of the network because of the limited energy budget of battery-operated sensor nodes. Three main strategies are usually adopted to maximize network lifetime: using path energy as a routing metric, taking residual energy into account, and exploiting path diversity [5, 23, 24]. Taking a different perspective, lifetime issues can be addressed by means of energy harvesting techniques, which enable the design of autonomous sensor nodes taking their power supply from renewable environmental sources such as sun light and wind [2, 22]. Environmentally-powered systems, however, give rise to additional design challenges due to supply power uncertainty and variability, which prompt for the development of specific dynamic power management (DPM) techniques [13]. In particular, advanced duty cycling strategies can be applied at sensor nodes in order to keep them alive by adapting their power consumption to the environmental changes [25], while energy harvesting aware routing/scheduling algorithm have to be applied at network level in order to guarantee proper operation [12]. Noh et al. have recently proposed a routing algorithm for asynchronous energy-harvesting WSNs (called D-APOLLO) which exploits geographic information to reduce transmission latency under environmental power constraints [20]. D-APOLLO makes use of routing metrics which take into account both the knowledge range [11] and the duty cycle [15, 25] of each node, which are periodically recomputed according to the observed (or estimated) environmental conditions. In general, energy harvesting imposes a paradigm shift from energy-constrained lifetime maximization to powerconstrained workload optimization. In fact, as long as the average workload at each node can be sustained by the average power it takes from the environment, the node can keep working for an unlimited amount of time. In this case rechargeable batteries are used only as energy buffers to compensate for environmental power variations, but their capacity does not affect any longer the lifetime of the network. It has been shown that autonomous wireless sensor networks can be modeled as flow networks [4], and that the maximum energetically sustainable workload (MESW) can be determined by solving an instance of maxflow [8, 16]. The solution of maxflow induces a MESW-optimal randomized routing algorithm that can be actually implemented to maximally exploit the available power. Environmental changes, however, impose to periodically recompute the global optimum and to update the routing tables. A distributed version of maxflow has been recently proposed that can be directly executed on the sensor nodes in order to grant to the network the capability of recomputing its own routing tables for adapting to environmental changes [14]. Adaptation, however, is a complex task which conflicts with the normal
operations of the sensor network, imposing a trade off between adaptation frequency and availability. In general, the adaptation and scalability needs which are typical of WSNs prompt for the application of some sort of self-organization mechanism [7]. This paper presents a self-adapting maxflow (SAMF) routing strategy for autonomous WSNs, which is able to route the maximum sustainable workload under power, bandwidth, and resource constraints, while automatically adapting to time-varying environmental/operating conditions. The paper provides four main contributions. First, it introduces a generalized flow network model to represent autonomous WSNs in such a way that power, bandwidth, and resource constraints can be simultaneously modeled as capacity constraints. Second, it demonstrates the optimality of a self-adapting routing strategy which is able to sustain the maximum feasible workload. Third, it provides a practical implementation of the routing strategy. Fourth, it reports and discusses extensive simulation results to evaluate the applicability and the scalability of the proposed approach. In order to point out the inherent properties of the SAMF algorithm, network simulations are based on ideal channel models and on straight-forward implementations of the algorithm without any heuristic optimization possibly aimed at reducing the protocol overhead. Providing an optimized real-world implementation of the algorithm is out of the scope of this work. Simulation results are compared with two theoretical bounds for routing capability and performance: namely, the maximum sustainable workload (as exactly determined within the framework of generalized flow networks) and the minimum communication latency (as provided by a minimum-path routing algorithm). The rest of the paper is organized as follows: Sect. 2 introduces the network model, which provides a general framework for analyzing workload sustainability under energy, bandwidth and resource constraints; Sect. 3 presents the SAMF routing strategy, demonstrating its theoretical properties and discussing its applicability; Sect. 4 outlines a simulation model, developed on top of OMNeT++, used for validation, design exploration, and sustainability analysis; Sect. 5 presents the results of a large set of Monte Carlo simulation experiments.
2 Network model Autonomous WSNs can be modeled as directed graphs with vertices associated with network nodes and edges associated with direct links among them. Vertices vi and vj are connected by an edge ei,j if and only if there is a wireless connection from node i to node j . Each node (say, v) is annotated with two variables: P (v), which represents the environmental power available at that node, and CPU(v), which
Cluster Comput
represents its computational power expressed as the number of packets that can be processed in a time unit. Similarly, each edge (say, e), is annotated with variable C(e), which represents the capacity (or bandwidth) of the link, and variable E(v, e), which represents the energy required at node v to process (receive or generate) a data packet and to forward it through its outgoing edge e. The maximum number of packets that can be sent across e in a time unit (denoted by cap(e)) is limited by its bandwidth (C(e)), by the processing speed of the source node (CPU(v)), and by the ratio between the environmental power available at the node and the energy needed to process and send a packet across e (P (v)/E(v, e)). In symbols: P (v) (1) F (e) ≤ cap(e) = min C(e), CPU(v), E(v, e)
sub-node (destination of all incoming edges) and an output sub-node (source of all outgoing edges) connected by an internal (virtual) edge with capacity cap(v). All other edges, representing the actual links among the nodes, maintain their original capacities according to (1). The result is an edgeconstrained flow network which retains all the constraints imposed to the sensor network, allowing us to handle WSNs within the framework of flow networks. When node constraints cannot be expressed as a cumulative flow limitation independent of the incoming or outgoing edges, however, the network cannot be transformed into an equivalent edge-constrained flow network. In this paper we call generalized flow network any directed graph with arbitrary flow limitations possibly imposed at both edges and nodes.
where F (e) is the packet flow over edge e. Since cap(e) is an upper bound for F (e), it can be treated as a link capacity that summarizes all the constraints applied to the edge, suggesting that the overall sensor network can be modeled as a flow network [8]. Each node, however, usually has multiple outgoing edges that share the same power and computational budget, so that capacity constraints cannot be independently associated with the edges without taking into account the additional constraints imposed to their source nodes, represented by the following equations:
2.1 Sensor networks
F (e) ≤ CPU(v)
(2)
F (e)E(v, e) ≤ P (v)
(3)
e_exiting_from_v
e_exiting_from_v
If the transmission power is not dynamically adapted to the actual length of the wireless link [26], the energy spent at node v to process a packet can be regarded as a property of the node (denoted by E(v)) independent of the outgoing edge of choice. In this case, which is typical of most realworld WSNs, the constraints imposed by (2) and (3) can be suitably expressed as capacity constraints (denoted by cap(v)) applied to the packet flow across node v (denoted by F (v)). In symbols: F (v) =
F (e)
(4)
e_exiting_from_v
P (v) F (v) ≤ cap(v) = min CPU(v), E(v)
(5)
Node-constrained flow networks can be easily transformed into equivalent edge-constrained flow networks by splitting each original constrained node (v) into an input
We consider sensor networks made of 4 types of nodes: sensors, which are equipped with transducers that make them able to sense the environment and to generate data packets to be sent to a collection point, sinks, which generate control packets and collect data packets, routers, which relay packets according to a given routing algorithm, and sensor-routers, which exhibit the behavior of both sensors and routers. Without loss of generality, for the sake of simplicity in the following we consider a sensor network with only one sink. Generalization to multi-sink networks can be simply obtained by adding a dummy sink connected at no cost with all the actual sinks. Figure 1 shows a hierarchical sensor network [10] of 64 sensors (thin circles), 16 routers (thick circles), and 1 sink (square). Sensors and routers are uniformly distributed over a square 10 × 10 region, with the sink in the middle. The communication range of each node is equal to the minimum diagonal distance between the routers (edges are not represented for the sake of simplicity). Shading is used to highlight the sensors that need to be sampled according to a given monitoring task. 2.2 Maximum sustainable workload Given a WSN, the environmental conditions, and a monitoring task, the maximum sustainable workload (MSW) for the network is the maxflow of the corresponding flow network from the sampled sensors to the sink. The MSW can be determined in polynomial time by solving an instance of the maximum-flow problem (hereafter called maxflow) within the theoretical framework of flow networks [8]. Since the maximum flow problem is defined from a single source to a single destination, if there are multiple sensors that generate packets simultaneously, a dummy source node with cost-less links to the actual sources needs to be added to the model.
Cluster Comput
Fig. 1 Hierarchical network used as a case study
The maxflow from the dummy source to the sink represents the global MSW. If the transmission power is tuned to the length (and quality) of the links, the energy per packet depends on the outgoing edge, so that (2) and (3) cannot reduce to (5), node constraints cannot be transformed into equivalent edge constraints, and classical maxflow algorithms [8] cannot be applied. Nevertheless, the network is still a generalized flow network, the maxflow of which represents the MSW of the corresponding WSN. This paper is not aimed at determining the MSW of a WSN. Rather, it is aimed at designing a routing algorithm able to route any sustainable workload, including the theoretical maximum. Hence, we are interested in the value of MSW at the only purpose of testing the routing algorithm under worst case operating conditions. If the monitoring task consists of sampling a given subset of the sensor nodes, the MSW is directly related to the maximum sustainable sampling rate (MSSR) at which all target nodes can be simultaneously sampled by the sink without violating power, bandwidth, and resource constraints [16]. A simulation-based technique for MSSR estimation will be outlined in Sect. 4.1.
3 Routing strategy Capacity constraints, path capacities, and bandwidth requirements can be expressed in terms of packets per time unit. Since dynamic routing strategies can take different decisions for routing each packet, the routing algorithm can be developed by looking at packets rather than at overall flows. The capacity constraints imposed at a given node (edge) at the beginning of a time unit represent the actual number of packets that can be processed by that node (routed across that edge) in the time unit. Whenever the node (edge) is traversed by a packet, its residual capacity (which represents
its capability of handling other packets in the same time unit) is decreased because of the energy, CPU, and bandwidth spent to process that packet. Given a generalized flow network with vertices V and edges E, a path of length n from a source node s to a destination node d is a sequence of nodes P = (v0 , v1 , . . . , vn−1 ) such that v0 = s, vn−1 = d, and evi−1 ,vi ∈ E for each i ∈ [1, n − 1]. We call path capacity of P, denoted by cap(P), the maximum number of packets per time unit that can be routed across the path without violating any node or edge constraint. We call point-to-point flow the flow of packets routed from one single source to one single destination, regardless of the path they follow. Referring to a path P and to a time unit t, the nominal path capacity of P at time t is the capacity of the path computed at the beginning of the time unit by assuming that all the resources along the path are entirely assigned to P for the whole time unit. In practice, it corresponds to the minimum of the capacities of the nodes and edges belonging to the path, as computed at the beginning of the time unit. The residual path capacity of P at time t + τ , on the contrary, is the path capacity re-computed at time t + τ by taking into account the resources consumed up to that time by the packets processed since the beginning of the time unit. The routing algorithm proposed in this paper implements a simple greedy strategy, belonging to the class of distance vector strategies [3], which can be described as follows: always route packets across the path with maximum residual capacity to the sink. According to this strategy, the residual path capacity is used as a routing metric. More precisely, the metric used at node v to evaluate its outgoing edge e is the maximum of the residual capacities of all the paths leading from v to the sink through edge e. The minimum number of hops can be used as a second criterion to choose among edges with the same residual path capacity. The complexity of the routing algorithm is hidden behind the real-time computation of residual path capacities, which are possibly affected by any routed packet and by any change in the constraints imposed to the nodes and to the edges encountered along the path. In principle, in fact, routing metrics should be recomputed at each node (and possibly diffused) whenever a data packet is processed or an environmental change is detected. In order to reduce the control overhead of real-time computation of residual path capacities (the algorithmic aspects of which will be discussed in the next section) routing metrics can be kept unchanged for a given time period (hereafter called epoch) regardless of traffic conditions and environmental changes, and recomputed only at the beginning of a new epoch. In this way, all the packets processed by a node (say v) in a given epoch are routed along the same path, which is the one with the highest nominal capacity as computed at the beginning of that epoch. Residual capacities are
Cluster Comput
computed at the end of the epoch by subtracting from nominal capacities the cost of all the packets routed in that epoch (in terms of energy, CPU, and bandwidth). The lack of feedback on the effects of the routing decisions taken within the same epoch may cause the nodes to keep routing packets along saturated paths, leading to negative residual capacities at the end of the epoch. Negative residual capacities (hereafter called capacity debts) represent temporary violations of some of the constraints. Depending on the nature of the constraints (power, CPU, bandwidth) the excess flow that causes a capacity debt can be interpreted either as the amount of packets enqueued at some node waiting for the physical resources (bandwidth or CPU) needed to process them, or as the extra energy taken at some node from an auxiliary battery that needs to be recharged in the next epoch. In any case, capacity debts need to be compensated in subsequent epochs. This is done by subtracting the debts from the corresponding nominal capacities before computing nominal path capacities at the beginning of next epoch. Example 1 Consider the network of Fig. 1 with the same constraints (namely, cap(v) = 200) imposed to all sensors and routers, and with no edge constraints. The effect of a SAMF routing strategy are shown in Fig. 2, where sensor nodes and edges not involved in the monitoring task are Fig. 2 (d) Maxflow of the example network, obtained by averaging the flows over three epochs: (a), (b), and (c)
not represented for the sake of simplicity. Intuitively, the maxflow is 600, corresponding to a MSSR of 150 packets per sensor per unit. In fact, all data packets need to be routed across cut A (shown in Fig. 1), which contains only 3 routers with an overall capacity of 200×3 = 600 packets per time unit. An optimal flow distribution is shown in Fig. 2(d), where the thickness of each edge represents the flow it sustains: 50 packets per time unit for the thin lines, 200 packets per time unit for the thick ones. Figures 2(a), 2(b), and 2(c) show the flows allocated by the SAMF routing strategy in three subsequent epochs (of one time unit each) when the 4 sensors of interest are sampled at the MSSR (namely, 150 packets per time unit). Nominal node capacities at the beginning of each epoch are annotated in the graphs in order to point out the effects of over-allocation. In the first epoch all the paths to the sink exhibit the same capacity, so that the path length is used to choose the best path. Since the routing metric is not updated during the first epoch, all data packets (namely, 600) are pushed along the shortest path from the upper corner to the sink, which could sustain only 200. The residual capacity of node n at the end of the first epoch is −400. The capacity debt of 400 packets is then subtracted from the nominal capacity of node n (200) at the beginning of the second epoch, that becomes −200. This negative value imposes to the algorithm the choice of a different path. Since the capacity debt of the shortest path is completely
Cluster Comput
compensated at the end of the third epoch, the entire routing strategy can be periodically applied every three epochs. The optimal maxflow solution of Fig. 2(d) can be obtained by averaging the flows allocated by the self-adapting algorithm in the three epochs shown in the figure. We say that a routing strategy converges if it can run forever causing only finite capacity debts. The convergence property of the SAMF routing strategy is stated by the following theorem.
and resource constraints. Moreover, it has the inherent capability of adapting to environmental changes expressed as time-varying constraints. It is worth noting, however, that the theory exposed so far doesn’t take into account the control traffic overhead required to recompute routing metrics at the beginning of each time epoch. Protocol overhead imposes a trade off between adaptation rate and complexity which will be discussed in Sect. 4.2 and analyzed in Sect. 5 by means of simulations.
4 Simulation model Theorem 1 Given an autonomous WSN with power, bandwidth, and resource constraints expressed by (1) and (5), the SAMF routing strategy converges for any sustainable workload. Proof Assume, by contradiction, that a sustainable workload is applied to the network but the strategy does not converge, so that there is at least one edge (or one node) with a capacity debt which keeps increasing and a residual capacity which decreases accordingly. Without loss of generality, assume that edge e, from node i to node j , has the lowest residual capacity at the end of time epoch h, denoted by cap(e)(h) . If the routing strategy does not converge, for each epoch h there is an epoch k > h such that the residual capacity of e at the end of k is lower than that at the end of h. In symbols: cap(e)(k) < cap(e)(h) The decrease of the residual capacity in e from epoch h to epoch k means that the average flow routed across e in that interval of time exceeds the nominal capacity of e. We distinguish two different cases. In the first case all the point-to-point flows routed across e have no alternate paths to the sink. Hence, if the sum of the flows exceeds the capacity of e, then the workload is not sustainable. A contradiction. In the second case the edge is also used to route at least one multi-path point-to-point flow. Since the routing metric is based on residual path capacities, a path including edge e can be taken iff all alternate paths have lower residual capacities. Since e was the edge with lowest residual capacity at epoch h, then it can be taken at some epoch l from h to k iff the capacities of all alternate paths have become lower in the mean time. But this may happen iff the average flows routed across all alternate paths have exceeded their nominal capacities, meaning that the workload is not sustainable for the network. A contradiction. Theorem 1 demonstrates that SAMF routing is able to route any sustainable workload under power, bandwidth,
Although the self-adapting capabilities of SAMF routing have been theoretically proved independently of its implementation, the actual applicability of the approach depends on additional features of practical interest, such as control traffic overhead, routing efficiency (number of hops), convergence speed, maximum buffer size, and scalability, which need to be assessed by means of extensive experiments. To this purpose, a SAMF routing algorithm has been implemented on top of OMNeT++, a discrete-event, opensource, modular network simulator [21]. Network components are written in C++ and composed using a high-level network description language called NED. The object-oriented implementation of the routing algorithm is based on two main classes: Node, which is a subclass of the OMNeT++ cSimpleModule class, and RouteT, which is a new class used to handle dynamic route tables. Each node has an input/output gate for each incoming/outgoing edge. Nodes communicate by means of cMessages sent by the source node through one of its output gates and received by the corresponding destination node through one of its input gates. Whenever a node receives a message, it reacts by invoking its handleMessage() method. For our purposes, we use two subclasses of cMessage (namely, Interest and Data) to represent control packets and data packets. According to the type of message received, the handleMessage() method invokes either handleData() or handleInterest(). Notice that OMNeT++ is a communication-oriented event-driven simulator, so that any action needs to be triggered by a message. If a module needs to schedule in the future an action which will not be triggered by an external event, it needs to generate a self message with a proper delay. In the proposed approach, self messages are used by sensor nodes to trigger the generation of data packets and by the sink to trigger the diffusion of a new Interest message at the beginning of each epoch, as in Direct Diffusion [9]. Interest messages carry three specific properties: epoch_id, which denotes the epoch it belongs to, path_cap, which represents the capacity of the best
Cluster Comput
path available from the last relaying node to the sink, and path_hop, which represents the length of the best path. The pseudo-code of handleInterest() is shown in Fig. 3. The method compares the current epoch (which is a private property of the Node) with the epoch_id conNode::handleInterest(Interest *msg) { 1 if (epoch != msg->getEpoch_id()) 2 newEpoch(); 3 new_msg = routeTable->update(msg); 4 if (new_msg != NULL) 5 for each gate g != msg->in_gate 6 send(new_msg,g); 7 if (OVERHEAD) 8 energy_use += g->packet_energy; 9 cpu_use += packet_cpu; 10 g->link_use ++; } Fig. 3 Pseudo-code of Node::handleInterest() method
Fig. 4 Pseudo-code of Node::newEpoch() method
Fig. 5 Pseudo-code of RouteT::update() method
tained in the Interest message. If they are not equal, a new epoch is detected and the newEpoch() method is invoked to recompute local node and edge constraints, possibly taking into account capacity debts according to the pseudocode of Fig. 4, where deltaT denotes the duration of each epoch. The last 3 lines of handleInterest() are used to compute the control traffic overhead if the OVERHEAD flag is true, as discussed in Sect. 4.2. The Interest message is then used to update the local route table by means of method RouteT:: update(), shown in Fig. 5, which possibly returns a new Interest message to be used to notify changed best-path conditions. Interest back-propagation is performed by rows 4–6 of handleInterest(). The actual routing policy is implemented by the bestGate() method of the RouteT class (shown in Fig. 6), which returns the best output gate to be used to send data packets according to the greedy routing metric discussed in
Node::newEpoch() { // energy 1 residual_energy += node_power*deltaT-energy_use; 2 energy_use = 0; // bandwidth 3 for each gate g 4 if (g->residual_cap*deltaT < g->link_use) 5 g->residual_cap += g->link_cap-g->link_use/deltaT; 6 else 7 g->residual_cap = g->link_cap; 8 g->link_use = 0; // CPU 9 if (residual_cpu*deltaT < cpu_use) 10 residual_cpu += cpu_cap - cpu_use; 11 else 12 residual_cpu = cpu_cap; 13 cpu_use = 0; // link constraint 14 for each gate g 15 g->constraint = min(residual_energy/g->packet_energy, residual_cpu/packet_cpu, g->residual_cap*deltaT); 16 g->constraint /= deltaT; }
Interest *RouteT::update(Interest *msg) { 1 old_best_gate = bestGate(NULL); 2 g = msg->in_gate; 3 g->path_cap = min(g->link_cap, msg->path_cap); 4 g->path_hop = msg->path_hop + 1; 5 new_best_gate = bestGate(NULL); // interest back-propagation 6 if (!equal(new_best_gate, old_best_gate)) 7 new_msg = new Interest(new_best_gate); 8 else 9 new_msg = NULL; 10 return(new_msg); }
Cluster Comput Fig. 6 Pseudo-code of RouteT::bestGate() method
Fig. 7 Pseudo-code of Node::handleData() method
Gate *RouteT::bestGate(Gate *in_gate) { 1 best_gate = NULL; 2 for each gate g != in_gate 3 if ((best_gate == NULL) || (best_gate->path_cap < g->path_cap) || ((best_gate->path_cap == g->path_cap) && (best_gate->path_hop > g->path_hop))) 4 best_gate = g; 6 return(best_gate); }
Node::handleData(Data *msg) { 1 in_gate = msg->in_gate; 2 g = route->bestGate(in_gate); 3 send(msg,g); 4 energy_use += g->packet_energy * msg->burst_size; 5 cpu_use += packet_cpu * msg->burst_size; 6 g->link_use += msg->burst_size; }
Sect. 3. The best gate is the one which leads to the shortest path among those with maximum residual capacity. The incoming gate is excluded from the choice. RouteT::bestGate() is used both during dissemination and during data collection. During dissemination, it is invoked by RouteT::update() before and after updating the routing table, in order to check whether or not the changes need to be back-propagated. During data collection, the method is invoked by handleData() to relay data packets toward the sink (as shown in Fig. 7). Whenever a data packet is processed, energy, CPU, and bandwidth usage counters are incremented within handleData() in order to be used at the beginning of the subsequent epoch to compute capacity debts (within newEpoch()). Method handleData() makes use of a property of the Data message, called burst_size, which has not been discussed so far. Since all the data packets generated by the same sensor node within a given epoch follow the same route, they can be effectively represented by a single Data message with burst_size equal to the sampling rate multiplied by deltaT. This “burst-mode” simulation option makes the CPU time independent of sampling rate and epoch duration, enabling fast design exploration without loss of accuracy. 4.1 Test of sustainability According to Theorem 1, the SAMF routing strategy implemented by the simulation model outlined so far is guaranteed to converge for any sustainable workload. Hence, simulation stability can be used as a proof of sustainability for the workload applied to the network. The instability of the sim-
ulation can be detected by checking for capacity debts that increase over time. In our simulation model the test is performed within the newEpoch method, by comparing current capacity debts with the ones computed at the end of last epoch. The simulation is considered to be convergent if it lasts for a “long-enough” number of epochs without causing any instability. Given the simulation model of a WSN, the simulator can be viewed as a function which takes in input two parameters: the sampling rate to be applied to the target sensors (SR) and the simulation length (Nepochs). When the function is invoked the simulation is launched and the function returns 1 in case of instability or 0 in case of normal termination. The function can then be used within the inner loop of a bisection-search algorithm in order to estimate the ˜ the estimated value of MSSR, MSSR. We denote by MSSR which suffers from two sources of approximation: the limited number of iterations in the bisection-search algorithm (each iteration adds a binary digit to the precision) and the limited length of simulation runs (which avoids the detection of instabilities that would show up after the end of simula˜ overestimates the actual value of tion). As a result, MSSR MSSR with a precision given by n log10 2, where n is the number of bisection iterations. For instance, if the bisection algorithm iterates n = 10 times, then the precision of the estimator is 3 digits, corresponding to a maximum overestimation of 1 per mil. It is worth noting that the dichotomic search algorithm does not represent a real-world usage pattern for a sensor network. Rather, it represents a possible application of the simulation model, which provides an empirical estimate of the maximum sustainable sampling rate of the corresponding network.
Cluster Comput
4.2 Control traffic overhead Protocol overhead is caused by the Interest messages which need to be periodically diffused from the sink to the nodes in order to update routing metrics. The handleInterest() method of Fig. 3 has the structure of the distributed single-source Bellman-Ford algorithm [18] typically used to compute minimum-weight paths with polynomial message complexity. In order to take control traffic into account during simulation, the cost of each Interest message has to be considered in terms of energy, CPU, and bandwidth. This is done by the last rows of the pseudo-code reported in Fig. 3. In comparison with the last rows of handleData(), which take into account the cost of Data messages, there are two main differences: each Interest message represents a single packet, so that no burst_size is used, and the computation of its cost is conditioned to a Boolean flag (namely, OVERHEAD). The Boolean flag is used to enable two different simulation modes: a real simulation mode (OVERHEAD = 1) which does take into account control traffic overhead, and an ideal simulation mode (OVERHEAD = 0) which does not. If the ideal simulation mode is used to determine the ˜ MSSR (as outlined in the previous subsection) then MSSR is an estimator of the theoretical maxflow of the equivalent flow network, which is an upper bound for the achievable ˜ is maxflow. If the real simulation mode is used, then MSSR an estimator of the maximum sustainable sampling rate that can be actually achieved by the SAMF routing algorithm. In ˜ real to denote the ˜ ideal and MSSR the following we use MSSR two estimators, respectively. The practical impact of control traffic overhead on the operation of an autonomous WSN can be expressed by the following figure: overhead =
˜ real ˜ ideal − MSSR MSSR ˜ real MSSR
(6)
5 Simulation results The simulation model described in Sect. 4 was used both for validation, and for parametric assessment. In order to focus on the inherent properties of the algorithm, simulations were conducted using ideal links with 0 delay and no packet loss, and no heuristic optimizations were applied to the algorithm for reducing the control traffic overhead or speeding-up convergence. Validation was performed by running ideal-mode simulations for checking the capability of the SAMF routing strategy of handling the maximum sustainable workload, as theoretically determined by solving an instance of maxflow for
the equivalent flow network. WSNs without edge-dependent node constraints were used to this purpose, in order to apply classical maxflow algorithms [8]. The self-adapting algorithm always converged to a routing strategy able to sustain the expected MSSR. Parametric assessment was performed to evaluate the scalability of the proposed approach in terms of convergence speed, routing efficiency, buffering requirements, and control overhead. Since the parameters of interest are strongly dependent on the monitoring task, the parametric analysis was conducted on a test case, characterized by the following fixed assumptions: (i) the network is deployed on a square 10 × 10 region, (ii) the sink is placed in the middle of the square region, (iii) the monitoring task consists of sampling at a constant rate all the sensors placed in the 2.5 × 2.5 region in the top-right corner of the deployment area. Two sets of experiments were performed: a small set of deterministic experiments conducted on networks with a regular controlled topology, and a large set of Monte Carlo simulations of randomly-generated networks. 5.1 Deterministic experiments The deterministic experiments were performed on a family of sensor networks with the regular topology shown in Fig. 1, with sensors and routers placed on a square grid. Scalability was tested by increasing the density of the sensors and routers deployed on the square region, while keeping unchanged their relative density and the relative size of the sampled corner. Both the ideal and the real MSSR were estimated by means of the simulation-based bisection method outlined in Sect. 4.1, and then used as worst-case conditions to test the behavior of the algorithm with and without control traffic overhead. The whole scalability test was repeated by changing the degree of connectivity, the area of the sampled region, the spread of the power constraints (randomly assigned to each node within a given range), the ratio between node and edge constraints, the relative density of sensors and routers, and the length of the epochs. Figure 8 plots the results of the scalability test performed on networks dominated by the power constraints imposed to the nodes (200 packets per time unit), with a relative density of 4 sensors per router, with a sampled area of 1/16 of the total area, with transmission range equal to the minimum diagonal distance between the routers, with epochs of 10 time units, and with maximum sampling rate. Dashed lines refer to ideal simulations, while solid lines with circles were obtained by taking into account control traffic overhead. The results, plotted as functions of the number of nodes, are discussed in the following using two absolute terms of comparison: the theoretical maximum sustainable workload (dashed line in the first graph of Fig. 8), which provides an
Cluster Comput Fig. 8 Representative results of deterministic simulation experiments. Dashed lines refer to ideal-mode simulations, while solid lines take into account control traffic overhead
upper bound to the achievable routing capability, and the average minimum path from the target sensors to the sink (thin line in the third graph of Fig. 8), which provides a lower bound to the number of hops. No comparison is made with existing energy-aware routing algorithms, due to the paradigm shift from lifetime optimization to steady-state workload maximization, which makes it difficult to define common meaningful metrics. – Maxflow shows the maximum number of data packets routed in a time unit. The value of 600 obtained for the
smallest network has been discussed in Sect. 3. The sustainable maxflow increases with node density because of the larger number of routers at the boundaries of the sampled region (cut A in Fig. 1(a)). However, the maxflow cannot exceed 800 because of the bottleneck imposed by the four routers directly connected to the sink (cut B in Fig. 1(a)). The maxflow obtained by taking into account the control traffic overhead is very close to the ideal curve. – Period provides a measure of the cyclical nature of the routing strategy. If is automatically evaluated from the
Cluster Comput
–
–
–
–
dominant component in the Fourier transforms of the time series representing the flow across each edge as a function of the epochs. The value plotted in the figure as a property of the overall routing strategy is the maximum of the periods computed for the 10% most used edges. The shorter the period, the higher the convergence speed and the lower the time variance of the traffic across each edge. The sizeable difference between ideal and real curves observed for the large networks is due to the impact of the least used edges that fall within the 10%. In fact, when control overhead is taken into account, the algorithm occasionally route packets across unusual paths that exhibit a long repetition time. Path length is the average number of hops to the sink, which can be compared to the average minimum path (solid thin line in Fig. 8) in order to evaluate routing efficiency. On average, the difference between SAMF and minpath is between 1 and 2 hops, and it doesn’t increase with the size of the network. Control traffic overhead doesn’t seem to have a significant impact on path length. Max debt is the maximum capacity debt observed during the whole simulation. It provides a measure of the size of the energy/packet buffers required to deal with overallocations. It is worth noting that buffer requirements are almost independent of the size of the network and of the control overhead. Interest is a measure of the control traffic overhead expressed by the total number of interest packets exchanged per epoch, which scales almost linearly with the number of nodes for both ideal and real simulations. CPU time reports the time taken by OMNeT++ to simulate the network for 1,000 epochs on an Intel Core 2 Duo E4600 at 2.4 GHz, with 2 GB of RAM. CPU time can be used to evaluate the suitability of the simulation model for design exploration.
The remaining experiments (not reported in detail for the sake of conciseness) have shown that: (i) the length of the epoch affects only the buffer size (which scales linearly) and the ratio between control traffic and data traffic (which is inversely proportional to the epoch length); (ii) the spread of the constraints reduces the maximum sustainable workload and increases the average path length; (iii) when the sampling rate of the sensors is lower than the MSSR both buffering requirements and control traffic overhead decrease; (iv) the degree of connectivity impacts the maxflow, the path length, and the control traffic overhead. 5.2 Monte Carlo experiments Monte Carlo experiments were conducted to perform a sensitivity analysis by means of pseudo-random sampling in a neighborhood of a given point in the design space. We used as independent variables: the number of routers deployed
in the square region (Nr), the number of sampled sensors placed in the corner under monitoring (Ns), the transmission range of sensors and routers (Tx range), the power available at each node (Power), the bandwidth of each wireless link (Bandwidth), the length of the time epochs adopted for recomputing routing metrics (Epoch length), and the target ˜ real . sampling rate (Rate) expressed as a fraction of MSSR The sensitivity analysis was conducted for the following (dependent) parameters of interest: the estimated values of ˜ real ), the max˜ ideal and MSSR ideal and real MSSR (MSSR imum repetition period of the routing strategy (Period), the maximum debt (Max debt), the control traffic overhead (Overhead), the average path length (Path length), and the CPU time of the simulator (CPU time). The analysis was conducted in a ±20% neighborhood of a design point identified in the design space by a given configuration of the independent variables. For each sampling point, several random trials were performed using different seeds to generate pseudo-random networks. The inner loop of the overall sampling procedure can be outlined as follows: 1. generate a random configuration of the independent variables (coordinates of the sampling point) 2. for each trial (a) choose a seed for random network generation (b) place the Nr routers and the Ns sensors at random positions within the 10 × 10 square and the 2.5 × 2.5 corner, respectively (c) connect network nodes according to Tx range (d) apply node and edge constraints according to the values of Power and Bandwidth (e) run bisection search with OVERHEAD=0 to obtain ˜ ideal MSSR (f) run bisection search with OVERHEAD=1 to obtain ˜ real MSSR (g) simulate the network with sampling rate ˜ real × Rate SR = MSSR (h) process simulation results to compute the dependent parameters of interest Table 1 summarizes the results of the sensitivity analysis. Rows and columns are associated with independent variables and dependent parameters, respectively. The second column reports the reference values of the independent variables used for the sensitivity analysis (coordinates of the reference design point), while the second row reports the corresponding values of the dependent parameters. All other entries of Table 1 report the correlation coefficients between independent and dependent variables computed on the results of 180 random experiments. The most significant correlations (with absolute value greater or equal than 0.2) are highlighted in boldface and discussed in the following. ˜ ideal is negatively affected by the number of sen– MSSR sor nodes, which reduces the sampling rate that can be
Cluster Comput Table 1 Results of the sensitivity analysis, expressed by the correlation coefficients between independent variables (rows) and dependent parameters (columns) ˜ ideal MSSR
˜ real MSSR
Overhead
Period
Max debt
Path l.
CPU t.
(14.4)
(14.2)
(0.01)
(8.35)
(308.53)
(4.24)
(10.82)
Nr
(35)
−0.05
−0.07
0.17
−0.03
0.15
0.09
0.24
Ns
(5)
−0.27
−0.29
0.21
−0.02
0.07
0.20
0.01
Tx range
(2)
0.69
0.68
0.20
0.16
0.17
−0.49
0.70
Power
(50)
0.09
0.11
−0.19
−0.07
0.15
0.03
−0.02
Bandwidth
(30)
0.14
0.15
−0.08
0.00
−0.14
−0.02
−0.08
Epoch length
(10)
0.00
0.11
−0.30
0.00
0.21
0.00
0.00
Rate
(0.75)
–
0.12
0.38
0.41
0.29
–
–
applied at each sensor because of the limited routing capabilities of the network, and positively affected by the transmission range, which increases the number of paths available to route data packets. Interestingly enough, the number of routers has a negligible impact on the sampling rate. This is due to the particular monitoring task chosen as a case study. In fact, all the sampled sensors are placed in a limited area in a corner of the deployment region, so that the bottleneck is represented by the capacity of the routers placed around the sampled region, which represent the minimum cut for the equivalent flow network. If a few routers are added at random position, it is unlikely that they contribute to the minimum cut (which is directly related to the maxflow). As expected, the sampling rate is positively affected by the power available at the nodes and by the bandwidth of the links. ˜ ideal , with the ad˜ real follows the behavior of MSSR – MSSR ditional dependence from the Epoch length. Since control packets need to be diffused at the beginning of each epoch to recompute routing metrics, longer epochs cause a smaller control overhead, ultimately making the real MSSR closer to the ideal one. – Overhead, computed according to (6), is positively affected by the size of the network and by the transmission range. In fact, the number of Interest messages received and sent by each router depends on the number of incoming and outgoing edges, respectively. Both the number of nodes and the transmission range positively affect the degree of connectivity, causing a larger overhead. As already discussed, the overhead reduces when the epoch length increases. Moreover, it decreases when power and bandwidth increase. It is worth noting that we obtained an average overhead of 0.01 with epochs of 10 time units and with power/bandwidth constraints limiting the sampling rate to a few packets per time unit (about 14). In most practical cases, the MSSR is much higher and the re-computation epoch much longer, making the control overhead almost negligible.
– Period is mainly affected by the transmission range, which increases the number of alternate paths to the sink. In fact, the SAMF routing strategy has a cyclic behavior, with a repetition period roughly given by the number of alternate paths to be used before using again the same link. The repetition period is also affected by the sampling rate, since path diversity is used only when the sampling rate cannot be sustained by a single path. The higher the rate, the higher the number of paths that need to be iteratively used to accommodate the entire flow. – Max debt is mainly affected by the length of the epochs and by the sampling rate. In fact, it is proportional to the number of packets that are routed along a given path without recomputing residual path capacities and possibly updating the routing metrics. Since the epoch length increases the maximum debt and decreases the controltraffic overhead, without any effect on other parameters, it is the main design variable to be used to span the trade-off between control traffic overhead and buffering requirements. – Path length increases with the overall flow, which depends, in its turn, from the number of sensors and from the sampling rate. In fact, the larger the flow the larger the number of paths (possibly longer than the minimum one) that need to be used by the routing strategy. As expected, the minimum path reduces for longer transmission ranges. It is worth noting that the average path length obtained in the experiments (namely, 4.24 hops) is quite close to the average length of the minimum paths to the sink (3.75 hops). – CPU time is mainly affected by the number of routers and by the degree of connectivity, while it has no significant correlation with the number of sensors. This is due to the fact that in our simulation model the diffusion of control packets is much more CPU intensive than the collection of data packets. In fact, while control packets are diffused to all nodes and possibly propagated more than once per epoch, all data packets generated by a sensor within the same epoch are represented as a single mes-
Cluster Comput
sage (burst) that is routed along a single path. Moreover, CPU time increases with data rate. This is due to the additional computational complexity of debt management. When the data rate is well below the MSSR, the number of debts reduces significantly and the routing strategy is simpler. 5.3 Conclusions The paper has introduced a self-adapting maxflow (SAMF) routing strategy for autonomous wireless sensor networks, which is able to route the packets generated by any workload theoretically compatible with power, bandwidth, and computational constraints. The concept of workload sustainability has been widely discussed within the framework of generalized flow networks, and the convergence properties of SAMF routing have been formally proved. A simulation model has been developed on top of OMNeT++ in order to test the behavior of the SAMF routing strategy. A simulation-based technique has been proposed to estimate the maximum sustainable sampling rate (MSSR) at which the sensor nodes can be sampled without violating the constraints imposed to the network. Extensive simulation results have been reported in order to demonstrate the effectiveness of the proposed approach and to provide valuable data for the evaluation of its practical applicability. Current work on SAMF routing is focused on two main aspects: assessing the robustness of the approach against packet losses, variable propagation delays, and run-time environmental changes; developing real-world benchmarks to test the algorithms on the field.
References 1. Akkaya, K., Younis, M.: A survey of routing protocols in wireless sensor networks. Elsevier Ad Hoc Netw. J. 3(3), 325–349 (2005) 2. Amirtharajah, R., Collier, J., Siebert, J., Zhou, B., Chandrakasan, A.: Drops for energy harvesting sensors: applications and architectures. IEEE Pervasive Comput. 4(3), 72–79 (2005) 3. Bertsekas, D., Gallager, R.: Data Networks. Prentice Hall, New York (1987) 4. Bogliolo, A., Lattanzi, E., Acquaviva, A.: Energetic sustainability of environmentally powered wireless sensor networks. In: Proceedings of ACM PE-WASUN, pp. 149–152 (2006) 5. Chang, J.-H., Tassiulas, L.: Maximum lifetime routing in wireless sensor networks. IEEE/ACM Trans. Netw. 12(4), 609–619 (2004) 6. Chen, H.-H., Yang, Y.: Guest editorial: Network coverage and routing schemes for wireless sensor networks. Elsevier Comput. Commun. 30(14–15), 2697–2698 (2007) 7. Dressler, F.: A study of self-organization mechanisms in ad hoc and sensor networks. Elsevier Comput. Commun. 31, 3018–3029 (2008) 8. Ford, L.R., Fulkerson, D.R.: Flows in Networks. Princeton University Press, Princeton (1962) 9. Intanagonwiwat, C., Govindan, R., Estrin, D., Heidemann, J., Silva, F.: Directed diffusion for wireless sensor networking. IEEE/ACM Trans. Netw. 11(1), 2–16 (2003)
10. Iwanicki, K., van Steen, M.: On hierarchical routing in wireless sensor networks. In: Proc. of ACM/IEEE International Conference on Information Processing in Sensor Networks (IPSN 2009), pp. 133–144 (2009) 11. Jain, R., Puri, A., Sengupta, R.: Geographical routing using partial information for wireless ad hoc networks. IEEE Personal Commun. 8(7), 48–57 (2001) 12. Jakobsen, M.K.: Energy Harvesting Aware Routing and Scheduling in Wireless Sensor Networks. Technical University of Denmark, MS Thesis report (2008) 13. Kansal, A., Hsu, J., Zahedi, S., Srivastava, M.B.: Power management in energy harvesting sensor networks. IEEE Trans. Embed. Comput. Syst. 6(4), 1539–9087 (2007) 14. Klopfenstein, L.C., Lattanzi, E., Bogliolo, A.: Implementing energetically sustainable routing algorithms for autonomous WSNS. In: Proceedings of WoWMoM, pp. 1–6 (2007) 15. Kwon, H., Noh, D., Kim, J., Lee, J., Lee, D., Shin, H.: Low-latency routing for energy-harvesting sensor networks. In: Indulska, J., et al. (eds.) Performance Evaluation and Planning Methods for the Next Generation Internet, UIC 2007. LNCS, vol. 4611. Springer, Berlin (2007) 16. Lattanzi, E., Regini, E., Acquaviva, A., Bogliolo, A.: Energetic sustainability of routing algorithms for energy-harvesting wireless sensor networks. Elsevier Comput. Commun. 30(14–15), 2976– 2986 (2007) 17. Levis, P., Culler, D., Gay, D., Madden, S., Patel, N., Polastre, J., Shenker, S., Szewczyk, R., Woo, A.: The emergence of a networking primitive in wireless sensor networks. Commun. ACM 51(7), 99–106 (2008) 18. Meyer, U.: Average-case complexity of single-source shortestpaths algorithms: lower and upper bounds. J. Algorithms 48(1), 91–134 (2003) 19. Mhatre, V., Rosenberg, C.: Energy and cost optimizations in wireless sensor networks: a survey. In: Girard, A., Sanso, B., VazquezAbad, F. (eds.): Performance Evaluation and Planning Methods for the Next Generation Internet. Kluwer Academic, Dordrecht (2005) 20. Noh, D., Yoon, I., Shim, H.: Low-latency geographic routing for asynchronous energy-harvesting WSNS. J. Netw. 3, 78–85 (2008) 21. OMNeT++ community site: OMNeT++ Discrete Event Simulation System. Last accessed: August 2008. http://www.omnetpp. org/ 22. Raghunathan, V., Kansal, A., Hsu, J., Friedman, J., Srivastava, M.: Design considerations for solar energy harvesting wireless embedded systems. In: Proceedings of IPSN, p. 64 (2005) 23. Schurgers, C., Srivastava, M.B.: Energy efficient routing in wireless sensor networks. In: Proceedings of Military Communications Conference, pp. 357–361 (2001) 24. Shah, R.C., Rabaey, J.M.: Energy aware routing for low energy ad hoc sensor networks. In: Proceedings of Wireless Communications and Networking Conference, pp. 350–355 (2002) 25. Vigorito, C.M., Ganesan, D., Barto, A.G.: Adaptive control of duty cycling in energy-harvesting wireless sensor networks. In: Sensor, Mesh and Ad Hoc Communications and Networks. IEEE, New York (2007) 26. Wang, A.Y., Sodini, C.G.: On the energy efficiency of wireless transceivers. In: Proc. of IEEE Conference on Communications, pp. 3783–3788 (2006) 27. Yarvis, M., Zorzi, M.: Special issue on energy efficient design in wireless ad hoc and sensor networks. Elsevier Ad Hoc Netw. 6(8), 1183–1184 (2008) 28. Yick, J., Mukherjee, B., Ghosal, D.: Wireless sensor network survey. Elsevier Comput. Netw. 52, 2292–2330 (2008)
Cluster Comput Alessandro Bogliolo is Director of the Information Science and Technology Institute (ISTI) of the University of Urbino, Italy. He received the Laurea degree in Electrical Engineering (1992) and the Ph.D. degree in Electrical engineering and Computer Science (1998) from the University of Bologna, Italy. From 1992 to 1999 he was with the Department of Electronics, Computer Science and Systems (DEIS) of the University of Bologna. In 1995 and 1996 he was with the Computer Systems Laboratory (CSL), Stanford University, Stanford, CA. From 1999 to 2002 he was Assistant Professor with the Department of Engineering (DI) of the University of Ferrara, Italy. In 2002 he joined the University of Urbino as Associate Professor. His research interests include wireless sensor networks, IP networks, and embedded systems.
Saverio Delpriori obtained the BS degree (summa cum laude) in Applied Computer Science from the University of Urbino (Italy) in 2008. Since then he has cooperated with the Information Science and Technology Institute of the University of Urbino. He’s currently enrolled in the MS degree program in Computer Science at the University of Pisa, Italy. His research interests include network simulation and multimedia systems.
Emanuele Lattanzi received the Laurea degree (summa cum laude) in 2001 and the Ph.D. degree in 2005 from the University of Urbino, Italy. Since 2001 he has been with the Information Science and Technology Institute (ISTI) of the University of Urbino. In 2003, he was with the Department of Computer Science and Engineering of the Pennsylvania State University, working as a Visiting Scholar with Professor Vijaykrishnan Narayanan. Since 2008 he has been Assistant Professor at the University of Urbino. His research interests include wireless embedded systems and wireless sensor networks, with emphasis on power and performance analysis and optimization. Andrea Seraghiti obtained the BS degree (summa cum laude) in Applied Computer Science from the University of Urbino (Italy) in 2004 and the MS degree (summa cum laude) in Computer Science from the University of Bologna (Italy) in 2007. In 2004 he joined the Information Science and Technology Institute of the University of Urbino. Since 2007 he’s also with the Department of Informatics of the University of Verona, Italy, where he’s currently working towards his Ph.D. in Computer Science. His research interests include embedded systems architecture and networking.