Sie sind auf Seite 1von 8

Collaborative Wireless Sensor Network Simulation


ENSEIRB, T3, January

{khemakhe, bodenan, salim}

Wireless sensor networks (WSNs) are attracting increased interest for a wide range of applications such as
environmental monitoring and vehicle tracking. Resource constraints on nodes in the network and unreliability of
radio communication mean that applications have to be developed with an eye on maximizing energy efficiency in
order to extend network life [1]. Our goal is to work on an autonomic architecture in order to minimize the energy
consumption of the nodes within the network with an adapted distributed algorithm [2] for a WSN environment that
enables nodes to stop useless communications between each other. Indeed, sensing and communications consume
energy, therefore judicious power management and sensor scheduling can effectively extend network lifetime. This
report presents our approach towards this particular problem, the algorithm we worked on and finally its
implementation with a simplified distributed knowledge sharing model within a Visidia environment [3].

1 Introduction

Recent advances in digital electronics, embedded systems, and wireless communications have motivated a lot of
research in the direction of distributed wireless sensor networks. A wireless sensor network is a wireless network
consisting of spatially distributed autonomous devices using sensors to cooperatively monitor physical or
environmental conditions, such as temperature, sound, vibration, pressure, motion or pollutants, at different locations
[1]. Originally, wireless sensor network was designed for military applications such as battlefield surveillance.
Though, wireless sensor networks are now used in many civilian applications areas, including environment, traffic
control, and even in health.

Wireless sensor networks differ from conventional network systems in many aspects. They usually involve a large
number of spatially distributed, energy-constrained, and self-configuring nodes. The wireless sensor networks are
bringing a lot of new challenges and design considerations. One of these challenges is the energy consumption.
Indeed, as we have said before, due to limited energy resources, it is vital to maximize the lifetime of sensors in
order to operate over a long period of time (from 6 months to 1 year) within a difficult environment such as military
zones. Because without energy the network cannot do anything, the problem of energy consumption is the most
significant one. That’s why WSNs require careful management of energy resources. Thus, we tried in this project to
find a way that enables to limit the energy consumption in WSNs.

Thus, an autonomic management solution based on distributed algorithms for knowledge sharing was provided
within the LABRI laboratory, so the solution outcome seems interesting to be studied and applied to the problematic
we have chosen that is to say the energy consumption on WSNs. For this purpose, the simulation tool VISIDIA
(Visualization and Simulation of Distributed Algorithms) was used to test the algorithm.

2 State of the art

2.1 Architecture

There are two sorts of sensor network architectures, layered architecture and clustered architecture that are
shown in Figure 1. The first one has a single powerful base station (BS), and the layers of sensor nodes around it
correspond to the nodes that have the same hop-count to the BS. About the clustered architecture, the sensor
network is divided into small areas called clusters.
Each cluster has a cluster-head (which functions like a base station) which is elected to manage these resources like
the communication between sensors. Within each cluster, ordinary node communicates with the cluster head and the
cluster head form a backbone network to forward the data to the remote BS. Furthermore, with this architecture,
aggregation of data is easier, the management of the network is simplified and it permits to reduce the energy

(a) (b)

Figure 1. Layered (a) and clustered (b) architecture

Because it’s the most used architecture, we have considered in this work a WSN with a clustered architecture.

2.2 Research Challenges in WSN

As we have seen before, wireless sensor network problems are not the same as those we can encounter in classical
networks. Because the nodes that constituted this kind of network have small size, low battery capacity
nonrenewable power supply, small processing power, limited buffer capacity, a low-power radio and lack unique
identifiers, WSNs provide new communication and networking paradigms.
In order to realize system that can support extreme situations, several obstacles need to be overcome.

- Coverage problem: ensure that sensors provide sufficient coverage of the sensing field
- Limited source energy and therefore limited communications: Because it is impractical to recharge a
depleted battery we need for example to use specific protocols (energy-aware protocols) in order to prolong
the network lifetime. Energy is not only spent for communication, but also when sensors are moving around
the network
- How to decide which sensors need to remain active so that the area is covered as possible and we can save
- Hot spot problem: It is the long-term connectivity maintenance of networks. Some nodes work more than
others and so they deplete their energy faster. It’s because nodes that are closer to the sink also transmit
others’ data and not only theirs
- Ad hoc deployment, for example when sensors are dropped by a plane above a forest that needs to be staked
- Free maintenance operation, which requires an automatic configuration (for example when the topology of
the network changes)
- Node identification: Because of the high density of nodes, we need a long ID to avoid the ID conflict. But
most WSNs can’t afford the large overhead introduced by a long ID
- The security in sensor networks: It’s the same problems as those we can encounter with wireless ad hoc
networks, like availability, confidentiality, integrity, and authentication
- Dynamic adaptation, especially for the arrival or fall of sensors, or the case where there is a stimuli
- Location in a repository in relation to other nodes or absolutely: How to efficiently deliver the message
without or with less location information
- Quality of service: the aim is to provide better services than just best effort services

Most of these problems enounced above have not been entirely resolved and it represents a real challenge for
researchers. The bibliographical analysis on the wireless sensor networks we have done in the first phase of this
project has enabled us to become aware of the energetic problem. Thus, because it is impractical to recharge a
depleted battery we need for example to use specific protocols (energy-aware protocols) or specific algorithm in
order to prolong the network lifetime.
We also noticed that other problematic of this field are more or less linked with the energy one. So, if we success to
minimize the energy consumption of sensors it would open many barriers.

2.3 Energy consumption problem

The energy consumption problem in wireless sensor networks is investigated. Because of constrained
battery, the problem is to expend as little energy as possible receiving and transmitting data.

Several works have been done in the last few years in order to find a way to improve the routing performance,
especially the lifetime for WSNs. The authors in [4] present a taxonomy about most of the routing protocols for
WSNs and categorize them into three classes which are data-centric [5, 6], hierarchical [7-9], and location based [10,
11] protocols.

To reduce the energy consumption, an important technique is the data aggregation which is a technique adopted by
the data-centric routing protocols [5, 6]. It uses the fact that that many nearby sensor nodes might sense and collect
similar information. This method enables to reduce both the size and the number of transmissions. SPIN (Sensor
Protocols for Information via Negotiation [6]) can be viewed as the first data-centric routing protocol which uses
data negotiation method among sensor nodes to reduce data redundancy and save energy. Direct Diffusion [6] is a
famous and representative data-centric routing protocol for WSNs.
In WSNs with hierarchical structure [7-9], the whole network is further divided into smaller areas called clusters. In
this way, the energy consumption can be greatly reduced since the communication range is largely reduced within
one cluster and the ordinary sensor nodes can be set to sleeping mode according to certain Time Division Multiple
Access (TDMA) schedule, which is sent by cluster head.
Location-based routing protocols [10, 11] require sensor location information which can be gained either through
global positioning system (GPS) devices or through certain estimation algorithms based on received signal strength.
The advantage of this type of routing protocols is that there is no need to make blind broadcasting, so the routing
overhead can be largely reduced, and so it reduces the energy consumption.

3 Our Approach

The major stake of WSN technology is to deploy this kind of network on a large scale environment, and to make
sensors cooperating while taking into account problematic we can encounter in this environment, but to do so we
need to introduce an autonomic notion. IBM was the first to develop an autonomic architecture [13].

However, in all autonomic architectures which have been developed there was no cognitive infrastructure for
knowledge management, a knowledge plane.
This knowledge plan would provide the ability to the networks elements to be self-organizing and to follow the
global objectives provided by administrators while optimizing network resources like energy. As we said before,
communication between nodes is the main energy consumer, that’s why we tried in a clustered architecture to limit
useless communications between nodes.

To do so, we have adapted a distributed algorithm for knowledge sharing in the context of wireless sensor network.
3.1 Initial Algorithm

Having a self-organized sensor network implies designing a distributed collaborative environment in which
all the component should be able to share their knowledge and to take decisions according to the information they
received from other components. Those components should also be able to analyze shared knowledge and eventually
reject it if it is necessary.
To realize the knowledge sharing, a distributed algorithm that is shown Figure 2 is proposed. The main objective of
this algorithm is to define the situated view of the knowledge that a component wants to share with the others. The
situated view means the domain limits where a piece of knowledge is useful and then should be propagated. The
notion of situated view is similar to the notion of neighborhood.

Figure 2: Knowledge sharing algorithm with situated view

In fact, when receiving knowledge, a component decides either to be the neighbor of the root component by
accepting the knowledge and by propagating it, or not by stopping it propagation. This is the notion of acceptance.
This notion is necessary to avoid useless information exchanges between nodes, and by this way the knowledge plan
is constructed progressively. Then, there is the notion of neighborhood. It is necessary that elements have the ability
to identify their direct neighbors. Several criteria can be used to define the neighborhood. Without going into details
there is the physical neighborhood and the logical one (based on similarities between nodes, e.g. the type of
equipment, the role of the equipment).

3.2 Adapted algorithm

In our work, we have considered that this notion of neighborhood corresponds to the physical neighbor that is
somewhat reducing but sufficient for our simulation. So, when a sensor gets an information that it picks up from its
area coverage or from another node, it decides or not to spread it to its neighborhood. Thus, before the node
retransmits the knowledge (or the information) to all its neighbors, it first has to determine if the knowledge is
coherent with its state and if the knowledge is pertinent or not. The criterion we used to check if the knowledge is
pertinent or not will be seen in the next part.
So, the procedure defined in Figure 2 is executed by all nodes when receiving the knowledge and it is according to
this procedure that the knowledge is propagated in the network.
4 Implementation

4.1 The chosen scenario

The performance of the algorithm is not yet approved. Thus, to come over this, a concrete scenario of a sensor
network use should be fixed in order to measure its auto-organization performance.

The chosen scenario deals with a fire scenario in forest. The architecture envisaged for this scenario consists of a
network composed by several temperatures sensors and one based station.

In our simulation, at a given instant one temperature sensor detects an abnormal high temperature and decides to
transmit this information. As we have said before, we want here to reduce the energy consumption by limiting
communications. Thus, we have to compare the propagation of the information in the wireless sensor network with
and without the algorithm. To do so we have used a model of fire propagation. That is to say, that according to this
model we assigned a given temperature to each node in the network as a function of its position from the node where
the fire has been detected. So, we know how far the information needs to be spread from the fire source, and we
know which nodes are not concerned by this event.

The model of fire propagation we used is shown in Figure 3.

Figure 3: Model of fire propagation

In our simulation, we have considered that the knowledge was the information of a detected fire by a given sensor (or
node). So what we propagate in the network is that the sensor number X (each sensor is defined by an Id number) has
detected an abnormal temperature. Then, each node that receives this information checks if this information is
pertinent, and if it needs to be propagated, the criterion we have chosen is to compare the temperature that the node
receives with the temperature it gets from its area coverage. Thus, if the difference between temperatures is to
important, the information is considered as not pertinent, and so it is not spread to the neighborhood.

To test the algorithm and to set up our scenario, we had to use a network simulator that has specific criteria.

4.2 The chosen simulator

We needed a tool that can visualize distributed algorithms not necessarily a Network Simulator like NS-2. Thus, we
just need a middleware vision which means that we need to simulate the logical network.

To do so, there are lots of tools that can fit, but we chose Visidia mostly because it has many properties that aren’t
found in other applications, and for its good performance with distributed algorithmic.

VISIDIA is a software tool for the visualization and the simulation of distributed algorithms based on a solid
theoretical base. It is kitted up by a graphical user interface which will be used to draw the sensor network
architecture of our scenario.
After we had learnt how the VISIDIA graphical interface works and how we can create a graph, we had to learn how
we can execute the algorithm on it. To do so, we needed first to implement in java the algorithm on our favorite
editor (we used eclipse), and then we needed to generate the .class file. And this is that .class file that is used on
VISIDIA to launch the algorithm on each node. But as we have said before, we first have had to adapt and
implement the algorithm to our scenario. This part of our work is explained in the next section.

4.3 The implementation of the algorithm

VISIDIA is implemented in Java, so we worked on the VISIDIA package, and we used the VISIDIA API.

We encountered some difficulties to establish relationships between classes, in order to use the methods that we
needed to implement the algorithm. We defined a class “EnergyAlgo” that inherit from the class Algorithm, the main
function of our class is the method init()that is executed by a thread launched by the class simulator which takes
the algorithm as a parameter.

As we have said before, we used the model of fire propagation. To do so, we defined four ellipses in order to get the
level lines we needed for the model. These ellipses are defined according to the hearth, that is to say the first sensor
that detects the fire. When the sensor detects the fire it sends a message to its neighborhood. Then, its neighbors
decide if the information is pertinent or not, and if so they send it to their neighbors (except the node they received
the information from). To check if the information is pertinent or note we compare the temperature that the local
node detects to the temperature of the sensor that detects the fire. If the difference between the two temperatures is
inferior to 20 degrees, the information is considered as pertinent and is transmitted.

Each ellipsis defines a space that has a specific temperature, in other word, to attribute a temperature to a node, we
have to check if it is inside an ellipsis, and if so we need to find to which one it belongs.
//check if the point is inside an ellipse
public boolean isInEllipse(int x,int y,int a, int b){
Math.pow((float)(float)(Math.PI/4)*(x+y)/b, 2)));
return ((Math.pow((float)((float)(Math.PI/4)*(x-y))/a, 2)+
Math.pow((float)(float)(Math.PI/4)*(x+y)/b, 2)) < 1);

Thus, the four ellipses define 5 temperatures areas, four are inside an ellipsis and a last one is outside and represents
the rest of the network that is not concerned by the fire.

With the method isInEllipse()defined below, it is easy to check if the node is inside an ellipsis or not. But some
nodes can be inside two or more ellipses, that is why we defined for each ellipsis a specific table that contains the
IDs of the nodes that are inside of it.
Hashtable<Integer, Integer> zone3 = new Hashtable<Integer, Integer>();
for(int i = 0;i < netSize; i++){
if( i != this.getId() &&
vueGraphe.rechercherSommet(Integer.toString(i)).centreY(), 600, 600)){
if(!zone1.containsKey(i) && !zone2.containsKey(i))
zone3.put(i, i);
By this way we can attributes a temperature for all the nodes according to its position in the network and according
to the model fire propagation.
5 Experimentations and Results

(a) (b)

Figure 4. Knowledge Sharing Algorithm (a) and Spread all knowledge Algorithm (b) simulation

The figures above show the simulation of the knowledge sharing and the spread all algorithms. The second algorithm
does not attribute spread rule to nodes. Thus, the knowledge shared by the starter node has been transmitted to all
nodes on the graph.

The main difference between those two algorithms is that in the first one, 117 messages have been exchanged
whereas in the second one, we count 184 messages. Therefore, as the energy consumption is proportionate to the
number of message send, we can conclude that the knowledge Sharing Algorithm is more efficient toward the
problem energy dissipation.

In fact, especially in large sensor networks, this algorithm limits the area in which a specific knowledge should be
shared by establishing criteria of neighborhood. Those neighbors are the only node that can take profits from the
content of the knowledge. If we refer to figure4, the neighbors of the starter node are distributed in for zone having
respectively red, yellow, orange and black node’s color. The blue nodes represent the neighborhood area bounds.
However, in the figure5, the neighborhood area of the starter node is not bounded due to the fact that all nodes are
6 Conclusion

The implementation of a simple adaptation of the knowledge share algorithm was sufficient to show the efficacy of
this algorithm toward the problem of energy consumption in a WSN. In fact, by introducing the neighborhood
concept, this algorithm decrease the number of message exchanged to spread a knowledge and preserve, as a result,
the node’s energy in an auto-management process.

The implementation of such algorithm was not much easy. Indeed, we have faced some difficulties to take profits
from the code of VISIDIA in order to implement our algorithm notably, to establish the relationship between the
simulation software classes and the algorithm class.

Although, it was a very interesting project that necessitated an important personal devotion to come over all the new
notions and specificity of WSN and it constitutes a real value-added.


[1] Mbaye Maissa, Krief Francine : Distributed Knowledge Sharing Algorithm for Autonomic Networking.
[2] The ViSiDiA Project: Visualization and Simulation of Distributed Algorithms. Please see
[3] K. Akkaya and M. Younis, "A Survey of Routing Protocols in Wireless Sensor Networks,” in the Elsevier Ad Hoc
Network, Vol. 3(3), 2005, pp. 325-349.
[4] J. Kulik, W. R. Heinzelman, H. Balakrishnan, "Negotiation-based protocols for disseminat-ing information in
wireless sensor networks",
ACM/IEEE Int. Conf. on Mobile Computing and Networking, Aug. 1999.
[5] C. Intanagonwiwat, R. Govindan and D. Estrin, "Directed diffusion: A scalable and robust communication
paradigm for sensor networks", in the Proceedings of the 6th Annual ACM/IEEE International Conference on Mobile
Computing and Networking (MobiCom'00), Boston, MA, August 2000.
[6] W. Heinzelman, A. Chandrakasan, and H. Balakrishnan, "Energy-efficient communication protocol for wireless
sensor networks," in the Proceeding of the Hawaii International Con-ference System Sciences, Hawaii,
January 2000.
[7] S. Lindsey and C. S. Raghavendra, "PEGASIS: Power Efficient GAthering in Sensor Infor-mation Systems," in the
Proceedings of the IEEE Aerospace Conference, Big Sky, Montana, March 2002.
[8] Wang Jin, Shu Lei, Jinsung Cho, Young-Koo Lee, Sungyoung Lee, Yonil Zhong. "A Load-balancing and Energy-
aware Clustering Algorithm in Wireless Ad-hoc Networks". The 1st International Workshop on RFID and Ubiquitous
Sensor Networks (USN'2005), 2005, pp1108 1117.
[9] V. Rodoplu and T.H. Ming, "Minimum energy mobile wireless networks," IEEE Journal of Selected Areas in
Communications, Vol. 17, No. 8, 1999, pp. 1333-1344.
[10] IBM Corporation, An architectural blueprint for autonomic computing, White Paper 2003.
[11] Clark, D. D., Partridge, C., Ramming, J. C., and Wroclawski, J. T. 2003. A knowledge plane for the internet. In
Proceedings of the 2003 Conference on Applications, Technologies, Architectures, and Protocols For Computer
Communications (Karlsruhe, Germany, August 25 - 29, 2003). SIGCOMM '03. ACM, New York, NY, 3-10.