Energy consumption of energy-constrained nodes in wireless sensor networks (WSNs) is a fatal weakness of these networks. Since these nodes usually operate on batteries, the maximum utility of the network is dependent upon the optimal energy usage of these nodes. However, new emerging optimal energy consumption algorithms, protocols, and system designs require an evaluation platform. This necessitates modeling techniques that can quickly and accurately evaluate their behavior and identify strengths and weakness. We propose Petri nets as this ideal platform. We demonstrate Petri net models of wireless sensor nodes that incorporate the complex interactions between the processing and communication components of an WSN. These models include the use of both an open and closed workload generators. Experimental results and analysis show that the use of Petri nets is more accurate than the use of Markov models and programmed simulations. Furthermore, Petri net models are extremely easier to construct and test than either. This paper demonstrates that Petri net models provide an effective platform for studying emerging energy-saving strategies in WSNs.
Application for wireless sensor networks (WSNs) has abounded since their introduction in early 2000. WSNs are being used from surveillance, environmental monitoring, inventory tracking, and localization. A sensor network typically comprises of individual nodes operating with some limited computation and communication capabilities, and powered by batteries with limited energy supply. Furthermore, these networks are situated at a location where they may not be easily accessible. Their distributed nature, small footprint, cheap, and wireless characteristics make them very attractive for these outdoor, unattended, and hostile environment applications.
One of the motivating visions of WSNs was large-scale remote sensing such as large areas of a rainforest for environmental parameters such as humidity and temperature. However, given the remoteness of such a site, this can be a challenging problem. Modern WSNs were proposed for solving such problems, and it was envisioned that these WSN nodes could be sprinkled over an area from the back of an airplane as it flew over such an area. The nodes wherever they fell would automatically set up an ad hoc network, collect the necessary sensory information, and route the information to a base-station. Although great strides have been made in WSN designs and implementation, we are nowhere near meeting this original motivating problem.
One reason why this original problem has been difficult to solve is that WSNs are still relatively expensive in large quantities. However, the much larger problem is the limited energy available on these devices. The utility of WSNs is limited to the life of the battery under the energy consumption rates. While energy harvesting in WSNs is an active research area [
An avenue for mitigating this energy dilemma is through the design of energy-efficient communication and active/sleep scheduling algorithms. In this way, a vital resource can be rationed to last a much longer time. This minimizes the overall maintenance and replacement costs of a WSN network. However, proposing energy-efficient designs requires a detailed understanding of the energy consumption behavior of the nodes which comprise WSNs. This detailed understanding arises from accurate implementation of models for these nodes and analyzing these models under a variety of different states.
For example, many processors are available today that are capable of moving to a sleep mode where they consume minimal energy. However, should a processor be put to sleep immediately after computation, or after some time has elapsed? Or even, perhaps it should never be put to sleep? If it is best to move the processor to sleep after a time delay, what should this delay or
Another example of emerging technology that can be exploited in wireless sensor networks is the use of processors that have dynamic voltage scaling capabilities. In these processors, the voltage and clock frequency can be dynamically adjusted to obtain a minimum clock frequency to complete the task while using minimal energy [
Currently, there are two classes of modeling and simulating techniques: stochastic and simulation-based methods. Each has its strengths and weaknesses. We propose another method of modeling that has not been used in the past to model WSNs: Petri nets. This paper studies two methods of energy modeling: Markov chains, and Petri nets [ We successfully model a processor using a Markov model based on supplementary variables; we also model a processor using colored Petri nets. These models are capable of estimating the average energy consumption of a processor that can power down to a sleep mode. While Markov models have long been used for modeling systems, we show that for estimating CPU energy consumption, the Petri net is more flexible and accurate than the Markov model. Using Petri nets, we develop a model of a wireless sensor node that can accurately estimate the energy consumption. We successfully apply this model to identify the optimum powering down threshold for a given wireless sensor network application. Our model of a sensor node based on Petri net can be utilized to construct a wireless sensor network. This provides a platform that can be used to study energy consumption at the network layer for application such as cross-layer energy-aware routing.
The paper is organized as follows. Section
Traditionally, Markov models have been used; however, they are very restrictive in the type of behaviors that can be modeled. A Markov model is a discrete-time stochastic process composed of event chains with Markov property, meaning that the next state in a Markov model is only dependent upon the current state instead of previous ones.
The advantage of using Markov chains for modeling systems is that once the appropriate equations are derived, the average behavior can be easily obtained by evaluating the appropriate equations. However, the task of obtaining the equations relevant to the system can be time-consuming, if not impossible.
Petri nets, on the other hand, are very powerful tools that can be utilized to build statistical models of complicated systems that would otherwise be very difficult. Petri nets is a simulation-based approach for modeling. A Petri net is a directed graph of nodes with arcs. Nodes are referred to as places and are connected to transitions with arcs. In this paper, arcs will be drawn as directed arrows.
An example of a simple Petri net is shown in Figure
Example of Petri net.
TimeNET 4.0 [
Many techniques have been proposed for modeling embedded systems and minimizing the energy consumption. As discussed earlier, existing method includes stochastic Markov models and programmed simulation methods. There are many proposed methods based on Markov models [
Another proposed method [
Jung et al. in [
Coleri et al. [
Liu and Chou [
One of most common methods of modeling is through the use of programmed simulation using tools such as NS2, OMNet++, OPNET, and TOSSIM. Each of these tools have their strengths and weakness as described in [
In [
We have not found any literature that discusses the use of Petri nets for modeling energy consumption of nodes in a wireless sensor network [
Intrinsically, embedded systems operating in a wireless sensor network offer great potential for power minimization. Generally, the level of computation required is low and usually interspersed with communication between other nodes in the network. The power consumption of the CPU can be minimized by moving to a low power mode and conserving energy when it is not directly involved in any computation.
There are two types of workload generators that are widely used for generating jobs for a simulation. Both are used quite frequently depending upon the application. One is called the closed workload generator and the other is called the open workload generator. In a closed workload generator, a new job cannot be generated until the system has completed servicing the current job. This can be used to model schedule-driven systems that poll at given intervals for task requests. Since jobs are not generated until the current job is processed, this workload model is easy to implement and analyze. In open workload generators, on the other hand, jobs arrive independent of the state of the system. These can be used to model trigger-driven systems that service requests when an interrupt occurs. However, since jobs can arrive at any time, a buffer needs to be implemented to store those requests that arrive while the system is busy with another request. This workload model can be more difficult to implement and analyze. Figure
Closed workload generator model and open workload generator model.
An example of a Markov model of a CPU is given in Figure
Birth-death process of CPU jobs.
In this example, the following assumptions are made. The request arrivals follow a Poisson process with mean rate The service time is exponentially distributed with mean The CPU enters the standby mode (state The power up process (state
The CPU model consists of a mix of deterministic and exponential transitions. While all transitions shown as solid lines in Figure
The state equations for this mixed transition process can be derived by the inclusion of two supplementary variables
The deterministic power up process can be modeled as below:
In addition, when the system is stable, we have
From (
From (
We define the generating function of
We multiply (
Substituting (
Consequently,
Let
And the total energy consumption is
As shown in the last section, the development of a Markov model for even a simple CPU is mathematically cumbersome especially when dealing with deterministic transitions. Any slight modifications to the model will entail that the equations be rederived again. Petri net on the other hand offers a more flexible approach.
Figure
Petri net model of CPU.
This model uses an open workload generator because when transition
Petri net transition parameters for CPU jobs.
Transition | Firing distribution | Delay | Priority |
---|---|---|---|
|
Exponential | ArrivalRate | NA |
|
Instantaneous | — | 4 |
|
Instantaneous | — | 1 |
|
Exponential | ServiceRate | NA |
|
Deterministic |
|
NA |
|
Instantaneous | — | 2 |
|
Instantaneous | — | 3 |
|
Deterministic |
|
NA |
The CPU is simulated by executing the Petri net using the following steps. Jobs are generated in place Transition When Since transition When In the event that another task arrives while the CPU is still “on” and processing other tasks (steps 1-2), a token will be deposited in The token deposited to However, in the event that the job arrival rate is very slow, the CPU may power down and move to the
By computing the average number of tokens in a certain place during the duration of the simulation time results in the “steady-state" percentage of time the CPU spends in that state. For example, the average number of tokens in
We have developed a discrete event simulator that emulates the timings of state transitions of CPU. Equation (
Simulation parameters.
Total simulated time | 1000 seconds |
Arrival rate | 1 per second |
Service rate | 1 per second |
System model Petri net power parameters.
State | Power rate (mW) |
---|---|
CPU |
17 |
CPU |
88 |
CPU |
192.976 |
CPU |
193 |
Radio |
|
Radio |
0.712 |
Radio |
0.034175 |
Radio |
78 |
Figure
Figure
In all of the figures, the simulator results are given by the solid line. The Markov model is represented by the line with squares, and the Petri net by the line with circles.
Figure
ΔEnergy (Joules) estimates (
Power down |
|
|
|
---|---|---|---|
Avg. | 7.37 | 7.37 | 0.05 |
Variance | 11.88 | 12.18 | 0.00 |
STD DEV | 3.45 | 3.49 | 0.03 |
RMSE | 8.07 | 8.08 | 0.06 |
Figure
ΔEnergy (Joules) estimates (
Power down |
|
|
|
---|---|---|---|
Avg. | 7.28 | 4.99 | 2.29 |
Variance | 6.71 | 3.55 | 0.51 |
STD DEV | 2.59 | 1.88 | 0.71 |
RMSE | 7.69 | 5.30 | 2.39 |
Figure
ΔEnergy (Joules) estimates (
Power down |
|
|
|
---|---|---|---|
Avg. | 42.41 | 0.12 | 42.41 |
Variance | 1.85 | 0.00 | 2.00 |
STD DEV | 1.36 | 0.06 | 1.41 |
RMSE | 42.43 | 0.13 | 42.43 |
Energy estimates for
Energy estimates for
Energy estimates for
By comparing three different scenarios (
Another interesting observation from these experiments is that a
In this section, the energy prediction of a Petri net model for a simple sensor system will be compared against real measurements collected from an IMote2 node acting as a sensor node. Figure
Simple system model of node in wireless sensor network.
Figure
Measured power requirements for different IMote2 states.
State | Mean power (mW) |
---|---|
Idle | 1.216 |
Receiving | 1.213 |
Computation | 1.253 |
Transmission | 1.028 |
IMote2 power collection setup.
Setup of data collection for IMote2
Block diagram of data collection for IMote2
Once the power parameters of the IMote2 were characterized, the energy consumption of the IMote2 as a node in a sensor network was found. This was done by triggering the node randomly for 100 events while the power consumption was monitored. These 100 events took 266.5 Seconds, and resulted in an average power consumption of 1.261 mW. The energy consumption of the IMote2 was found to be 0.336137 J as listed in Table
Using the power parameters collected, the Petri net was simulated until steady-state probability values were obtained. This took about 10 minutes on a 2.80 GHz computer running XP. Table
Petri net transition parameters for a simple system.
Transition | Firing |
Delay |
Steady state probability (%) |
---|---|---|---|
|
Exponential | 3.0 | 59.8 |
|
Deterministic | 1.0 | 19.7 |
|
Deterministic | 0.00597 | 0.098 |
|
Deterministic | 1.0274 | 20.2 |
|
Deterministic | 0.0059 | 19.7 |
Steady-state probabilities for a simple system.
State/place | Probability (%) |
---|---|
Wait | 59.8 |
Temp place | 19.7 |
Receiving | 0.098 |
Computation | 20.2 |
Transmitting | 19.7 |
Results of actual system and petri net.
IMote2 execution time | 266.5 sec |
Average IMote2 power | 1.261 mW |
IMote2 energy usage | 0.336137 J |
Petri net energy usage | 0.326519 J |
Percent difference | 2.95 |
In this section, stochastic colored Petri nets are used to model the energy consumption of a sensor node in a wireless sensor network using open and closed workload generators as shown in Figures
Closed system model of node in wireless sensor network.
Open system model of node in wireless sensor network.
Unlike Markov models, the ease with which a Petri net can be designed allows for complicated scenarios to be modeled. Figures
The Petri nets in this section model a system that services jobs of a single type. As soon as a job is generated, a token is placed in either place
Figure
In addition, our model implemented based on TimeNET utilize a feature called “global guards” to specify more “global” conditions for the firing of transitions. We use global guards in the forms of expressions at the transitions that remove the need to provide connections using arcs. For example, these conditions can be used to check for the number of tokens in a given place. This simplifies the drawing of the Petri net significantly.
Simulation of the open workload Petri net given in Figure
Global guards for the Petri net in Figure
Closed system model Petri net transition parameters.
Transition | Type | Delay | Global guard |
---|---|---|---|
|
DET |
|
( |
|
DET | 0.000194 | ( |
|
INST |
— | (( |
|
DET | 0.001 | (( |
|
DET | 0.000576 | NA |
|
DET | 0.253 | ( |
|
INST |
— | ( |
|
DET | 0.05 | NA |
|
DET | 0.03 |
|
|
DET | 0.01 |
|
|
DET | 0.081578 |
|
|
INST |
— | (( |
&& ( |
|||
|
INST |
— | (( |
&& ( |
|||
|
INST |
— | (( |
|
DET | 0.000001 |
|
|
DET | 0.000194 | (( |
&&( |
|||
|
INST |
— | (( |
&& ( |
|||
|
DET |
|
(( |
|
INST |
— | ( |
|
INST |
— | ( |
The Petri nets in this section model a system that services jobs of a single type. As soon as a job is generated, a token is placed in either place
The system then moves from the “
If the CPU is
Once the CPU has “processed” the received packet, the radio moves to an “idle” mode. The system then moves to the
The Petri net assumes that the radio is put to sleep after the
Figure
Open system model Petri net transition parameters.
Transition | Type | Delay | Global guard |
---|---|---|---|
|
INST |
NA | ( |
|
INST |
NA | ( |
|
INST |
NA | ( |
The main difference between the close model (see Figure
As mentioned before, the ease of building Petri nets allows one to simulate complex behavior. The Petri net in Figure
Using the Petri net in Figure
Based on the Petri net models presented in the previous section, this section evaluates the energy consumption of a sensor node and discusses the potential applications of our Petri net model. For all experimental results presented in this section, we use our models to estimate the total energy consumption for a time interval of 15 minutes unless specified otherwise.
Figure
Power down threshold versus energy requirement for a closed model with a job arrival rate of 1 event/second.
In Figure
In the closed model, all transitions are deterministic including transition
The first class of values are those associated when the CPU is powered down after computation at a threshold less than the sum of the least transition times between consecutive CPU usages. Hence, the system is required to power up three times in one system cycle. From Table
When
Energy diagram of 3 CPU power ups in one system cycle for closed model (not drawn to scale).
However, when
Since
Energy diagram of 2 CPU power ups in one system cycle for closed model (not drawn to scale).
Again, applying the same principal as above, select the next minimum sum of transitions of deterministic delays. From Table
So when
Energy diagram of 1 CPU power up in one system cycle for closed model (not drawn to scale).
The final set of transitions between two consecutive CPU usage requests are between the end of the current
The difference between this and the previous cases is that
Energy diagram of no CPU power ups (after the first one) in one system cycle for closed model (not drawn to scale).
Each of these cases with the appropriate cycle times is presented in Table
Power down threshold criteria | Delay |
Power up |
Cycle time |
---|---|---|---|
=0 | 0 | 3 | 2.00254 |
|
0.000001 | 2 | 1.74954 |
|
0.00177 | 1 | 1.49654 |
|
1.00177 | 0 | 1.24354 |
As Table
However, as
This increase continues and even results in a maximum energy consumption of 4501.96 Joules at a
We can also see how the tradeoff between the CPU
We can see from this exercise that powering down the CPU immediately after it completes processing is not the best solution. A careful analysis of the system parameters should be conducted before deciding upon a
An interesting point to note is that as
Although the cases where the system CPU moves from powering up twice to only one time
By analyzing the closed model case, an understanding of the internal workings of the Petri net and its resulting behavior was obtained. This understanding can be applied to the open model as well, however, while acknowledging that the four cases in Table
As Figure
Figure
Except for transitions
In the open model, transitions
With open workload, there may not be a delay between the current cycle and the next cycle because the transition that dictates the arrival rate now fires randomly according to an exponential distribution. As Figure
It is possible that when the system finishes servicing the current “event” a new event is waiting for it. Therefore, there is no
The cycle times have been adjusted in Table
Power down threshold criteria | Power up |
Cycle time |
---|---|---|
0 | 3 | 1.00254 |
|
2 | 0.74954 (1.0) |
|
1 | 0.49654 (1.0) |
|
0 | 0.24354 (1.0) |
In the next three cases, the cycle time is shorter than the average
Power down threshold criteria | Cycle time |
Down time |
---|---|---|
0 | 1.00254 | 0 |
|
0.74954 (1.0) | 0.25046 |
|
0.49654 (1.0) | 0.50346 |
|
0.24354 (1.0) | 0.75646 |
If a larger combination of transitions using deterministic and exponential distribution firing rates are used, the resulting outputs can be expected to be even more difficult to analytically derive. This indicates that Petri nets are a very important tool in modeling and analyzing systems.
The Petri net models constructed for the sensor nodes can also be used to create a network of sensors. TimeNET has the capability of modularizing a Petri net so that a hierarchy of Petri nets can be designed. For example, Figure
Wireless sensor network.
Petri net of wireless sensor network.
Using this platform, the energy consumption of a wider range of areas such as routing, network communications, and even high level sensing applications can be modeled and simulated. With such a detailed model from the physical layer to the network layer, our platform allows for research that require knowledge at all these levels such as energy-aware cross-layer routing. In fact, this platform can be used for almost an endless number of research areas.
Using stochastic colored Petri nets, this paper develops a detailed and flexible energy model for a wireless sensor node. The experimental results indicate that this model is more accurate than the one based on Markov models. This is due to the fact that a Markov model requires the modeled systems have memoryless states. A wireless sensor node that relies on time to dynamically change its power state does not satisfy the Markov chain’s memoryless requirements. In addition, the Petri net model is much more flexible than the Markov model and can easily accommodate changes.
Further, in this paper, we have successfully demonstrated using our model that immediately powering down a CPU after every computation is not an energy minimal option and nor is never powering down the CPU. However, using our model, it is possible to identify a
The drawbacks of our Petri net model is that simulating Petri nets can be computationally intensive and require relatively long simulation time to achieve steady-state probabilities. The models presented in this paper required between 10 and 15 minutes of simulation on a 2.8 GHz computer running Windows XP to stabilize. In comparison, evaluation of closed-form Markov equations is almost instantaneous.
This work was supported in part by NSF Grants (GK-12 no. 0538457, IGERT no. 0504494, CNS no. 1117032, EAR no. 1027809, IIS no. 091663, CCF no. 0937988, CCF no. 0737583, CCF no. 0621493).