# Mathematical Model with Energy and Clustering Energy Based Routing Protocols as Remediation to the Directional Source Aware Routing Protocol in Wireless Sensor Networks

Samir Haddad, Jinane Sayah, Bachar El-Hassan, Chadi Kallab, Mohamad

Chakroun, Nisrine Turkey, Jinan Charafeddine, Hani Hamdan

► To cite this version:

Samir Haddad, Jinane Sayah, Bachar El-Hassan, Chadi Kallab, Mohamad Chakroun, et al.. Mathematical Model with Energy and Clustering Energy Based Routing Protocols as Remediation to the Directional Source Aware Routing Protocol in Wireless Sensor Networks. Wireless Sensor Network, 2022, 14 (02), pp.23-39. 10.4236/wsn.2022.142002. hal-03784326

HAL Id: hal-03784326

https://hal.science/hal-03784326

Submitted on 6 Jun 2023

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.

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

Distributed under a Creative Commons Attribution 4.0 International License
# Mathematical Model with Energy and Clustering Energy Based Routing Protocols as Remediation to the Directional Source Aware Routing Protocol in Wireless Sensor Networks

Samir Haddad<fnref n="1" />, Jinane Sayah<fnref n="2" />*, Bachar El-Hassan<fnref n="3" />, Chadi Kallab<fnref n="1" />, Mohamad Chakroun<fnref n="4" />, Nisrine Turkey<fnref n="5" />, Jinan Charafeddine<fnref n="6" />, Hani Hamdan<fnref n="7" />

**How to cite this paper:** Haddad, S., Sayah, J., El-Hassan, B., Kallab, C., Chakroun, M., Turkey, N., Charafeddine, J. and Hamdan, H. (2022) Mathematical Model with Energy and Clustering Energy Based Routing Protocols as Remediation to the Directional Source Aware Routing Protocol in Wireless Sensor Networks. *Wireless Sensor Network, 14*, 23-39.

https://doi.org/10.4236/wsn.2022.142002

Received: January 3, 2022

Accepted: February 25, 2022

Published: February 28, 2022

Copyright © 2022 by author(s) and
Scientific Research Publishing Inc.
This work is licensed under the Creative
Commons Attribution International
License (CC BY 4.0).

http://creativecommons.org/licenses/by/4.0/

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

Open Access

## Abstract

In this paper, a routing protocol for wireless sensor network, baptized energy based protocol (EBP) is proposed. Wireless sensor network presents many challenges and constraints, and one of the major constraints is the routing problem. Due to the limited energy of sensor nodes, routing in this type of network shall perform efficiently to maximize the network lifetime. One of the proposed algorithms is the directional source aware routing protocol (DSAP) which, after simulation, showed a lot of limitations and drawbacks. The modified directional source aware routing protocol (MDSAP) was proposed by the authors of this paper to address some of the DSAP's limitations but remains limited to a fixed topology, fixed source and stationary nodes. So EBP is proposed and operated under different scenarios and showed, after its simulation using TinyOS, many advantages in terms of load balancing, free looping, minimizing packet error rate and maximizing network lifetime.

## Keywords

Cluster, DSAP, Energy, MDSAP, Routing, Sensor Network, Topology, Energy Based Protocol

<footnote n="1">¹Faculty of Arts and Sciences, Department of Computer Science and Mathematics, University of Balamand, Koura, Lebanon</footnote>

<footnote n="2">²Issam Fares Faculty of Technology, Department of Telecom and Networks, University of Balamand, Koura, Lebanon</footnote>

<footnote n="3">³Faculty of Engineering Branch 1, Department of Electricity and Electronics, Lebanese University, Lebanon</footnote>

<footnote n="4">⁴Faculty of Computer Science and Electrical Engineering, The University of Rostock, Rostock, Germany</footnote>

<footnote n="5">⁵Faculty of Engineering, Notre Dame University, Lebanon</footnote>

<footnote n="6">⁶Université Paris-Saclay, Pôle scientifique et technologique de Vélizy, Laboratoire d'Ingénierie des Systèmes de Versailles (LISV EA4048), Vélizy, France</footnote>

<footnote n="7">⁷Université Paris-Saclay, CentraleSupélec, CNRS, Laboratoire des Signaux et Systèmes (L2S UMR CNRS 8506), Gif-sur-Yvette, France
Email: samir.haddad@balamand.edu.lb, *jinane.sayah@balamand.edu.lb, bachar_elhassan@ul.edu.lb, chadi.kallab@fty.balamand.edu.lb, Mohamad.chakroun@gmail.com, nturkey@ndu.edu.lb, jinan.charafeddine@lisv.uvsq.fr, Hani.Hamdan@centralesupelec.fr</footnote>
# 1. Introduction

A sensor is a little tiny battery-powered device that can sense, compute and communicate. The envisaged size of a single sensor node can vary from a shoe-box-sized node down to the size of a grain of dust. That's why it's also called a "Smart Dust" [1]. For efficient monitoring, sensing, capturing and thereafter sending and transferring the information, a set of sensors must interconnect, communicate and transfer the sensed data; this group forms a sensor network. Wireless sensor networks (WSN) are complex distributed systems of nodes with data sensing, processing, storage capability and wireless-communication interfaces. They have a wide variety of applications and are becoming more and more utilized in our daily lives. Examples of these applications include but are not limited to tracking vehicles and traffic movement on roads, monitoring a forest for fires, finding and tracking soldiers in military applications, monitoring oceans and seas, and smart spaces ... [2]. They are also used in medical applications, hospitality services, etc.

Previously, sensor networks consisted of small number of sensor nodes that were wired to a central processing station [3]. However, nowadays, the focus is more on wireless, distributed, sensing nodes. However, WSNs present many constraints; the major ones are energy efficiency, localization and routing. The paper will focus on the routing aspect of WSN.

This paper is organized as follows. After a brief introduction, section 2 briefs the principle of both the DSAP and MDSAP [4] routing protocols used in WSNs and highlights their respective limitations. In section 3, the new EBP protocol is proposed. CEB-P is introduced in section 4. Section 5 discusses a new mathematical model to optimize the distribution of sensor nodes in a wireless sensor network. Finally, section 6 goes over the main points and outlines our future research.

# 2. Directional Source Aware Routing Protocol (DSAP) and Modified DSAP

## 2.1. DSAP and MDSAP Principles

DSAP is a routing protocol that depends on the local information available from the neighbors of the transmitting node [5]. It is based on the idea of directional routing where each node needs to know the direction of the destination so it can forward the packet in that direction.

Two algorithms for DSAP have been proposed. The first one deals with the directional value as a metric to be used to find the final destination. The second one uses the directional value and a power aware metric to route the packet to the final destination. This is achieved by considering the maximum available power and minimal directional value in the node route selection.

The two existing types of the DSAP algorithm present many disadvantages: in the power aware case, sometimes the source chooses the path with the maximum power even if it's not the shortest path. On the other hand, the power of the sensor will decrease while passing through it. This can lead to an unacceptable
situation because some nodes will lose their power faster than other nodes. Also, sometimes the source are not obliged to take the path with maximum power. It can take the shortest path and leave the path with maximum power available and ready for use in case an urgent event happens.

A more reliable protocol, a modified version of the DSAP protocol noted MDSAP, was proposed making a compromise between the shortest path and the maximum power [6]. In MDSAP, the messages exchanged between the different sensor nodes are divided into three categories [7]: Low priority messages, high priority messages (urgent messages) and medium priority messages, and each type of messages will be treated and routed differently.

## 2.2. Limitations of DSAP and MDSAP

DSAP and MDSAP were simulated using OMNeT++, a network simulator useful for debugging, for illustration and performance evaluation purposes. The results showed that, in MDSAP [2], the lifetime of the network increases by 22% when using only high priority messages, 55% with medium priority, 77% with low priority and 88% with random priority when it is compared with the regular DSAP.

Even though the MDSAP showed better results than DSAP, there are still some important limitations that need to be considered.

1. The network topology is assumed static: grid architecture allows the calculation of the directional values of each node. A possible enhancement would be the proposition of a dynamic ad-hoc network; this topology can be adequate in some applications where non fixed network nodes (mobile nodes) are needed.

2. The classification of messages into categories based on priorities might not be needed in some applications where all messages should be equal in priority.

3. The problem of the barrier nodes at the destination proximity. Whatever is the technique used to send the information from the source to the destination, a message will not be able to reach the destination when all the neighbors are down.

To address all these, a new algorithm noted energy based protocol (EBP) was proposed. EBP is presented in the next section along with its simulation, advantages and limitations.

## 3. Energy Based Protocol (EBP)

The main objective of EBP is to maximize the wireless sensor network lifetime. To achieve this, the hypothesis is to consider the fact of using, to the maximum, the power available at each sensor of the network.

EBP is based on the idea of distributing sensors with different levels of energy over an $N*N$ grid topology, so that the number of paths over the grid is *N*. This distribution is specified by EBP algorithm which will be described by a special case of a 5 * 5 grid topology, thus we have 5 paths.

The numbers shown in Figure 1 below define the level of energy that the sensor must have: 1 means $E_0$, 5 means $5 * E_0$ etc..., $E_0$ being the default sensor battery level.
First, the source and destination are specified as shown on the Figure 2 below. If the node has $L = 1$, it means the number of nodes on this diagonal is 1. To compute the level of energy at the source node, a simple mathematical operation is performed: $N/L = 5/1 = 5$, thus the energy is equal $5 \times E_0$. As for $L = 2$, two nodes exists, this first node from below has an energy $N/L = 5/2 = 2.5$, so the level of energy is the rounded value, thus it is Ceil (2.5) = 3. For the second node the operation is calculated by subtracting N from the level of energy of the first node, this process will fix the energy of this node to 2 (i.e. 5-3).

This operation is repeated on the remaining diagonals of the first half of the grid to reach $L = 5$ where all nodes will have energy $1 * E_0$.

As for the second part which is highlighted by the yellow color, it is a reverse symmetry of the first part going from $L = 4$ to reach the destination at $L = 1$.

Once an event is detected at the source, this information must be routed to the destination following the directional values process using EBP routing protocol.

## 3.1. Simulation of EBP Using TinyOs

TOSSIM [8], the simulator of TINYOS was chosen. This simulator provides

<figure><img src="image_3.png" /><figcaption>Figure 1. Sensors power distribution in a 5 × 5 network grid.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>Figure 2. The diagonals of EBP topology.</figcaption></figure>
direct interactions with the TinyOS enabled motes, i.e. with real sensor networks.

**Figure 3** shows the paths chosen to reach the destination using EBP protocol by respecting the directional value process already addressed in DSAP. The power of the nodes using this path will be decremented. For simplicity of calculation, the assumption is that each message will decrease the node's power by one. After establishing the first path and modify the energy accordingly, a second path is chosen.

## 3.2. Evaluation of EBP

In our EBP algorithm and after selecting all different paths, the simulation showed a drop down on all the nodes without leaving any missed energy. The network lifetime is maximized where each sensor's power is fully used. On the other hand, the algorithm overcomes the limitation of same type of priority and the barrier across the destination. In addition, all nodes and paths will be taken making the destination always reachable.

Even though EBP is a promising protocol and showed better performance in terms of energy and efficiency comparing with MDSAP, it is still difficult to apply in real-time environment. Three limitations still exist: the inability to apply different energy on each sensor according to the distribution assigned by the energy based protocol, inability to detect information from multiple sources and finally the grid topology itself.

In the next section, a modified version of EBP noted clustering energy based protocol (CEB-P) is proposed to simplify the implementation of such algorithm (EBP) and resolve the Energy level limitation. Multi-source and nodes mobility are described in next sections.

## 4. Clustering Energy Based Protocol

The clustering energy based protocol (CEB-P) [9] aims to physically distribute

<figure><img src="image_5.png" /><figcaption>**Figure 3.** Paths chosen to route messages in EBP.</figcaption></figure>
the number of sensors in one area called cluster to get the total power of the as-
signed value in one EBP node, having a fixed battery level for each cluster node
as shown in **Figure 4**. Clustering like LEACH [10] and other protocols [11] [12]
are needed because it is almost impossible, in real implementations, to control
each sensor battery level.

Suppose that we have a mote of index 5 and the energy of each deployed sen-
sor is 5, then the total energy at this mote is 25. To have this energy, a number of
motes of equal energy are placed together as shown in Figure 5. In addition, a
cluster head must be chosen and define a status for every mote (sleeping/Active).
Only the cluster head is active to transmit the message, while all other nodes in
the cluster are in a sleeping mode.

CEB-P needs to identify the level of energy needed at every node. Then, it
classifies the energy level of the sensor chosen for the application and computes
the number of sensors required. For example, if E₀ = 5 and if a sensor k is chosen
to have a value of 5, then we need 5 sensors in place of k to reach a total of ener-
gy of 5 * E₀ = 25.

After placing the sensors in a cluster, the cluster head must be set. To diffe-
rentiate between a cluster head and any other mote in a cluster, we have defined
a flag. If the flag is equal to one, then this mote is the cluster head and is the only
active mote in the cluster. All other motes will have a flag of zero and are thus in
a sleeping mode. When the cluster head sense any information and send the
message, it will change its status from Active to Sleep, thus changing its flag
from 1 to 0. The next mote in the cluster will then handle the responsibility of
becoming the cluster head and will take the id of the previous cluster head plus
one. For example in Figure 5, if mote 0 was the cluster head then mote 1 will be

<figure><img src="image_6.png" /><figcaption>Figure 4. Example of cluster in 5 × 5 network grid.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Figure 5. Example of cluster representation in CEB-P.</figcaption></figure>
next cluster head.

## Comparison of CEB-P with MDSAP and EBP

To illustrate the differences between the different protocols MDSAP, EBP and CEB-P, a comparison was made of their performances in terms of number of messages sent over the network, the energy used ratio (energy used over the total network energy) and energy lost ratio (energy lost over the total network energy). To achieve this, a series of simulations were made where seven parameters are to be determined:

* The grid topology (grid of 5 × 5, 6 × 6, 7 × 7...etc).

* The total number of nodes in the network: in MDSAP and EBP each node is constituted of one sensor; in MDSAP all the sensors have the same power level whereas in EBP each sensor has a different power level based on the architecture of EBP. In CEB-P, each node is constituted of many sensors to meet the total energy required by EBP in each node.

* The total network energy: it's the sum of the different power levels of all the sensors of the network

* Messages sent: the number of messages sent over the network before disaster. We are assuming that each message, while passing through a node, will decrease the total power of the node by 1.

* Energy used: it's the ratio of the energy used (consumed energy) to send the total number of messages over the total network energy.

* Energy lost: it's the remaining energy (remaining power at all nodes) after transmitting all the messages.

Here in Table 1, a comparison is made for the total number of messages sent in MDSAP, EBP and CEB-P before the network disaster (Figure 6). We can clearly notice that the highest number of messages sent is obtained with CEB-P.

In Figure 7, the energy used ratio in MDSAP, EBP and CEB-P is compared. The maximum optimization is obtained with EBP. However, as explained before, EBP could not be deployed in real scenarios. CEB-P shows a good energy used ratio compared to MDSAP while at the same time, CEB-P is able to transmit a higher number of messages than MDSAP.

# 5. Mathematical Model

## 5.1. Introduction

In wireless sensor networks, when the information is sent towards the destination, an important phenomenon is carried out: "the routing" which consumes a large quantity of energy where the transmission and the reception of the messages by a node also cost a considerable energy. However, these nodes are equipped of a small battery generally nonrenewable.

The major constraint in a wireless sensor network is the energy of the different nodes constituting this network: this energy determines the lifetime of the network. In other words, using efficiently the available energy maximizes the
<table><caption>Table 1. Summarizes the obtained results.</caption><thead><tr><th>Protocol</th><th>Grid</th><th>Network Energy</th><th>Energy per node</th><th>Messages sent</th><th>Energy used</th></tr></thead><tbody><tr><td rowspan="8">MDSAP</td><td>5 * 5</td><td>500,000</td><td>20,000</td><td>40,000</td><td>0.72</td></tr><tr><td>6 * 6</td><td>500,000</td><td>13,888</td><td>27,778</td><td>0.61</td></tr><tr><td>7 * 7</td><td>500,000</td><td>10,204</td><td>20,408</td><td>0.53</td></tr><tr><td>8 * 8</td><td>500,000</td><td>7813</td><td>15,625</td><td>0.47</td></tr><tr><td>9 * 9</td><td>500,000</td><td>6173</td><td>12,346</td><td>0.42</td></tr><tr><td>10 * 10</td><td>500,000</td><td>5000</td><td>10,000</td><td>0.38</td></tr><tr><td>15 * 15</td><td>500,000</td><td>2222</td><td>4444</td><td>0.26</td></tr><tr><td>30 * 30</td><td>500,000</td><td>556</td><td>1111</td><td>0.13</td></tr><tr><td rowspan="8">EBP</td><td>5 * 5</td><td>500,000</td><td>Variable</td><td>55,556</td><td>1</td></tr><tr><td>6 * 6</td><td>500,000</td><td>Variable</td><td>45,455</td><td>1</td></tr><tr><td>7 * 7</td><td>500,000</td><td>Variable</td><td>38,462</td><td>1</td></tr><tr><td>8 * 8</td><td>500,000</td><td>Variable</td><td>33,333</td><td>1</td></tr><tr><td>9 * 9</td><td>500,000</td><td>Variable</td><td>29,412</td><td>1</td></tr><tr><td>10 * 10</td><td>500,000</td><td>Variable</td><td>26,316</td><td>1</td></tr><tr><td>15 * 15</td><td>500,000</td><td>Variable</td><td>17,241</td><td>1</td></tr><tr><td>30 * 30</td><td>500,000</td><td>Variable</td><td>8475</td><td>1</td></tr><tr><td rowspan="8">CEB-P</td><td>5 * 5</td><td>780,000</td><td>Variable</td><td>60,000</td><td>0.69</td></tr><tr><td>6 * 6</td><td>805,556</td><td>Variable</td><td>55,556</td><td>0.76</td></tr><tr><td>7 * 7</td><td>806,122</td><td>Variable</td><td>40,816</td><td>0.66</td></tr><tr><td>8 * 8</td><td>828,125</td><td>Variable</td><td>39,063</td><td>0.71</td></tr><tr><td>9 * 9</td><td>808,642</td><td>Variable</td><td>30,864</td><td>0.65</td></tr><tr><td>10 * 10</td><td>820,000</td><td>Variable</td><td>30,000</td><td>0.70</td></tr><tr><td>15 * 15</td><td>811,111</td><td>Variable</td><td>17,778</td><td>0.64</td></tr><tr><td>30 * 30</td><td>896,667</td><td>Variable</td><td>8889</td><td>0.58</td></tr></tbody></table>

CEB-P vs. EBP and MDSAP.

network lifetime. For that, the use of a mathematical model (analytical) appears important to optimize the consumption of energy, thus increasing the lifespan of the network.

Different methods were proposed and some implemented to maximize the network lifetime. Some rely on the physical layer or MAC layer, others consider the routing aspect... The main objective of MDSAP, EBP and C-EBP routing protocols, proposed in previous sections of this article, is to efficiently use the available power in order to maximize the network lifetime and make the destination the most reachable.
<figure><img src="image_8.png" /><figcaption>Figure 6. Number of messages sent in MDSAP, EBP and CEB-P.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Figure 7. Energy used ratio in MDSAP, EBP and CEB-P.</figcaption></figure>

In this section, a new mathematical model which can be applied to a grid topology of WSNs is proposed.

## 5.2. Proposed Mathematical Model

Let us consider the linear case where all the nodes are placed next to each other.
as shown in Figure 8 below:

Here, each node transmits its own message and the messages of the precedent nodes. So, the noted node i means the number of messages transmitted by this node i.

The aim is to get a mathematical formula that consists of finding a relation between the distance, the network lifetime and the number of sent messages.

The mathematical terms are as follows:

* $r_i$ is the distance between the consecutive nodes i + 1 and i.

* $\propto(r_i)$ is the energy decrease of the node in function of the distance $r_i$, it is the energy lost per message.

* n is the network lifetime

* $\delta$ is a constant between 2 and 4 [13].

We also note $E_i^i$ or $E(i,t)$ the energy at time t on node i and $E_0^i$ the initial energy ($t_0$) on node i.

In general, we have:

$$ \propto(r_i) = r_i^{\delta} \quad 2 \le \delta \le 4 \quad (1) $$

In the below sections, three case will be elaborated. In the first case, the sensor nodes are uniformly distributed on a line. In the second, the wireless sensor nodes are set on a line in a random way. As for the third case, the nodes are set out again in the form of a grid on a rectangular ground.

In certain cases, we will try to find a well-defined relation which will enables us to find the distance between two successive nodes.

### 5.2.1. Uniform Distribution

Two variations in the linear uniform distribution are studied, in function of r and in function of t.

#### 1) Variation in function of r

Let us consider the interval $[r; r + dr]$. On this interval, N nodes numbered from 1 to N are distributed, where the first node is placed on the edge r and the Nth node on the edge $r + dr$.

The energy available on node N after N messages sent at time t is equal to:

$$ E(r + dr, t) = E_0 - N \propto (r) \quad (2) $$

The initial energy available on Node 1 at time t is equal to:

<figure><img src="image_10.png" /><figcaption>Figure 8. Linear model.</figcaption></figure>
$$E(r,t) = E_0 \qquad (3)$$

By substituting Equation (3) from Equation (2), we get

$$E(r+dr,t) - E(r,t) = E_0 - N\alpha(r) - E_0 = -N\alpha(r) \qquad (4)$$

By dividing Equation (4) by $dr$, we will have:

$$\frac{E(r+dr,t) - E(r,t)}{dr} = \frac{-N}{dr}\alpha(r) \qquad (5)$$

where $\alpha(r)$ indicates the decrease rate of the energy in function of the distance $r$.

From Equation (1), we have:

$$\alpha(r) = r_i^{\delta} \quad 2 \le \delta \le 4$$

If we set $\rho = \text{density of node on the interval } [r, r+dr]$, then Equation (4) implies:

$$\begin{gathered} E(r+dr,t) - E(r,t) = -\rho\alpha(r)dr \rightarrow \\ \frac{E(r+dr,t) - E(r,t)}{dr} = -\rho\alpha(r)dr \rightarrow \\ E(r+dr,t) - E(r,t) = -\rho\alpha(r)dr \end{gathered} \qquad (6)$$

By comparing Equation (5) to Equation (6), we get:

$$\frac{E(r+dr,t) - E(r,t)}{dr} = \frac{-N}{dr}\alpha(r) = -\rho\alpha(r) \qquad (7)$$

$$\text{where } \rho = \frac{N}{dr}$$

## 2) Variation in function of t

After sending $N$ message, the energy of each node is equal to $E_0 - N\alpha(r)$

Now, the calculation of the variation of the energy of a node between two times in the interval $[t, t+dt]$ is needed.

From Equation (4), we can conclude:

$$E(N,t+dt) - E(N,t) = -N\alpha(r)dt \qquad (8)$$

Let us note that each node sends the received messages and its own message i.e. that the $i$th node sends $(i-1)+1 = i$ messages; therefore one can notice that the number of the node is equal to the accumulation of messages.

At the same node, if we indicate by $E_{n+1}^i$ the energy of the $i$th node at the moment $n+1$ and $E_n^i$ its energy at moment $n$, we can have:

$$E_{n+1}^i = E_n^i - I\alpha(r)dt \qquad (9)$$

where $Idt$ = the number of messages

We finally have the following:

From Equation (7), we conclude that

$$\frac{E(r+dr,t) - E(r,t)}{dr} = \frac{\partial E}{\partial r} = -\rho\alpha(r) \qquad (10)$$

Or Equation (9) gives:
$$ \frac{E_{n+1}^i - E_n^i}{dt} = \frac{\partial E}{\partial t} = -I\alpha(r) = -\sum_i i\alpha(r) \quad (11) $$

By replacing the value of $\alpha(r)$ in Equation (11) by the value of Equation (10), we get:

$$ \frac{\partial E}{\partial t} = -\sum_i \frac{i}{p} \frac{\partial E}{\partial r} $$

where

$$ \sum_i i = \rho = \text{number of nodes} \quad (12) $$

So, Equation (12) results in having:

$$ \frac{\partial E}{\partial t} = \frac{\partial E}{\partial r} \quad (13) $$

Having the result in Equation (13), it is concluded that we achieved the same consumption if we take the case in function of time or distance to route the information from one node to another.

### 5.2.2. Non-Uniform Distribution

In this section of non-Uniform distribution [14], it is indicated by $r_i$ the distance between the $i^{th}$ node and the following node.

From Equation (1), we have

$$ \alpha(r_i) = r_i^{\delta} \quad 2 \le \delta \le 4 $$

#### 1) Variation according to the distance

From Equation (2), we can conclude that

$$ E(N,t) - E(1,t) = (E_0 - N\alpha(r_N)) = (E_0 - \alpha(r_i)) = \sum_{i=1}^{i=N} i\alpha(r_i) \quad (14) $$

#### 2) Variation according to time

If we look to the variation of energy in function of time and the position of the nodes while examining Equation (8), we can conclude that:

$$ E(i,t+dt) - E(i,t) = -i\alpha(r_i)dt $$

From Equation (11), we have:

$$ \frac{E_{n+1}^i - E_n^i}{dt} = \frac{\alpha E}{\alpha t} = -I\alpha(r) = -Ir_i^\delta \quad (15) $$

This implies that:

$$ E_n^i = E_0^i - n * i\alpha(r_i) = E_0^i - n * ir_i^\delta \quad (16) $$

where $n$ = Network Lifetime

When the system “turns off” at the moment $n$, this will be the lifespan of the network then:

$$ E_n^i = 0 \Leftrightarrow E_0^i - n i r_i^\delta = 0 \Leftrightarrow n = \frac{E_0^i}{ir_i^\delta} \quad (17) $$

with $E_0^i$ = initial Energy of $i^{th}$ node.
The aim is maximize *n* (the network lifetime) in a way to drop down the energy on all nodes at the same time. So, *n* must be constant which implies:

$$n = \frac{E_0^i}{i r_i^\delta} = \text{constant} \quad \text{give} \quad i r_i^\delta = \frac{E_0^i}{n} \qquad (18)$$

Thus,

$$r_i = \left( \frac{E_0^i}{i * n} \right)^{\frac{1}{\delta}} \qquad (19)$$

Notice that when *i* increases (approaching to the destination), the distance *r*<sub>*i*</sub> decreases, which is ordinary since the *i*th node will send a larger number of the messages, so it must be closer to the destination so that its energy is enough.

Or if $\sum_{i=1}^{i=N} r_i = L$ and we substitute in Equation (19), this will imply:

$$\sum_{i=1}^{i=N} \left( \frac{E_0^i}{n * i} \right)^{\frac{1}{\delta}} = L \rightarrow \frac{1}{n^{\frac{1}{\delta}}} \sum_{i=1}^{i=N} \left( \frac{E_0^i}{i} \right)^{\frac{1}{\delta}} = L \rightarrow n^{\frac{1}{\delta}} = \frac{1}{L} \sum_{i=1}^{i=N} \left( \frac{E_0^i}{i} \right)^{\frac{1}{\delta}}$$

Then

$$n = \frac{1}{L^{\delta}} \sum_{i=1}^{i=N} \frac{E_0^i}{i} \qquad (20)$$

From the Equation (20), it is concluded that when *i* increase, the distance between the nodes decrease. So, the nodes of Figure 9 should be placed as follows.

### 5.2.3. Radial Case Uniform Distribution

In this part where the destination is in the center and the sources are set out on the edge, we make, on each way which connects the source with the destination, the same calculation that we have made in the linear case.

We obtain the already found relations from Equation (1) and (6):

$$E(r+dr,t) - E(r,t) = -\rho\alpha(r)dr$$

With $\rho$ the density of the nodes between the source and the destination and $\alpha(r) = r^\delta = cste$ where $1 \le \delta \le 2$ is the decrease rate of energy with each message.

#### 1) Case of a grid (2D) N x N

An N x N sensor nodes distributed in a square topology is considered as shown in Figure 10. The first stage is to calculate the number of paths which passes by each node according to the EBP protocol:

Then, the *N* paths are determined which connect the source which is at the higher left top of the grid and the destination which is at the lower right level. Here, we should state that the distance on any path between the source and destination is equal to $R\sqrt{2}$ due to the fixed rectangular topology.

<figure><img src="image_11.png" /><figcaption>Figure 9. Non-linear uniform distribution.</figcaption></figure>
<figure><img src="image_12.png" /><figcaption>Figure 10. N×N grid topology.</figcaption></figure>

This determination is done by using the Directional value of the DSAP method which consists in comparing the values $p_{ij}$ of neighbor nodes. The message will be transmitted to the node which has the largest value (this value will be replaced by $P_{ij}-1$). If the neighbors are equal quality, the message will always be transmitted by the node which is on the left.

Once these routes are found, they are directly saved.

Now, let us consider that:

$$ \varphi: (K, L) \to (I, J) \text{ is not bijective.} $$

$KL$ is the route of the path where $ij$ is index of the nodes in the topology

$$ \begin{aligned} K &\in \{1, \dots, N\} \\ L &\in \{1, \dots, 2N-1\}. \end{aligned} $$

This function indicates the position of the node of index $(I, J)$ “in the grid” and has its position in the $k^{th}$ way (which is already saved).

In this grid, at moment $n$ the energy of the node of index $(I, J) = \varphi(K, L)$ is equal to the initial energy minus the energy dissipated by the transmission of the messages.

To simplify terms, we will directly use:

$$ P_{ij} \approx P_{\varphi(k,l)} \quad \text{and} \quad r_{\varphi(k,l)} \approx r_{ij} \qquad (21) $$

where $P_{ij}$ is equal to the number of routes which pass by the node of index $(i, j)$, $n$ is the network lifetime and And $r_{\varphi(k,l)}$ is the distance between the node on the $k^{th}$ path.

At the end, the system “turn off” then the energy of the node is null.

Thus

$$ E_{n}^{ij} = 0 \Leftrightarrow E_{0}^{ij} - \frac{n}{N} P_{ij} r_{ij}^{\delta} = 0 \Leftrightarrow E_{0}^{ij} = \frac{n}{N} P_{ij} r_{ij}^{\delta} \qquad (22) $$

Also, from Equation (22), we conclude that
$$ r_{ij}^{\delta} = \frac{N E_{0}^{ij}}{n P_{ij} n} $$

Which imply that

$$ r_{ij} = \left( \frac{E_{0}^{ij} N}{P_{ij} n} \right)^{1/\delta} \qquad (23) $$
Or $\sum r_{ij} = R\sqrt{2}$ length of the way with different distances between nodes in each different route.

Then, from Equation (23) we have:

$$ \sum_{l=1}^{l=2N-2} \left( \frac{E_0^{\varphi(k,l)} N}{P_{\varphi(k,l)} n} \right)^{\frac{1}{\delta}} = R\sqrt{2} \quad (24) $$

So, the conclusion from Equation (24) is that the network lifetime is independent from the distance as shown in Equation (25):

$$ n^{\frac{1}{\delta}} = \frac{1}{R\sqrt{2}} \sum_{l} \left( \frac{E_0^{\varphi(k-1)} N}{P_{\varphi(k-1)}} \right)^{\frac{1}{\delta}} \quad (25) $$

## 5.3. Interpretation

In our proposed mathematical models, it is noticed from Equations (7) and (12) in the uniform distribution that the same energy is consumed in function of time or distance.

As for the non-uniform distribution, we can conclude that the distance should decrease when approaching to the destination. This is normal because it will need to tolerate more number of messages near the destination. If such scenario is applied, we can benefit from the barriers problems when routing the information towards the sink node. The same interpretation is applied to the radial case, but here we have multiple destinations.

As for the radial case which is strongly applied in our EBP routing algorithm, the conclusion is that the network lifetime can be independent from the distance as shown in Equation (25).

Moreover, If we consider

$$ E_0^{\varphi(k,l)} = E_0 = \text{cst.} \quad N = \text{cst.} $$

We have,

$$ \frac{N}{2} + 1 \geq P_{\varphi(k,l)} \geq 1 \quad \text{so:} \quad \frac{2}{N+2} \leq \frac{1}{P_{\varphi(k,l)}} \leq 1 $$

$$ n^{\frac{1}{\delta}} \leq \frac{1}{R\sqrt{2}} (E_0 N)^{\frac{1}{\delta}} * (2N-2) \rightarrow n^{\frac{1}{\delta}} \leq N^{\frac{1}{\delta}} (2N-2) \frac{E_0^{\frac{1}{\delta}}}{R\sqrt{2}} $$

$$ \frac{E_0^{\frac{1}{\delta}} 2^{\frac{1}{\delta}} (2N-2)}{R\sqrt{2} (N+2)^{\frac{1}{\delta}}} \leq \left(\frac{n}{N}\right)^{\frac{1}{\delta}} = \frac{1}{R\sqrt{2}} \sum_{l} \left( \frac{E_0}{P_{\varphi(k,l)}} \right)^{\frac{1}{\delta}} \leq \frac{1}{R\sqrt{2}} (E_0)^{\frac{1}{\delta}} * (2N-2) $$

$$ \frac{E_0 (2N-2)^{\delta} N}{(R\sqrt{2})^{\delta}} \geq n \geq \frac{2E_0}{R\sqrt{2}} \frac{N}{N+2} (2N-2)^{\delta} $$

$$ \frac{(R\sqrt{2})^{\delta}}{E_0} n \leq N(2N-2)^{\delta} \quad (\text{Inequation (1)}) $$
We can conclude from the Inequation (1) that there is a relation between the Network lifetime (n) and the number of sensor nodes (N). So to calculate the network lifetime of a grid N x N wireless sensor network, all what it needs is to know the number of nodes deployed in the ground.

## 6. Conclusions

In this paper, the DSAP routing algorithm principle is explained and presented its current limitations. Some enhancements were presented through a modified version called MDSAP, which is based on the type of messages exchanged between the sensor nodes. However, due to the main limitation found in the simulation of MDSAP concerning energy barriers in the destination proximity, the energy based protocol (EBP) is proposed as a solution. Simulation results in TinyOs evaluating the performance of this protocol were also presented.

The main constraint of EBP is to assign specific energy according to the distribution set in the algorithm which is quite impossible actually in a real-time environment. For this purpose, clustering energy based protocol (CEB-P) was proposed to be able to apply such distribution in real life. CEB-P distributes some sensors in each node's place set by EBP to approximately reach the total designated power. A detailed comparison was carried out from different simulations to show the efficiency of the CEB-P in relation to the other stated protocols. However, CEB-P still deals with one source sending the sensed information; an enhancement could be the proposition of a multi-source routing protocol [15] and this will constitute an interesting continuing of this article.

Routing is one of the constraints in sensor networks. The major objective behind the implementation of an adequate routing algorithm is the minimization of energy consumption, which can lead to maximizing the sensor network lifetime. Energy consumption is a major constraint in WSNs. A mathematical model addressing this energy consumption problem was finally proposed at the end of this paper.

## Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

## References

[1] Smart Dust. University of California, Berkeley.

[2] Pottie, G.J. and Kaiser, W.J. (2000) Wireless Integrated Network Sensors. Communication of the ACM, 43, 51-58.

[3] Hill, J., Szewczyk, R., Woo, A., Hollar, S., Culler, D. and Pister, K. (2000) System Architecture Directions for Networked Sensors. ACM SIGARCH Computer Architecture News, 28, 93-104.

[4] El-Haddad, S., Genet, M.G., El-Hassan, B. and El-Nabbouch, D. (2008) MDSAP Simulation Using TinyOs and Hospital Application Modeling. 2008 First International Conference on the Applications of Digital Information and Web Technology
gies (ICADIWT), Ostrava, 4-6 August 2008, 133-138.

[5] Salhieh, A. (2004) Efficient Communication in Stationary Wireless Sensor Networks. Ph.D. Thesis, the Graduate School of Wayne State University, Detroit.

[6] El-Haddad, S., Girod-Genet, M. and El-Hassan, B. (2006) Simulation and Refinement of Directional Source Aware Routing Protocol for Wireless Sensor Networks. 2006 2nd International Conference on Information & Communication Technologies, Damascus, 24-28 April 2006, 2689-2694.

[7] El-Haddad, S., Girod-Genet, M. and El-Hassan, B. (2007) DSAP for Wireless Sensor Networks—Modified Algorithm and Simulation Using OMNeT++. 4th International Conference. Sciences of Electronic, Technologies of Information and Telecommunications, Tunisia, 25-29 March 2007, 6 p.

[8] Levis, P., Lee, N., Welsh, M. and Culler, D. (2003) TOSSIM: Accurate and Scalable Simulation of Entire TinyOS Applications. First ACM Conference on Embedded Networked Sensor Systems, Los Angeles, 5-7 November 2003, 126-137.

[9] El-Haddad, S., Girod-Genet, M., El-Hassan, B., Ismail, L.N. (2015) Clustering Energy Based Routing Protocol for Wireless Sensor Networks. BLACKSEACOM 2015: 3rd International Black Sea Conference on Communications and Networking, Constanta, May 2015.

[10] Heinzelman, W.R., Chandrakasan, A. and Balakrishnan, H. (2000) Energy-Efficient Communication Protocol for Wireless Microsensor Networks. Hawaiian International Conference on Systems Science, Maui, 7 January 2000, 10.

[11] Salhieh, A., Weinmann, J., Kochhal, M. and Schwiebert, L. (2001) Power Efficient Topologies for Wireless Sensor Networks. International Conference on Parallel Processing, Valencia, 3-7 September 2001, 156-163.

[12] Steinleitner, N. (2008) Efficient Routing in PAN and Sensor Networks. Center for Informatics, University of Göttingen, Göttingen.

[13] Liu, Y., Wang, Y.M. and Zhang, H.M. (2005) Sensors Deployment in Energy Efficient Wireless Sensor Networks. 2005 International Conference on Wireless Communications, Networking and Mobile Computing, Wuhan, 26 September 2005, 875-878.

[14] Hitti, K., Haddad, S., Sayah, J. and Feghali, S. (2020) Always-Convergent Hybrid Methods for Finding Roots of Nonlinear Equations. Journal of Mathematical and Computational Science, 11, 165-172.

[15] El-Haddad, S., Sayah, J., Girod-Genet, M. and El-Hassan, B. (2017) Multi-Source Energy Based Routing Protocol in Sensor Networks. European Advanced Materials Congress (EAMC) International Conference, Stockholm, 22-24 August 2017.