<figure><img src="image_1.png" /></figure>

HAL
open science

# A new generalized stochastic Petri net modeling for energy-harvesting-wireless sensor network assessment

Oukas Nourredine, Boulif Menouar, Eric Campo, Adrien van den Bossche

<figure><img src="image_2.png" /></figure>

## ► To cite this version:

Oukas Nourredine, Boulif Menouar, Eric Campo, Adrien van den Bossche. A new generalized stochastic Petri net modeling for energy-harvesting-wireless sensor network assessment. International Journal of Communication Systems, 2023, 36 (11), 10.1002/dac.5505. hal-04811927

HAL Id: hal-04811927

https://laas.hal.science/hal-04811927v1

Submitted on 29 Nov 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

Public Domain
# A New Generalized Stochastic Petri Nets Modeling for Energy-Harvesting-WSNs Assessment

OUKAS Nourredine<fnref n="1" />,<fnref n="2" />

BOULIF Menouar<fnref n="1" />*

Eric

Campo<fnref n="3" />

Adrien van den Bossche<fnref n="4" />

Correspondence

OUKAS Nourredine, Department of
computer sciences, Akli Mohand Oulhadj
University of Bouira, Bouira, Algeria
Email: n.oukas@univ-bouira.dz;
noureddine.mag@gmail.com

Present address

*m.boulif@univ-boumerdes.dz

Funding information

This paper proposes an energy-harvesting-aware model that
aims to assess the performances of wireless sensor networks.
Our model uses Generalized Stochastic Petri Nets to define
a sensor-neighbors relationship abstraction. The novelty
of the proposed formulation is taking into account several
real-life considerations such as battery-over breakdowns,
unavailability of neighbors, retrial attempts, and sleeping
mechanism in a single model. We use TimeNet tool to sim-
ulate the network behavior in order to evaluate its perfor-
mance throughout different formulas after it had reached
its steady state. Finally, we present a case study featur-
ing the different solar energy recovery capabilities of the
vast Algerian territory. The aim is to show with the pre-
sented model how to determine the kind of resources to
be acquired in order to cope with the sensor deployment
project requirements. The proposed model allows us to en-
sure that the battery energy level of sensors deployed in Al-
giers province for example is almost equal to 80% for 100
messages per day and (one minute/ two minutes) for (awak-
ening time/ sleeping time) ratio.

KEYWORDS

wireless sensor network, energy harvesting, retrial system,
sleeping mechanism, dependent breakdowns, GSPN modeling,
performance evaluation

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

<footnote n="1">¹LIMOSE laboratory, M'Hamed Bougara
University of Boumerdes, Independence
Avenue, 35000, Boumerdes, Algeria.</footnote>

<footnote n="2">²LIM laboratory, Department of computer
sciences, Akli Mohand Oulhadj University
of Bouira, Bouira, Algeria.</footnote>

<footnote n="3">³LAAS-CNRS, University of Toulouse,
CNRS, UT2J, Toulouse, France.</footnote>

<footnote n="4">⁴IRIT-CNRS, University of Toulouse, CNRS,
UT2J, Toulouse, France.</footnote>
# 1 | INTRODUCTION

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

Wireless Sensor Networks (WSNs) are now well-established as an effective solution to some challenging problems such as environmental conditions monitoring, border security, human health control and natural disaster relief operations [1, 2]. A WSN is a network of small devices called Sensor Nodes (SNs) that cooperatively operate to sense, collect, receive and send data to a base station (BS). Generally, SNs communicate with the BS via a multi-hops path. That is, due to limited broadcasting range, sent messages have to make their way from a sensor to another until reaching the BS. In order to implement such networks, several considerations must be addressed, such as the type of sensors to use, SN size and dimension, sensing modalities, computation, communication and storage capabilities, cost, type of power source, deployment architecture, communication protocol, application and management tools [3]. Furthermore, WSNs are subject to breakdowns stemming in most cases from battery over [4, 5]. Indeed, the sensors have limited battery capacity, and hence, SNs can only operate for a limited period of time [6, 7].

An efficient solution that has been applied to deal with this problem is to use energy harvesting (EH). EH consists of equipping SNs with special components that enable them to get energy from their environment. Energy sources may have different forms such as sunlight, wind, wave, heat, foot strike, finger strokes and others. Depending on the periodicity and amount of the harvested energy, SN parameters must be adjusted in order to have a good compromise between decent performance and long lifetime. For example, a node can increase its sampling frequency or its duty cycle to enhance its sensing reliability, or it can increase the transmission power to reach more far neighbors, and hence decrease the length of the multi-hops routing path. However, this can negatively impact the node lifetime, or even the overall network.

To find such a compromise, these systems need to be evaluated before their actual implementation. Two approaches can be used to analyse a WSN behaviour [8]. The first one uses simulation software, whereas the second resorts to formal modeling. Despite being related, these approaches have quite different requirements. For example, when a researcher introduces a new WSN protocol of communication, he can conduct his assessment according to both approaches. However, by opting for the first method, the researcher must encode the new algorithms in the language of the simulation framework [8, 9]. Therefore, coding difficulties and long simulation time issues must be addressed. In addition to that, the researcher must be aware that the simulation environment can significantly affect the obtained results. However, the simulation provides platform-dependent results [8].

In the other hand, using mathematical modeling tools, such as Petri nets, allows high level of abstraction, thus providing platform-independent results [10]. In addition, besides the solid mathematical basis results are built upon, many of the real conditions features of the modeled systems can be represented.

Due to the power of GSPN modeling capabilities the present work proposes a formulation for evaluating the performances of EH-WSNs, by taking into account a set of factors that, to the best of our knowledge, have not been previously considered simultaneously. In fact, this paper handles the following aspects:

61

62

63

64

65

* It introduces a new modeling by using the GSPN formalism that includes simultaneously a set of SN features, and a number of WSN deployment conditions. On one hand, the features include (1) energy harvesting from the ambient to recharge the batteries, (2) network connectivity operations, and (3) a sleeping mechanism. On the other hand, the deployment constraints comprehend the representation of (1) retrial attempts, (2) breakdowns, and (3) repairs.
* It uses the quantization principle in order to incorporate battery charging and discharging processes.

* It adopts the famous "dependent breakdowns strategy" that procures a general framework for breakdown management.

* It integrates an intelligent sleeping mechanism proposed in some recent works [11, 12] that enables saving energy when the harvesting rate declines. In the opposite situation, it permits speeding up the system response time. We integrate this mechanism for both main sensor and its neighbors in the modeled sensor-neighbors relationship to represent the unavailability of neighbors

* It presents a quantitative analysis that calculates several performance criteria. Then, by means of many examples, it shows the impact of some input values on the performance measures.

* It presents an actual case study for the deployment of WSNs in various Algerian territories. The study shows how the presented work can help to determine the appropriate SN features that allow to cope with the network deployment zone characteristics.

The rest of this paper is organized as follows: In Section 2, we present some related works. Next, in section 3, we describe the GSPN formalism. Section 4 describes the energy harvesting capabilities and explains the abstraction of EH-WSN by a sensor-neighbors relationship. In section 5, we develop a GSPN model for EH-WSN and we define several performance parameters' formulas. Section 6, which is devoted to the numerical results, starts by describing TimeNet tool. Then, it presents a case study. At the end of this section, we present and discuss the numerical results. Finally, we give our conclusion as well as our recommendations for future works.

## 2 | RELATED WORKS

Broadly speaking, using Petri nets to model network related problems has been adopted for a long time. Shojafar et al. [13] proposed a new three-tiered approach to solve the resource scheduling problem in grid computing environments using hierarchical stochastic Petri nets. Resource requests are categorized into layers. Each layer has specific tasks for receiving sub-tasks from and delivering data to the layer above or below. In [14], the authors presented what they called ALATO, which is an intelligent algorithm based on learning automata and adaptive stochastic Petri nets. In [15], Farooq et al. have proposed an approach based-on colored Petri nets to calculate random path routing in WSNs. In satellite networks, two Stochastic Petri Nets models are proposed to analyze the performance of satellite networks in traditional and active defense states [16].

For WSN related works, several researchers resorted to Petri nets as a modeling tool for evaluating the performances of these networks. In [17], the authors proposed a colored Petri net to model and evaluate the performances of a medium access control (MAC [4]) protocol they called S-MAC. S-MAC uses a sleeping mechanism with rendezvous scheduling. They analyzed energy consumption when such a protocol is used. However, the authors did not consider the energy harvesting nor the eventuality of breakdowns.

The authors of [18], proposed a Petri net to predict energy consumption by considering a sleeping mechanism to build the energy plan. They called the information on the residual power available in each part of the network: the power map. They use the GSPN formalism to model a route in WSN. First, they simplify the whole network by considering a point-to-point route with multiple hops. Then, they reduced the modeled route to a single hope taking
105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

into account a node-to-node relationship. They predict the energy using the speed of each node of the considered hope. However, they considered a simple sleep mechanism with only two states. The transition between states is based on probability only. Therefore, it will be better to model the node battery and link the transition between the sensor's states at the battery level. Additionally, they neither considered failures, retrial attempts, nor the sleeping mechanism based on the battery level. Also, it is adequate to consider several neighbors for the next hop instead of one.

Yadollah et al. [19] presented an analytical modeling method that uses Petri nets for energy consumption assessment. The proposed model leads to the construction of a formal model based on GSPN to evaluate the power consumption of sensors in an S-MAC-based WSN. The conducted experiments deal with the number of nodes, duty cycle rate, upper-layer data flow, and packet size.

Lacerda et al. [20] proposed a GSPN framework to mimic the behavior of WSN with multi-hops topology. They investigated the aggregation of similar packets in intermediate nodes, and its impact on the serving time of the whole network.

Zairi et al. [21] proposed a colored Petri net to study energy consumption of MAC protocols. They built what they called CP-NET to analyze the behavior of WSNs. The proposed framework allows protocol constructors to predict the behavior of the network, but the proposed approach didn't consider energy harvesting, nor breakdown/repair aspects.

Bechar et al. [22] proposed an approach for modeling and verifying the consistency and correctness of WSN protocols by using colored Petri net. They used a formal method based on the Event-B method. In the first step, the Petri net is used to elaborate network layer models, then, each one of them is detailed by an Event-B formalism.

In the WSN literature, there are works that take into consideration retrial phenomenon while considering sensor unreliability, as in S. Zhang-Song et al. [18]. The authors proposed a GSPN model to predict energy consumption by considering a new sleeping mechanism to construct the energy plan. The sleeping mechanism is also considered in [23], where the authors proposed a Markov Chain model for energy-efficient sensor nodes.

Berczes et al. [24] introduced a finite source retrial queuing model to study the characteristics of transmission in WSNs. They considered two classes of sensors: one for special requests with high priority (used for alert), and the second for normal requests (to transmit data).

Wuchner et al. [25] presented the concept of unreliable orbit, and by using a GSPN model they evaluated the performance of WSNs. Their approach were based on a sensor-neighbors relationship.

Gharbi and Charabi [26] proposed an algorithmic approach based on GSPN formalism aiming at modeling and analyzing finite-source wireless networks with retrial phenomenon and two server classes.

Boutoumi and Gharbi [27] proposed the two thresholds working vacation policy, which is an energy saving and latency efficiency approach constructed over a GSPN model for full-duplex WSNs.

WSNs performance is closely related to the amount of energy stored in the SNs' batteries. Therefore, studying the factors that affect the energy consumption of a sensor while it is interacting with the rest of the network procures a key view on how the whole system is performing. Among these factors, we have the surrounding conditions that must be available to reach a certain network lifetime, the type of batteries to acquire, the mechanism of energy conservation to use, or the response time that can be obtained. Therefore, several works adopted such a sensor-neighbors relationship to evaluate WSNs.

For instance, the authors in [28] presented a Petri-net model that considered an SN equipped with a solar-energy harvester. They used the sensor-neighbors relationship to evaluate the system in terms of response time and amount
of energy stored in rechargeable batteries. The energy is represented by using the quantization principle. The model incorporates mechanisms for power consumption in packet sending/receiving, monitoring, and processing. The authors also considered battery recharging and a switching mechanism between energy-saving (sleep) and active modes. The results obtained through the quantitative analysis made it possible to predict the average energy level of the SNs. However, the work didn't consider the intermittent nature of the charging source (i.e. the sun).

The same authors proposed an energy conservation system based on an intelligent sleeping mechanism they called DSM (dual sleeping mechanism) [29]. The presented study dealt with the absence of sunlight at night. Afterward, the model of [28] was improved by considering the case of a long-lasting WSN deployment [30]. In this latter, the authors considered the variable amount of energy that can be collected in each season.

More recently, the work presented in [11] combined the previous two considerations into a single model. That is the seasonal sunshine levels and the succession of day and night.

Besides, several works considered other factors that can affect energy consumption, such as the distance separating the receivers and the transmitters [31] and the differences in message lengths [32].

However, the works presented in [28], [30], [11] and [29] ignored several real-life circumstances such as the ability to achieve retrial attempts, and the possibility of breakdowns. Furthermore, the collected energy was limited to only one type, namely solar energy.

<caption>TABLE 1 Related works features.</caption>

(EH: Energy harvesting, RA: Retrial attempts, SM: Sleeping mechanism, B: Breakdowns, PL: Packet length, ND: Neighbor distance, NA: Neighbor Availability, PP: Packet Priority, DV: Different Sensor Velocities, ME: Mean Energy, L: Latency, TU: Transceiver Utilization)

<table><thead><tr><th rowspan="2">Ref.</th><th rowspan="2">Year</th><th colspan="9">Constraints</th><th colspan="3">Metrics</th><th rowspan="2">Case Study</th></tr><tr><th>EH</th><th>RA</th><th>SM</th><th>B</th><th>PL</th><th>ND</th><th>NA</th><th>PP</th><th>DV</th><th>ME</th><th>L</th><th>TU</th></tr></thead><tbody><tr><td>[17]</td><td>2009</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td></tr><tr><td>[25]</td><td>2010</td><td>×</td><td>√</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[26]</td><td>2012</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[24]</td><td>2013</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[27]</td><td>2018</td><td>×</td><td>√</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[28]</td><td>2019</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[32]</td><td>2020</td><td>√</td><td>×</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td></tr><tr><td>[31]</td><td>2020</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td></tr><tr><td>[19]</td><td>2020</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td></tr><tr><td>[29]</td><td>2022</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>√</td><td>×</td><td>×</td></tr><tr><td>[11]</td><td>2022</td><td>√</td><td>×</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>√</td><td>√</td><td>√</td></tr><tr><td>[33]</td><td>2022</td><td>√</td><td>√</td><td>√</td><td>√</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><td>√</td><td>√</td><td>×</td><td>×</td></tr><tr><td>Proposal</td><td>2022</td><td>√</td><td>√</td><td>√</td><td>√</td><td>×</td><td>×</td><td>√</td><td>×</td><td>×</td><td>√</td><td>√</td><td>√</td><td>√</td></tr></tbody></table>
In order to address these shortcomings, the study presented in [33] took into account the effect of breakdowns and retrial attempts on energy level and response time. The proposed approach was intended to cope with the requirements of a deployment area where breakdowns are very likely to happen, such as in military projects. This makes it only suitable for limited and specific applications.

166

167

168

169

170

This paper proposes a GSPN model that aims at combining many of the before-mentioned factors (see Table 1 for the main features of our proposal in comparison to others). In facts, our model takes into account, simultaneously, and for the first time to the best of our knowledge, the following considerations:

171

172

173

* a retrial strategy to cope with message losses,

174

* an intelligent sleeping mechanism to save energy.

175

* the dependent-failures strategy (see section 4.1 for further details),

176

* repairs of breakdown sensors to make them operational again.

177

* the model can be set up for any type of energy source, and any communication density (daily number of exchanged packets), and any type of rechargeable batteries (in terms of capacity).

178

179

## 3 | GSPN FORMALISM

180

Petri nets (PN) are a graphical mathematical tool for modeling dynamic systems in order to analyze and evaluate their behavior [34, 35]. More precisely, a PN is a bipartite digraph with two kinds of vertices: places and transitions. Places are represented by circles and can contain marks (or tokens) represented by big dots. The arcs of a PN cannot connect two vertices of the same kind. A transition can be fired if and only if its initial place has at least one mark. By assuming only arcs with unary multiplicity, the firing consumes one token from each initial place (input place) and delivers one token to each terminal place (output place).

181

182

183

184

185

186

187

Generalized stochastic Petri nets (GSPNs) are an extension to PNs that are well-fitted to systems that, in addition to being distributed and asynchronous, are stochastic [36]. In a GSPN, there are two kinds of transitions: immediate transitions (represented by thin black bar) which do not need a time to fire, and timed transitions (usually represented by boxes) which describe the execution of an activity that requires a time to finish. In addition, GSPNs introduce a special type of arcs called inhibitor arc (denoted by a solid circle head) which is intended to reverse the firing condition. That is, the associated transition can fire if there is no tokens in the input place.

188

189

190

191

192

193

194

Formally, a GSPN is an eight-tuple $(P, T, \Pi, I, O, H, W, M_0)$ where:

195

* P is the set of places.

196

* T is the set of transitions such that $P \cap T = \emptyset$.

197

* $\Pi: T \to \mathbb{N}$, is the priority function which associates the priority $\Pi(t) = n$ to an immediate transition, and $\Pi(t) = m$ to a timed transition, $(n, m \in \mathbb{N}$ and $n > m)$.

198

199

* $I: S_1(P \times T) \to \mathbb{N}$, is a function such that $S_1(P \times T)$ is the set of non inhibitor arcs and $I((p, t))$ defines the multiplicity of the (input) arc $(p, t)$ which connects the place $p$ to the transition $t$.

200

201

* $O: S_2(T \times P) \to \mathbb{N}$, is a function such that $O((t, p))$ determines the multiplicity of the (output) arc $(t, p)$ that connects the transition $t$ to the place $p$.

202

203

* $H: S_3(P \times T) \to \mathbb{N}$, is a function that associates the multiplicity to each element of the set of inhibitor arcs $S_3(P \times T)$.

204
205 $S_1(P \times T) \cup S_2(T \times P) \cup S_3(P \times T)$ forms the set of existing arcs.

206 $W: T \to \mathbb{R}^*$, is a function that associates a firing rate to each timed transition and a weight to each immediate transition.

208 $M_0: P \to \mathbb{N}$, is a function which associates to each place $p$ the initial number of marks $M_0(p)$.

209 The system state is described by means of markings. A marking at an instant $i$ is described by the vector $M_i = (M_i(p_1), M_i(p_2), ..., M_i(p_{|P|}))$, such that $M_i(p)$ gives the number of tokens in the place $p$ at the instant $i$. Starting from the initial state $M_0$, the dynamic behavior of the GSPN results from the different markings that are obtained from the firing of the transitions.

213 A transition $t$ fires in a marking $M_i$ if and only if:

214 $\forall(p, t) \in S_1(P \times T), M_i(p) \ge I((p, t)) \land \forall(p, t) \in S_2(P \times T), M_i(p) < H((p, t))$.

215 Hence, a new marking can be defined for every place $p$ linked to $t$ as follows:

216 $\forall(p, t) \in S_1(P \times T): M_{i+1}(p) = M_i(p) - I((p, t))$, and

217 $\forall(t, p) \in S_3(T \times P): M_{i+1}(p) = M_i(p) + O((p, t))$

218 The reachability graph of the GSPN is directed. The vertices are the overall markings that can be directly or indirectly reached from the initial state. Arcs are defined by the direct reachability relation and labelled by the corresponding transitions and take as weight the timed transition rates leading to the infinitesimal generator of the associated Markov chain. So, numerous results can be obtained using classical Markov chain theory [37].

222 The first step in the steady state analysis is study of ergodicity i.e. the existence and unicity of a finite steady state probability distribution [38]. If a GSPN is ergodic (bounded GSPN with strongly connected reachability graph), then there is a unique solution for the steady state probability distribution of the associated continuous time Markov chain. The resolution of the following linear system yields the solution of the steady state:

$$ \left\{ \begin{array}{l} \pi.A=0 \\ \sum \pi_i=1 \end{array} \right. $$

226 such that $A$ is the infinitesimal generator matrix, and $\pi$ is the vector of steady state probability distribution of the associated continuous Markov chain [35].

228 From the equilibrium distribution, several steady state performance parameters can be computed such as: the mean number of tokens per place, the mean sojourn time in a place, the meantime spent in a set of markings, the resource utilisation ratio and others [37].

## 4 | DESCRIPTION OF EH-WSNS

### 4.1 | Energy harvesting considerations

234 In comparison to WSN, an EH-WSN node includes an additional component called energy harvesting unit responsible of converting energy from environmental sources to electricity (see Figure 1). The power management module collects electrical energy from the harvester to directly supply it to the node or it may be stored in a storage module for future usage [1].

238 Hence, energy harvesting can be divided into two architectures (see Figure 2): Harvest-Use and Harvest-Store-Use architectures [3]. The second variant, we consider hereafter, can be implemented according to two alternatives
<figure><img src="image_3.png" /><figcaption>**FIGURE 1** A sensor node with an energy harvesting subsystem [11]</figcaption></figure>

241

that are commonly used for energy storage: secondary rechargeable batteries and super-capacitors. For further details, we refer the readers to [1].

242

243

<figure><img src="image_4.png" /><figcaption>**FIGURE 2** Different architectures of harvesting system; (a): Harvest-use architecture; (b): Harvest-store-use architecture</figcaption></figure>

244

245

246

247

Furthermore, to choose an energy harvesting system from various possible sources, one of the main criteria is to determine whether or not it can provide the required power level for the sensor node [39]. Solar energy is an affordable and clean energy source that could alleviate or eliminate the energy shortage problem in WSNs. Photovoltaic energy conversion is a traditional and well established energy-harvesting technology. It provides higher power out-
put levels compared to other energy harvesting techniques, and is suitable for large-scale energy harvesting systems. Its generated power and the system efficiency strongly depends on the availability of light and on environmental conditions [3][1], two conditions that are broadly available for our case study (see section 5.2).

Another aspect that is more or less related to energy is the breakdowns occurrence. Indeed, breakdowns generally occurs due to battery exhaustion [40, 6, 7] which generally stems from an unsuitable energy-harvesting rate. In the literature, we can find different policies of breakdowns such as active and independent breakdowns disciplines. The interested reader can refer to [41, 42] for more details. In our work, we focus on the dependent breakdowns discipline as described by Gharbi and Ioualalen [43], where the failure probability depends on the sensor state. I.e. the failure rates of an active sensor and an idle one are not necessarily equal (see Figure 3).

<figure><img src="image_5.png" /><figcaption>FIGURE 3 Breakdowns strategies</figcaption></figure>

## 4.2 | Abstraction of EH-WSN by a sensor-neighbors relationship

In order to analyze the WSN behavior, we adopt an approach based on modeling the communication between a sensor and its neighbors [25]. A neighbor is a sensor that can be reached in one hop in the message delivery path to the base station.

The sending sensor node, we call the main sensor, senses incidents from the vicinity, and then tries to deliver a report to the base station by sending a message to an idle neighbor (Figure 4). The main sensor can also receive messages from its neighbors and takes care to forwarding them further to the sink. So, a message to be sent can be initiated by the main sensor itself or from neighboring hops.

In our model, we suppose that all the sensors are identical. Any sensor can be in operational or down state. It can be in an awake or sleeping state, and it can be idle or busy (see Figure 5).

The messages arrive to the main sensor who attempts to send them. If it has at least one idle neighbor, the message sending starts immediately towards one randomly chosen neighbor. When the sending process terminates, the receiver node becomes idle. When the main sensor fails to send a message to any of its neighbors, it stores it locally in order to retry forwarding it later. In this case, the message is considered to be in orbit. While the main sensor is on duty, it is subject to energy over. Energy harvesting capability may postpone this crippling situation, or it may enable the sensor to resume when it is down. In what follows we enumerate the parameters that govern our model.
<figure><img src="image_6.png" /><figcaption>**FIGURE 4** A sensor node and its neighbors in WSNs</figcaption></figure>

We suppose that the number of messages is finite and that it is not greater than $N$. The number of neighbors is $s$. Messages arrive at each sensor node with a rate $\lambda$. Message-sending requests are randomly assigned to idle neighbors. Sending times are assumed to be independent and exponentially distributed with a rate $\mu$. The time interval between every two consecutive attempts is assumed to be exponentially distributed with a rate $\nu$.

A neighbor can be idle or busy. In both of these states, a breakdown event can occur involving the neighbor falling in a down state. The breakdowns of the neighbors are assumed to be independent and exponentially distributed. If the neighbor is idle, the breakdown rate associated with the exponential distribution is $\delta$; whereas it is $\gamma$ if the breakdowns occur in the busy state.

<figure><img src="image_7.png" /><figcaption>**FIGURE 5** Sensor node states</figcaption></figure>
## 5 | GSPN MODEL FOR EH-WSN

### 5.1 | Description

In this subsection, we propose a Petri net model to evaluate and analyze the performance of EH-WSNs.

<figure><img src="image_8.png" /><figcaption>FIGURE 6 GSPN model for EH-WSN with repeated attempts and sleeping mechanism</figcaption></figure>

Figure 6 represents our GSPN model that takes into account repeated attempts, sleeping mechanism, dependent breakdowns, repairs, battery exhaustion, and energy harvesting. The place *Msgs* contains the messages to be sent by the main sensor. The place *Attempt* represents the arrival of an incident report, a received message, or a retrial attempt for sending. Each token in the place *Orbit* represents a retrial attempt to send a message. Each token in the place *Neighbor_idle* represents an idle neighbor. Initially, there are *s* tokens in this place. The place *Neighbor_standby* represents sensor neighbors in sleeping state. Tokens in the place *Buffer* represent messages in a sending phase. The place *Neighbor_breakdown* contains neighbors in down state.

If a message arrives to the place *Attempt* and finds an idle active neighbor, it enters directly to the sending service, because *Send_start* is an immediate transition. If there is no available neighbor (i.e. the place *Neighbor_idle* is empty) or the main sensor is in the sleeping state (i.e. there is a token in the place *Main_standby*), the message joins the orbit in order to repeat its attempts later. The firing of the transition *SendMsg* represents a successful message sending.
<table><caption>**TABLE 2** Timed transitions description</caption><thead><tr><td>Index</td><td>Transition</td><td>Signification</td><td>Firing rate</td></tr></thead><tbody><tr><td>1</td><td>Arrival</td><td>Arrival of a message to the main node</td><td>λ</td></tr><tr><td>2</td><td>Send_msg</td><td>Transceiver sends a message</td><td>μ</td></tr><tr><td>3</td><td>Retrial</td><td>Retry to send a message</td><td>ν</td></tr><tr><td>4</td><td>Idle_BO</td><td>Failure of an idle neighbor</td><td>δ</td></tr><tr><td>5</td><td>Active_BO</td><td>Failure of a busy neighbor</td><td>γ</td></tr><tr><td>6</td><td>Repair</td><td>Repair of neighbors</td><td>α</td></tr><tr><td>7</td><td>Go_sleep</td><td>A neighbor goes to standby state</td><td>θ</td></tr><tr><td>8</td><td>Awake</td><td>A neighbor awakes</td><td>ω</td></tr><tr><td>9</td><td>Main_sleep</td><td>Main sensor to standby</td><td>θ</td></tr><tr><td>10</td><td>Main_awake</td><td>Main sensor to awake</td><td>ω</td></tr><tr><td>11</td><td>Harvesting</td><td>Energy harvesting process</td><td>H<sub>r</sub></td></tr><tr><td>12</td><td>working</td><td>Regular Energy consumption</td><td>W<sub>r</sub></td></tr><tr><td>13</td><td>newDay</td><td>Initializes the model each 24 hours</td><td>I<sub>r</sub></td></tr></tbody></table>

Two tokens will be generated, one represents the liberation of a sensor neighbor and joins the place *Neighbor_idle*; whereas the second joins the place *Msgs* as an idea to preserve the model aliveness.

In order to save energy, sensor neighbors join the standby state with a rate $θ$. After a certain time, the transition *Awake* is fired with a rate $ω$. In addition, the main sensor joins the sleeping state by firing the *Main_sleep* transition periodically. We define two thresholds: $T1$ and $T2$. When the level of battery energy is lower than $T1$, it joins the sleeping state directly by firing the transition *low_battery*. The SN awakes by firing the transition *Main_awake* if the level of energy in the battery is greater than or equal to the threshold $T2$.

Concerning energy considerations, the presence of a rechargeable battery is represented by the place *Battery* that initially contains $C$ quanta of energy. The number of quanta increases when the transition *Harvesting* fires (see the green-colored transitions in the model), and it decreases when the main SN is active (see the red-colored transitions in the model). We suppose that sending or receiving one message to or from a neighbor consumes one quantum of energy.

Before the end of a message receiving, the receiver can break down due to battery over. This event triggers the *Active_BO* firing that generates two tokens: one joins the place *Neighbor_breakdown* and the second joins the place *Orbit* as a retrial of message sending. Note that if a sensor fails while being idle, a token will be produced by the transition *Idle_BO* and will join the place *Neighbor_breakdown*. Tables 2 and 3 describe timed-transitions and places respectively.

On the other hand, tokens can represent resources or conditions. In Table 3, we define the type of tokens a place can contain. For the energy modeling, each token in the place *Battery* represents a *quantum*. Hence, the energy stored in the battery corresponds to the number of tokens in the place *Battery*. For instance, if there is $e$ tokens in that place, then the battery contains $e$ quanta of energy. The maximum number of tokens the place *Battery* can store is called *capacity* and will be noted $C$.
The initial state of the model is described by the marking $M_0$ such that:

• $M_0(Msgs) = N$,

• $M_0(Neighbor_idle) = s$,

• $M_0(Main_active) = 1$,

• $M_0(Battery) = C$ and

• 0 for the remainder places.

The GSPN model of Figure 6 is *bounded* and the reachability graph derived by the TimeNet tool is strongly connected, so the model is ergodic and involves the existence of a unique solution for the steady-state probability distribution of the associated continuous Markov chain.

<table><caption>TABLE 3 Description of places</caption><thead><tr><th>Index</th><th>Name</th><th>Description</th><th>Token type</th><th>Initial value</th></tr></thead><tbody><tr><td>1</td><td>Msgs</td><td>Source of messages</td><td>message</td><td>N</td></tr><tr><td>2</td><td>Buffer</td><td>Main SN's buffer</td><td>message</td><td>0</td></tr><tr><td>3</td><td>Orbit</td><td>Orbit of the main SN</td><td>message</td><td>0</td></tr><tr><td>4</td><td>Attempt</td><td>A message attempting to get the service</td><td>message</td><td>0</td></tr><tr><td>5</td><td>Battery</td><td>Main SN's battery</td><td>quantum</td><td>C</td></tr><tr><td>6</td><td>Main_active</td><td>Main SN active</td><td>boolean</td><td>1</td></tr><tr><td>7</td><td>Main_standby</td><td>Main SN sleeping</td><td>boolean</td><td>0</td></tr><tr><td>8</td><td>Neighbor_idle</td><td>Idle neighbors</td><td>neighbor</td><td>s</td></tr><tr><td>9</td><td>Neighbor_standby</td><td>Busy neighbors</td><td>neighbor</td><td>0</td></tr><tr><td>10</td><td>Neighbor_breakdowns</td><td>Broken neighbors</td><td>neighbor</td><td>0</td></tr><tr><td>11</td><td>SentMsg</td><td>Sent messages</td><td>message</td><td>0</td></tr></tbody></table>

## 5.2 | Performance formulas

Having the steady-state probability distribution $\pi_i$, several formulas of performance measures and reliability indexes of the system can be derived as follows [37, 43]:

• The mean number of busy neighbors $\bar{n}_b$. It corresponds to the mean number of marks in the place *Buffer*:

$$ \bar{n}_b = \sum_{i:M_i \in M} M_i(\text{Buffer}).\pi_i \quad (1) $$

• The mean number of idle active neighbors $\bar{n}_i$. It corresponds to the mean number of marks in the place *Neighbor_idle*:

$$ \bar{n}_i = \sum_{i:M_i \in M} M_i(\text{Neighbor\_idle}).\pi_i \quad (2) $$
335 • The mean number of retrial messages $\overline{n_o}$. It corresponds to the mean number of marks in the place Orbit:

$$ \overline{n_o} = \sum_{i: M_i \in M} M_i(\text{Orbit}) \cdot \pi_i \qquad (3) $$

336 • The mean battery charge Battery. It corresponds to the mean number of marks in the place Battery:

$$ \overline{\text{Battery}} = \sum_{i: M_i \in M} M_i(\text{Battery}) \cdot \pi_i \qquad (4) $$

337 • The mean number of all messages in the retrial system $\overline{n}$. It corresponds to the sum of mean number of marks in the place Orbit and the mean number of marks in the place Buffer:

$$ \overline{n} = \overline{n_b} + \overline{n_o} \qquad (5) $$

339 • The mean number of neighbors in the sleeping state $\overline{n_s}$. It corresponds to the mean number of tokens in the place Neighbor_standby:

$$ \overline{n_s} = \sum_{i: M_i \in M} M_i(\text{Neighbor\_standby}) \cdot \pi_i \qquad (6) $$

341 • The mean number of neighbors in breakdown state $\overline{n_f}$. It corresponds to the mean number of marks in the place Neighbor_breakdown:

$$ \overline{n_f} = \sum_{i: M_i \in M} M_i(\text{Neighbor\_breakdown}) \cdot \pi_i \qquad (7) $$

343 • The mean rate of message arrivals $\overline{\lambda}$. It corresponds to the debit of the transition Arrival:

$$ \overline{\lambda} = \sum_{i: M_i \in M(\text{arrival})} \lambda \cdot M_i(\text{Msgs}) \cdot \pi_i \qquad (8) $$

344 • The mean rate of message retrials $\overline{\nu}$. It corresponds to the debit of the transition Retrial:

$$ \overline{\nu} = \sum_{i: M_i \in M(\text{Retrial})} \nu \cdot M_i(\text{Orbit}) \cdot \pi_i \qquad (9) $$

345 • The mean rate to send a message $\overline{\mu}$. It corresponds to the debit of the transition Send_msg:
$$ \bar{\mu} = \sum_{i:M_i \in M(\text{Send\_msg})} \mu_i \cdot M_i(\text{Buffer}) \cdot \pi_i \quad (10) $$

346 • The mean rate of the awake $\bar{\omega}$. It corresponds to the debit of the transition Be_awake:

$$ \bar{\omega} = \sum_{i:M_i \in M(\text{Awake})} \omega_i \cdot M_i(\text{Neighbor\_standby}) \cdot \pi_i \quad (11) $$

347 • The mean rate of sleeping $\bar{\theta}$. It corresponds to the debit of the transition Go_sleep:

$$ \bar{\theta} = \sum_{i:M_i \in M(\text{Go\_sleep})} \theta_i \cdot M_i(\text{Neighbor\_idle}) \cdot \pi_i \quad (12) $$

348 • The mean waiting time of a message $\bar{W}$. It corresponds to the time between the arrival and the send starting. $\bar{W}$ is calculated by the Little formula [37]:

$$ \bar{W} = \frac{\bar{n}_o}{\bar{\lambda}} \quad (13) $$

350 • The mean response time of a message $\bar{R}$. It corresponds to the time between the arrival and the sending end:

$$ \bar{R} = \frac{\bar{n}}{\bar{\lambda}} \quad (14) $$

## 351 6 | NUMERICAL RESULTS

### 352 6.1 | TimeNet tool

353 TimeNet is an interactive graphical toolkit that supports modeling problems with GSPNs [44]. It is specially tailored for the steady state analysis of stochastic Petri nets. In addition, it can be used to achieve a transient analysis. TimeNet is an alternative to deriving the underlying reachability graph, and to determining the steady-state solution manually. In addition, it provides a Master/Slave concept with parallel applications and techniques for monitoring the statistical accuracy as well as reducing the simulation time length.

358 Compared to other tools, TimeNet provides a variety of efficient qualitative and quantitative analysis algorithms. TimeNet's graphical user interface has been completely written in JAVA. We refer the interested reader to [44] for more details. Figure 7 illustrates the quantitative analysis steps when using TimeNet.
<figure><img src="image_9.png" /><figcaption>FIGURE 7 Example of a quantitative analysis of a GSPN by using TimeNet 4.5</figcaption></figure>

## 6.2 | Performance analysis

* Mean energy (E),

* Mean response time (R),

* Transceiver utilization (T), and

* Repairer utilization (P).

By following the syntax of TimeNet, these measures are defined as follows:

$$367 \quad E = (\#Battery) * 100/C\%$$

$$368 \quad R = ((\#Buffer) + (\#Orbit))/(\#Msgs > 0) * \lambda$$

$$369 \quad T = (\#Buffer > 0) * (\#Main_standby > 0) * 100\%$$
$$375 \quad P = (\#\text{Neighbor\_breakdown} > 0) * 100\%$$

376 Where: C is the initial number of marks in the place *Battery*, and λ is the arrival rate (see Table 2).

<table><caption>TABLE 4 Input values for the analysis</caption><thead><tr><td>Parameter</td><td>Value</td></tr></thead><tbody><tr><td>Daily messages mean number (N)</td><td>100</td></tr><tr><td>Mean number of neighbors (s)</td><td>5</td></tr><tr><td>Sensor battery capacity (C)</td><td>100</td></tr><tr><td>T1</td><td>10%</td></tr><tr><td>T2</td><td>30%</td></tr><tr><td>Harvesting rate</td><td>2 quanta/s</td></tr><tr><td>Working rate</td><td>3 quanta/s</td></tr><tr><td>Retrial rate</td><td>20</td></tr><tr><td>Active breakdowns rate</td><td>10<sup>-5</sup></td></tr><tr><td>Idle breakdowns rate</td><td>10<sup>-6</sup></td></tr><tr><td>Repair rate</td><td>0.5</td></tr><tr><td>Sleeping rate</td><td>0.03</td></tr><tr><td>Awakening rate</td><td>0.6</td></tr></tbody></table>

### 6.2.1 | Influence of energy harvesting rate

378 Energy harvesting (EH) rate depends on the area where the network will be deployed. If the responsible of network deployment has the choice between several areas with different harvesting rates, it can determine the suitable configuration for each area. By varying the energy harvesting rate and then monitoring the network behavior, we obtained the following results:

383 Figure 8 illustrates the influence that EH has on the mean response time. When the EH rate increases (that is, the time to harvest one quantum gets smaller), the mean response time decreases. We can notice that the mean response time remains almost constant at the value 0.06 seconds until the harvesting rate reaches one quantum per second. Then, it decreases from the value 10 to the value 100 reaching half of its initial value (≈ 0.03).

388 Figure 9 shows the impact of EH on the mean battery charge. When the harvested-energy-per-second is less than one quantum, the mean battery energy is almost stable around 30%, then, it starts to grow. When it reaches 10 quanta per second, the harvested energy is sufficient to maintain the amount of energy above one-half of full capacity.

394 Figure 10 describes the utilization of the transceiver and the repairer versus the EH rate. The transceiver is the
<figure><img src="image_10.png" /><figcaption>**FIGURE 8** Mean response time versus harvesting rate</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>**FIGURE 9** Mean Battery charge versus harvesting rate</figcaption></figure>

395

396

397

398

399

400

communication unit of the sensor node. It is responsible of receiving and sending messages (see the SN architecture in Figure 1). The repairer represents the sensor maintenance function which is modeled in our GSPN by the presence of the *Repair* transition. This function is supposed to be the duty of the harvesting system. Indeed, most of sensor breakdowns stems from battery over (see subsection 3.1) and therefore, each reparation is done by recharging the sensor's battery to let it leave the *Down* state. We notice that the utilization of both transceiver and repairer are almost equal to zero when the harvesting rate is less than *one* quantum. In this case, the SN is on standby most of
<figure><img src="image_12.png" /><figcaption>**FIGURE 10** Transceiver and repairer utilization versus harvesting rate</figcaption></figure>

the time in order to preserve energy. As it is mentioned in the description of our proposed model, we defined two thresholds $T1$ and $T2$. If the energy becomes below $T1$, the SN joins the sleeping state immediately, and it stays there until the energy becomes equal or greater than $T2$ due to the EH. After that, the utilization increases until it reaches the value 30% for the transceiver, and the value 15% for the repairer where they both stabilize.

In a nutshell, the last three figures depict the system behavior according to energy recovery from the ambient. More energy is recovered involves fast message serving and good use of resources. For instance, if we choose a deployment territory that permits to harvest more than 10 quanta per second, the level of battery charge will not fall below 50%, and we will be using no more than 30% of the transceiver capability and 15% of the repairer to serve messages in 0.04 second.

## 6.2.2 | Influence of Sleep/Awake ratio

Setting the sleep/Awake (SA) ratio is a key performance feature. Indeed, in order to save energy, an SN that was idle for a long time requires to enter the sleep state. This will in addition enhance the efficiency of the harvesting process. However, when sleeping, the SN misses calls from its neighbors, which will eventually require for them to do several recalls before delivering their messages. Therefore, by following the same previous procedure, we can search for the most suitable SA ratio.

Figure 11 shows the SA effect on the amount of energy stored in the SN battery. SA ratio induces the maximum time an SN will stay listening. For example, a 0.03 sleeping rate means the SN will go to sleep if there is no message to serve after one minute. We notice that the mean battery charge remains constant at 30% when the sleep/awake ratio is below 0.03 (which means the sensor is active most of the time). After that, the mean charge grows until the battery becomes fully charged (This happens when the SA ratio exceeds 10). In another hand, with a sleeping rate
<figure><img src="image_13.png" /><figcaption>**FIGURE 11** Mean battery charge versus Sleep/Awake ratio</figcaption></figure>

423

424

425

426

427

equal to 0.03 and an awaking rate equal to 0.003, we have an SA ratio equal to 10. With these values the mean energy charge equals 98%. In this case, if the sensor enters the sleeping state, it will stay there for almost 6 minutes before awaking. This configuration gives a mean response time equal to 0.61 second as it is depicted in Figure 12. Hence, if such a performance does not fulfil the network duty requirement, and we seek for a faster one, we have to choose a configuration that allows the sensors to stay active for a longer time.

<figure><img src="image_14.png" /><figcaption>**FIGURE 12** Mean response time versus Sleep/Awake ratio</figcaption></figure>
<figure><img src="image_15.png" /></figure>

<figure><img src="image_16.png" /></figure>

<figure><img src="image_17.png" /></figure>

<figure><img src="image_18.png" /></figure>

From Figure 12, we notice that the curve of mean response time has an inflection point whose SA value is different from 1. In fact, the vertical line that passes by 1 divides the curve into two parts: fast configuration (SN awakes most of the time) and slow configuration (SN sleeps most of the time). Therefore, the gain in response time grows before this edge value but slows at the value ≈ 1.7.

<figure><img src="image_19.png" /><figcaption>**FIGURE 13** Transceiver and repairer utilization versus Sleep/Awake ratio</figcaption></figure>

<figure><img src="image_20.png" /></figure>

<figure><img src="image_21.png" /></figure>

<figure><img src="image_22.png" /></figure>

Concerning the transceiver and the repairer utilization, we got the results depicted in Figure 13. It is clear that in the fast configuration, we have a relatively great utilization for both of the transceiver (average of 15%) and the repairer (average of 8%) in comparison to the fast part (very small percentage of utilization).

<figure><img src="image_23.png" /></figure>

### 6.2.3 | Influence of retrial rate

<figure><img src="image_24.png" /></figure>

<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /></figure>

When an SN does not find an idle neighbor to communicate with it, it has to wait a little bit before doing another sending attempt so as not to exhaust its energy. This waiting time defines the retrial rate (RR). By varying RR, we obtained the following results:

<figure><img src="image_27.png" /></figure>

<figure><img src="image_28.png" /></figure>

<figure><img src="image_29.png" /></figure>

<figure><img src="image_30.png" /></figure>

<figure><img src="image_31.png" /></figure>

Figure 14 describes its impact on the mean battery charge. As expected, if RR increases, the mean battery charge decreases. But when RR reaches the value 0.16 the mean battery charge stabilizes at the value 32.5% which is greater than the go-to-sleep barrier by more than 20%. Therefore, if the network application requirement can afford a smaller mean battery charge value, we can then use a smaller threshold.

<figure><img src="image_32.png" /></figure>

<figure><img src="image_33.png" /></figure>

<figure><img src="image_34.png" /></figure>

<figure><img src="image_35.png" /></figure>

<figure><img src="image_36.png" /></figure>

Figure 15 illustrates RR's impact on the mean response time. As expected, when the time between two attempts is tightened, the mean response time decreases. However, starting from the RR value 1.5, there is no mean response time improvement. Therefore, increasing RR above this value and expecting to get a faster network, will be a complete waste of energy.

<figure><img src="image_37.png" /></figure>

<figure><img src="image_38.png" /></figure>

Figure 16 depicts the use of the transceiver for several RR values. We notice that the more we tighten the time between call attempts, the more we use the transceiver, because it is the main responsible of the sending process.
<figure><img src="image_39.png" /><figcaption>**FIGURE 14** Mean battery charge versus retrial rate</figcaption></figure>

<figure><img src="image_40.png" /><figcaption>**FIGURE 15** Mean response time versus retrial rate</figcaption></figure>

451

452

However, the utilization gain stops short at the value 13.2% because abusing with retrial attempts exhausts the battery, and the sensor will directly flip into a sleeping state where it won't be able to send anymore.

453

### 6.2.4 | Influence of failures rate

454

455

456

SN breakdowns phenomenon is an undesirable feature because it hinders the performance of the network. We can partially cope with it by avoiding the reason of failure. In WSNs, most breakdowns stem from the expiration of battery charge. Therefore, harvesting energy from the ambient involves a decrease of breakdown probability, which enhances
<figure><img src="image_41.png" /><figcaption>**FIGURE 16** Transceiver utilization versus retrial rate</figcaption></figure>

457

the overall network performance. By changing the failure rate (FR) we got the following results:

458

<figure><img src="image_42.png" /><figcaption>**FIGURE 17** Mean battery charge versus failure rate</figcaption></figure>

459

Figure 17 allows us to study the FR effect on the mean battery energy. Broadly speaking, when FR increases, the mean battery charge drops. Indeed, the SN not finding neighbors to forward its message, keeps attempting until it succeeds. Furthermore, the busy breakdowns restart all the process of sending, which directly affects the amount of energy stored in the battery.

460

461

462

463

Remember that in our modeling, we opted for the more general discipline of dependent breakdowns. That is, we
464

465

466

467

468

469

can have two kinds of breakdowns: active (busy) or idle, and their related probabilities are not necessary the same. In addition, for the failure transition, we consider the strategy of infinite server, which means that each sensor may be down independently from the others. Furthermore, we defined a threshold that prevents the SNs from exhausting their batteries. In our experiments, we set $T1$ to 20% and $T2$ to 40%. For this reason, we can see in Figure 17 only a small variation, when we increase FR.

470

471

472

473

474

Figure 18 illustrates the effect of FR on the mean response time. For example, if $FR = 10^{-3}$, which implies that the neighbor battery charge drops to 20% between 3 and 4 times per hour, the mean response time nears 0.06 second. We notice that for a relatively long delay between two breakdowns, the mean-response-time is very small. This later remains stable at 0.06 second until FR reaches the value 10 where the mean-response-time starts to grow.

<figure><img src="image_43.png" /><figcaption>FIGURE 18 Mean response time versus failures rate</figcaption></figure>

475

476

477

478

479

Figure 19 depicts the behavior of the transceiver and the repairer. A high utilization of the transceiver (above 30%) is noticeable when FR is smaller than 0.3. In contrast to the transceiver behavior, the more there is breakdowns, the more the repairer is solicited. We notice that the two curves intersect at an FR equal to 2. After this value, where both utilizations of the transceiver and the repairer equal 10%, the situation is inverted.

480

## 6.2.5 | Influence of daily-message number

481

482

483

We analyzed the model by varying the daily number of messages (noted $N$) served by an SN. Figure 20 illustrates the obtained results. We notice that the mean energy decreases when $N$ increases until it reaches 73% for 300 daily messages. Therefore, serving packets significantly affects the residual energy.

484

Further experiments can be conducted by considering other input parameters such as:
<figure><img src="image_44.png" /><figcaption>**FIGURE 19** Transceiver and repairer utilization versus Failures rate</figcaption></figure>

<figure><img src="image_45.png" /><figcaption>**FIGURE 20** Mean battery charge versus daily message number</figcaption></figure>

485 • Number of neighbors.

486 • Values of the two thresholds T1 and T2.

487 • Battery capacity.

488 • Number of neighbors.
## 6.3 | Case study

To further stress the proposed GSPN's ability to assess the feasibility and identify the requirements for setting a solar energy harvesting WSN on an actual situation, we consider the case of deploying a network in the Algerian territory. The utility of setting WSNs in Algeria which is the biggest country in Africa does not need to be proven. Indeed, in the north, WSNs can be used, for example, to handle forest fires. In the south, they can be used to help fighting locust invasion or for security concerns. Each of these possible applications has quite different requirements that govern the feasibility of a network deployment.

Due to its geographical location, Algeria has one of the highest solar deposits in the world [45]. The duration of insolation over almost the entire national territory exceeds 2000 hours annually and can reach 3900 hours (highlands and Sahara). Figure 21 shows that the daily energy received on a horizontal surface of $1m^2$ is of the order of 5 KWh over most of the national territory, with nearly 1700 $KWh/m^2/year$ in the north and 2263 $KWh/m^2/year$ in the south of the country.
A sensor equipped with a solar panel of $10cm^2$ can receive $5wh$ per day. Table 5 shows features of the network we consider in our case study.

<table><caption>TABLE 5 Wireless sensor network case study features.</caption><thead><tr><td>Parameter</td><td>Value</td></tr></thead><tbody><tr><td>Mean number of neighbors for each SN</td><td>5</td></tr><tr><td>Sensor battery capacity</td><td>5wh</td></tr><tr><td>Mean daily message number</td><td>100</td></tr><tr><td>Surface of solar panel</td><td>10Cm<sup>2</sup></td></tr></tbody></table>

A message transfer consumes the highest amount of energy in comparison with other activities in the network [7]. According to [46], a sensor consumes:

* 3 $mw$ in the active state (message sending).

* 98 $\mu w$ in the idle state.

* 15 $\mu w$ in the sleeping state.

The daily energy to be consumed by a sensor is the sum of the energies in idle state ($E_i$), sleeping state ($E_s$) and active state ($E_a$), such that:

$$E_i = \bar{\omega} \cdot \frac{1}{\theta} \cdot 98.10^{-06} (wh) \qquad (15)$$

$$E_s = \bar{\theta} \cdot \frac{1}{\omega} \cdot 15.10^{-06} (wh) \qquad (16)$$
<figure><img src="image_46.png" /><figcaption>FIGURE 21 Algeria solar map [45]</figcaption></figure>

$$E_a = \bar{R} \cdot N \cdot 3.10^{-03} (\text{wh}) \qquad (17)$$

513

Where:

$\bar{\omega}$, $\bar{\theta}$ are the debits of the transitions awake, Go_sleep given by eq.(10) and (11) respectively, and $\bar{R}$ is given by eq.(13). N is the mean number of messages per sensor and per day.

First, we define the parameter sleep/awake (SA) by the ratio (sleeping delay/idle delay). Figure 22 illustrates the effect of SA on the mean response time. This later decreases when the sensors stay in idle state during a long time aiming at serving messages upon their arrivals. Due to energy harvesting, we can increase the sensor listening time in order to serve requests immediately, and consequently decrease the mean response time.

In order to show that our model allows to determine the suitable parameter (sleep/idle) delay ratio for each territory, we vary the sleeping and the idle delays, and we calculate the daily energy consumption. Figure 23 shows the daily energy consumption versus SA.

For example, if we configure the sensors in a way to stay one minute in the idle state and 8 minutes in the sleeping state, then the daily energy consumption will be equal to $5wh$. This means that this configuration is appropriate to the Sahara territory but not suitable for the north if we compare this result with figure 21 to ensure the liveliness of the network. From the threshold $7.6wh$, the configuration becomes not suitable for any Algerian territory since the biggest possible solar energy harnessing is $7.2wh/m^2$ (see Figure 21 and note that $kwh/m^2$ is equiv to $wh/dm^2$).

One can argue that when the sensor is awake most of the time, it is supposed to consume more energy, but the opposite is noticeable. Indeed, minimizing response time saves energy better than adopting a sleeping mechanism. It is therefore important to keep the network's monitoring service awaken as long as possible.

532

533

Figure 24 represents the battery level status during one month for several values of the daily message number.
<figure><img src="image_47.png" /><figcaption>**FIGURE 22** Mean response time versus sleep/idle ratio</figcaption></figure>

<figure><img src="image_48.png" /><figcaption>**FIGURE 23** Daily energy consumption</figcaption></figure>

534 We fed the model with the following values:

535 • Sleeping time: 2 minutes,

536 • Awakening time: 1 minute,

537 • Harvesting rate for Algiers province: 0.0139 quantum per second (one quantum /minute),

538 • Capacity: 100 quanta,

539 • $T1 = 20\%$ and $T2 = 40\%$,

540 • Neighbors number: 3,

541 • Working rate: 0.016 quantum per second,

542 • Retrial rate: 1,
543 • Active breakdowns rate: $10^{-4}$,

544 • Idle breakdowns rate: $10^{-6}$,

545 • Repair rate: 0.5,

<figure><img src="image_49.png" /><figcaption>FIGURE 24 Battery charge versus daily message number during one month</figcaption></figure>

546 This experiment shows the capability of the model to analyze different types of WSNs in terms of density and number of served packets. We notice that the daily number of messages affects the energy level. For example, in the case of a WSN with dense traffic (N=300 messages per sensor and per day), the energy level is around 72%. Hence, the selected configuration guarantees a continuous service for this WSN.

550

551 By setting the number of daily messages at (N = 100), and by varying the number of neighbors (s), we obtained the results depicted in Figure 25. We notice that the number of neighbors does not affect the battery charge. It seems that when the number of neighbors increases or decreases, it will affect the rapidity of the system instead of the battery charge.

552

553

554

## 7 | CONCLUSION

555

556 In this paper, we proposed a Generalized Stochastic Petri Net to model the communication between a sensor and its neighbors in a Wireless Network. The model takes into account different real aspects such as sleeping mechanism, retrial message attempts, battery recharge/discharge and battery-over breakdowns.

557 By using the TimeNet tool, several numerical results and diagrams are presented and discussed to show the influence of different input parameters on the network performance.

558 A case study is given to analyze the requirements for installing a Wireless Sensor Network (WSN) in Algeria, by taking into account the solar energy harvesting capabilities in different territories Algeria.

559 The proposed model proves to be able to address the trade-off between performance parameters and lifetime of sen-
<figure><img src="image_50.png" /><figcaption>FIGURE 25 Battery level versus neighbors number</figcaption></figure>

564 sor nodes for deciding which input parameter to adjust in order to get the best performance of the Energy-Harvesting WSN.

566

567 In our future works we will be focusing on including other important circumstances to our modeling, such as the difference between message types, neighbor vicinity and sensor mobility.

568

569 references

570 [1] Basagni S, Naderi MY, Petrioli C, Spenza D. Wireless sensor networks with energy harvesting. Mobile Ad Hoc Networking: Cutting Edge Directions 2013;p. 701-736.

571

572 [2] Kandris D, Nakas C, Vomvas D, Koulouras G. Applications of wireless sensor networks: an up-to-date survey. Applied System Innovation 2020;3(1):14.

573

574 [3] Sudevalayam S, Kulkarni P. Energy harvesting sensor nodes: survey and implications. IEEE Communications Surveys and Tutorials 2011;13(3):443-61.

575

576 [4] Ye W, Heidemann J, Estrin D. Medium access control with coordinated adaptive sleeping for wireless sensor networks. IEEE/ACM Transactions on Networking (ToN) 2004;12(3):493-506.

577

578 [5] Ali M, Böhm A, Jonsson M. Wireless sensor networks for surveillance applications-a comparative survey of mac protocols. IEEE; 2008. p. 399-403.

579

580 [6] Ashraf N, Faizan M, Asif W, Qureshi HK, Iqbal A, Lestas M. Energy management in harvesting enabled sensing nodes: Prediction and control. Journal of Network and Computer Applications 2019;132:104-117.

581

582 [7] Bahi J, Elghazel W, Guyeux C, Hakem M, Medjaher K, Zerhouni N. Reliable diagnostics using wireless sensor networks. Computers in Industry 2019;104:103-115.

583
[8] Le K, Cao T, Le P, Pham B, Bui T, Quan T. Probabilistic congestion of wireless sensor networks: a coloured petri net based approach. Communications on Applied Electronics 2017;7(2):1-7.

[9] Younes OS. Modeling and performance analysis of a new secure address resolution protocol. International Journal of Communication Systems 2018;31(1):e3433.

[10] Zimmermann A. Stochastic Discrete Event Systems Modeling, Evaluation, Applications. Berlin, Heidelberg: Springer-Verlag; 2007.

[11] Oukas N, Boulif M. Sensor Performance Evaluation for Long-Lasting EH-WSNs by GSPN Formulation, Considering Seasonal Sunshine Levels and Dual Standby Strategy. Arabian Journal for Science and Engineering 2022;p. 1-15.

[12] Li J, Dai J, Issakhov A, Almojil SF, Souri A. Towards decision support systems for energy management in the smart industry and Internet of Things. Computers & Industrial Engineering 2021;161:107671.

[13] Shojafar M, Pooranian Z, Abawajy JH, Meybodi MR. An efficient scheduling method for grid systems based on a hierarchical stochastic Petri net. Journal of computing science and engineering 2013;7(1):44-52.

[14] Shojafar M, Pooranian Z, Meybodi MR, Singhal M. ALATO: an efficient intelligent algorithm for time optimization in an economic grid based on adaptive stochastic Petri net. Journal of intelligent manufacturing 2015;26(4):641-658.

[15] Farooq MS, Idrees M, Rehman AU, Khan MZ, Abunadi I, Assam M, et al. Formal Modeling and Improvement in the Random Path Routing Network Scheme Using Colored Petri Nets. Applied Sciences 2022;12(3):1426.

[16] Shi L, Du S, Miao Y, Lan S. Modeling and performance analysis of satellite network moving target defense system with Petri nets. Remote Sensing 2021;13(7):1262.

[17] Azgomi MA, Khalili A. Performance evaluation of sensor medium access control protocol using coloured petri nets. Electronic Notes in Theoretical Computer Science 2009;242(2):31-42.

[18] Shi Zs, Wang Cf, Zheng P, Wang Hy. An energy consumption prediction model based on GSPN for wireless sensor networks. In: 2010 International Conference on Computational and Information Sciences IEEE; 2010. p. 1001-1004.

[19] Yadollah zadehTabari M, Mohammadizad P. Modeling and Performance Evaluation of Energy Consumption in S-MAC Protocol Using Generalized Stochastic Petri Nets. International Journal of Engineering 2020;33(6):1114-1121.

[20] Lacerda B, Lima PU. Petri nets as an analysis tool for data flow in wireless sensor networks. In: 1st Portuguese Conference on WSNs, Coimbra, Portugal Citeseer; 2011. p. 1-6.

[21] Zairi S, Mezni A, Zouari B. Formal approach for modeling, verification and performance analysis of wireless sensors network. In: International Conference on Wired/Wireless Internet Communication Springer; 2015. p. 381-395.

[22] Bechar R, Tahar Abbes M, Mezzoudj F, Bellatreche L. On formal modeling and validation of wireless sensor network protocols. Wireless Personal Communications 2020;114(4):2855-2888.

[23] Dahiya R, Arora A, Singh V. Modelling the energy efficient sensor nodes for wireless sensor networks. Journal of The Institution of Engineers (India): Series B 2015;96(3):305-309.

[24] Bérczes T, Almási B, Kuki A, Sztrik J, Kakubava R. Modeling the performance and the energy usage of wireless sensor networks by retrial queueing systems. In: Proceedings of the 8th ACM workshop on Performance monitoring and measurement of heterogeneous wireless and wired networks ACM; 2013. p. 133-138.

[25] Wüchner P, Sztrik J, de Meer H. Modeling wireless sensor networks using finite-source retrial queues with unreliable orbit. In: International Workshop on Performance Evaluation of Computer and Communication Systems Springer; 2010. p. 73-86.
622 [26] Gharbi N, Charabi L. Wireless networks with retrials and heterogeneous servers: Comparing random server and fastest free server disciplines. Int J Adv Networks Serv 2012;5(1-2).

624 [27] Boutoumi B, Gharbi N. Two Thresholds Working Vacation Policy for Improving Energy Consumption and Latency in WSNs. In: International Conference on Queueing Theory and Network Applications Springer; 2018. p. 168-181.

626 [28] Oukas N, Boulif M. A petri net modeling for WSN sensors with renewable energy harvesting capability. In: International Conference in Artificial Intelligence in Renewable Energetic Systems Springer; 2019. p. 524-534.

628 [29] Oukas N, Boulif M, Hadiouche H, Bengharabi C. A New Petri Nets for WSNs to Model the Behaviour of Solar-Energy Harvesting Sensors with Double Sleeping Strategy. In: 2022 2nd International Conference on Computing and Information Technology (ICCIT) IEEE; 2022. p. 237-242.

630 [30] Oukas N, Boulif M. A New Generalised Stochastic Petri Nets Modelling for Solar Energy Harvesting Sensors in Long Lasting WSNs, Considering Seasonal Sunshine Levels. In: Proceedings of The International Conference on Advances in Communication Technology, Computing and Engineering (ICACTCE) Meknes, Morocco; 2021.

634 [31] Oukas N, Boulif M. Generalized Stochastic Petri Nets Modelling for Energy Harvesting WSNs considering Neighbors with different Vicinity Levels. In: 2020 International Conference on Computing and Information Technology (ICCIT-1441) IEEE; 2020. p. 1-5. 10.1109/ICCIT-144147971.2020.9213781.

637 [32] Oukas N, Boulif M. A Colored Petri Net to Model Message Differences in Energy Harvesting WSNs. In: Proceedings of The 4th Conference on Computing Systems and Applications Ecole Militaire Polytechnique - Chahid Abderrahmane Taleb (EMP), Algiers, Algeria; 2020.

640 [33] Oukas N, Boulif M. Modeling and Assessment of Energy Harvesting WSNs with Unreliable Sensors for Military Applications. In: International Conference on Autonomous Systems and their Applications (ICASA 22), University of Eltaref-Algeria; 2022.

643 [34] Murata T. Petri nets: Properties, analysis and applications. Proceedings of the IEEE 1989;77(4):541-580.

644 [35] Peterson JL. Petri net theory and the modeling of systems 1981.

645 [36] Marsan MA, Balbo G, Conte G, Donatelli S, Franceschinis G. Modelling with generalized stochastic Petri nets. John Wiley & Sons, Inc.; 1994.

647 [37] Florin G, Fraize C, Natkin S. Stochastic Petri nets: Properties, applications and tools. Microelectronics Reliability 1991;31(4):669-697.

649 [38] Baccelli F. Ergodic theory of stochastic Petri networks. The Annals of Probability 1992;p. 375-396.

650 [39] Shaikh FK, Zeadally S. Energy harvesting in wireless sensor networks: A comprehensive review. Renewable and Sustainable Energy Reviews 2016;55:1041-1054.

652 [40] Mandru NP. Optimal power management in wireless sensor networks for enhanced life time. Journal of Global Research in Computer Science 2012;3.

654 [41] Almási B, Roszik J, Sztrik J. Homogeneous finite-source retrial queues with server subject to breakdowns and repairs. Mathematical and Computer Modelling 2005;42(5-6):673-682.

656 [42] Roszik J, Sztrik J. Performance analysis of finite-source retrial queues with nonreliable heterogeneous servers. Journal of Mathematical Sciences 2007;146(4):6033-6038.

658 [43] Gharbi N, Ioualalen M. GSPN analysis of retrial systems with servers breakdowns and repairs. Applied Mathematics and Computation 2006;174(2):1151-1168.
[44] Zimmermann A. Modelling and performance evaluation with TimeNET 4.4. In: International Conference on Quantitative Evaluation of Systems Springer; 2017. p. 300–303.

[45] Yaiche M, Bouhanik A, Bekkouche S, Malek A, Benouaz T. Revised solar maps of Algeria based on sunshine duration. Energy Conversion and Management 2014;82:114–123.

[46] Hurni P, Braun T. Calibrating wireless sensor network simulation models with real-world experiments. In: International Conference on Research in Networking Springer; 2009. p. 1–13.