05676742True Time based Simulation for wireless sensor network

Embed Size (px)

Citation preview

  • 8/12/2019 05676742True Time based Simulation for wireless sensor network

    1/4

    True Time based Simulation for wireless sensornetwork

    Chang Chen 1, Zhenping Li 2, Ping Song 1* and Kejie Li 1 1School of Mechatronical Engineering

    Beijing Institute of TechnologyBeijing,China

    [email protected]

    2 1st DepartmentChina North Vehicle Research Institute

    Beijing, China

    Abstract Computer simulation is an essential procedure forwireless sensor network design and optimize. After analyzingsome existing simulators, we proposed using True Time as WSNssimulation tools, which is a MATLAB/Simulink based co-simulation tools. It could not only simulate network behavior, butalso simulate in-node behavior and display the sampled signalcharacteristic to end user. Then we give 8 nodes simulation and

    discussed the basic simulation procedure. The simulation resultshows True Time could accomplish WSNs simulation.

    Keywords-True Time; Wireless Sensor Network; Simulation;

    I. I NTRODUCTIONThe emergence of wireless sensor networks (WSNs)

    provide an efficiency and economical solution for distributeapplications. Each sensor node in a given WSNs is constrainedwith the process capability, communication bandwidth, powerand storage, but when coordinated with the information fromother nodes, they could accomplish complex functions.Consequently, for the purpose of improving efficiency andeconomical, optimize a wireless sensor network is also animportant issues. Generally speaking, analyzing method,computer simulation and physical experiment are the threemain techniques for wireless sensor network performanceanalyzing.

    However, analyzing method could not solve multi-constrain large scale network problem. Physical experiment isnot an economical solution for repeat parameters optimize andspatially deployment, its usually used for final verify.Therefore, computer simulation is an essential procedure fornetwork design and optimize.

    There are several simulators used for sensor networkresearch, such as NS-2, OMNET++, OPNET and TOSSIM.

    NS-2 is a very popular general purpose discrete evensimulation tool for sensor network. Many extensions for WSNare implemented in NS-2[1], like radio energy model, etc.

    Nevertheless, NS-2 does not have a unified architecture.Moreover, the reconfigurability of NS-2 components is a littleweak. OMNET++[2][3] is an open source component-baseddiscrete event network simulator. It uses C++ for simulationmodel, mainly used for communication protocol, multi-

    processor network or distributes system modeling andsimulation. OPNET [4] is a discrete event, object oriented,general purpose network simulator. It provides supporting for

    Zigbee compatible 802.15.4 MAC. A weak point is that thereare less ready models for recent wireless systems. TOSSIM [5]is a simulator in TinyOS, which is a specially developed OS forwireless embedded sensor network. We have used this tool to

    provide some theoretical evidence for a wireless sensormeasurement system [6]. However, is need the support ofTinyOS and Nesc, can not used for general purpose

    application.All these simulators are focus on protocol or lower level

    development. However, as an end user of Zigbee, we mainlyfocus on the application level performance. For example, wenot only concern the PRR (package reception rate) of the wholenetwork, but also concern the sampled signal integrity andmicrocontroller interruption frequency of a specified sensornode, which could provide some theoretical evidence for laterwork. Therefore, we introduced a new simulation tool for thisapplication, which is based on True Time [7].

    The rest of this paper is organized as follows. Section IIintroduced the True Time Kernel. Section III described themathematic model. Section IV gives the implementationdetails. Section V shows the simulation result. The conclusionis drawn in Section VI.

    II. TRUE TIME BLOCKS True Time (TT) is a MATLAB/Simulink based co-

    simulation tools developed by Lund University, Sweden [8]. It provides a simulation environment for network control andsensor network. A unique characteristic is that True Time couldsimultaneously simulate the computations within nodes, the

    power consumption of node batteries, the node dynamicchanging (node communication range in specific transmission

    power, package sending or receiving, network congestion, package reception rate, etc.).

    True Time provide a group of Simulink based block library,which could be seen in Figure 1.

    All of the blocks are implemented as variable-step S-functions written in C++. Each block contains a discrete-eventsimulator. Two important library blocks named True TimeKernel and True Time Wireless Network are repetitious usedfor sensor network simulation. The former block simulate theevent-based real-time kernel executing tasks and interrupthandlers. The later block simulates local-area communication

    Corresponding Author: Ping Song

    978-1-4244-5392-4/10/$26.00 2010 IEEE

  • 8/12/2019 05676742True Time based Simulation for wireless sensor network

    2/4

    protocol and networks. For the purpose of distribute simulation,each True Time Kernel controls its own event queen instead ofglobal timing. Task, interrupt handlers and timers arerepresented by objects that are moved between various queues.The true time wireless network message transmitting schemecould be described as follows. The node first checks whetherthe medium is idle. If that has been the case for 50us, then thetransmission may proceed. If not, the node will wait for arandom back-off time before the next attempt. The signal tointerference ratio in the receiving node is calculated by treatingall simultaneous transmissions as additive noise.[8]

    Figure 1. True Time 1.5 block library

    The internal structures are shown in Figure 2(a) and Figure2(b). All the S-functions could be seen in source codedirectory.

    Figure2. (a) Internal structure of True Time Kernel

    Figure 2. (b) Internal structure of True Time Wirelessnetwork

    III. SIMULATION MODEL A typical wireless sensor network system is demonstrated

    in Figure 3. Sensor nodes in monitor area corporately capturetarget signals and transmit the message to sink node as route

    protocol define. Most of the times, the message route is multi-hoped and self-organized. The sink node then process these

    message and transmit them into a public net and display theresult to end user.

    Figure 3. Wireless sensor network system structure

    For sensor network simulation, a general simulation modelcould be illustrated in Figure 4.

    S e n s or

    c h a nn e l

    wi r e l e s s

    c h a nn e l

    Figure 4. General simulation model for sensor netwrok

    To establish the simulation environment, some basicformula should be introduced.

    The transmit power and receive signal sensitivity in TrueTime wireless network are expressed as dbm. Nevertheless, the

    power consumption should be expressed in W or mW.therefore, some transform should be done.

    The relationship of dbm and w is

    )1/log(10# mW signal P dbm = (1),

    Where signal P is the signal power.

    Therefore, the transmit power transmit P is

    )10/(10001.0 dbm P transmit P = ..(2)

    Where dbm P

    is the power displayed in dbm.

    The receive signal sensitivity y sensitivit P is

    )10/(10001.0 dbm P y sensitivit P = .(3)

    Where dbm P is the power displayed in dbm.

    The propagation model used in true time wirelesssimulation is

    transmit a y sensitivit P d P

    1=

    (5)

  • 8/12/2019 05676742True Time based Simulation for wireless sensor network

    3/4

    Where P is transmit power, d is the transmit distance inmeters, and a is a various parameter for different environment.Therefore, the sensor node communication range is

    a y sensitivit transmit P P d 1

    )/(= , .(6)Where a=3.5 for default environment. However, the

    transmit range in physical environment is much lower than thistheoretical distance for the microwave absorbing of air andenvironment.

    Form the point view of system, each sensor networktopology could be abstracted into a non-looped connecteddirected graph N= (V, E). V is the set of nodes. E is the set ofedges. In this graph, direct connection (i, j) between node i and

    j could exist only when j is in is neighbor set Ni. The ultimateaim is establish a tree. In this tree, sink node is the root andother node could be leaves or interior-points. For a given route

    protocol, our simulation problem could be described asresearching the leaves performance in a given tree.

    IV. SENSOR NETWORK SIMULATE IMPLEMENTATION The aim of our simulation is test the sampled signals

    integrity and microcontroller interruption frequency in a givensensor network. This work could provide some theoreticalevidence for later work, such as passive acoustic localization,time synchronization.

    The simulation procedure could be described as follows.

    (a) Establish simulation model. These models includesimulation scenario, sensor node model, system model andsome parameter.

    The simulation scenario could be described as follows. 8sensor node deployed in a 600m*600m square area, which isshown in Figure 5. The source nodes sampled signals and

    transmit it into destination node (sink node). We want to testthe sampled signals integrity after wireless transmitting and thesensor node microcontroller task interruption frequency. Herewe use AODV[9] (ad-hoc On-demand Distance VectorRouting) protocol as route protocol to establish target messagetransmitting tree, which is provided by True Time. Its a simpledistance-vector based route protocol.

    Figure 5. A sensor node deploy scenario

    The sensor node structure is illustrated in Figure 6. A sinwave signal and constant signal are added to the True TimeKernel as source signals. We use True Time Battery to monitorthe sensor node power. Some scopes are added to view the

    parameters changing.

    Figure 6. Sensor node structure

    (b) Initialize system model

    It is an m-file. This code segment is used to initialize thesystem model, system function and loading parameter. Thiscode segment will be executed at first.

    (c) Initialize sensor nodeThis code segment is used to initialize sensor node,

    including establish interruption handle, register nodeID innetwork. This code segment will be executed secondly.

    (d) Implement the interruption and task.

    These code segments are used to implement the interruptionor task which is established in (c). For example, a periodic tasknamed sending is created in (c) using ttCreatePeriodicTask() ,we should implement it here. These code segments will beinvoked periodically or at a certain time.

    V. SIMULATION RESULT In this section we show some simulation result by using the

    former sections scenario.

    We first set the 8 nodes in (-80,-80),(-100,-50),(-100,0),(-50,-100),(0,-100),(10,10),(90,90) and (190,190). Node 1transmits sampled data to node 7. The network type is set to802.15.4. The transmit power is set to 2.5dbm, receivesensitivity is set to -70dbm. Simulation time set to 20s, datatransmit period set to 0.008s.

    The simulation result is shown as follow.

    During the simulation, node 1 sent 2500 byte data.However, node 7 received 2424 byte data. The data curve isshown in Figure 7. The data losing not only changed the

    signals length, but also changed the signal frequency. If thisdata is used for analyzing target characteristic, it will show aspecious result to end user.

  • 8/12/2019 05676742True Time based Simulation for wireless sensor network

    4/4

    Figure 7.The comparison of sent and received signals

    Figure 8 shows the interruption of network sensor node. Wecould know that sensor node 1,3,6 is active at this time. Thatmeans the routing is 1-3-6-7.

    Figure 8. Sensor node interruption

    Figure 9 shows the power consumption of node 1.

    Figure 9. Power consumption of node 1

    As a comparison, we set the data transmitting period to0.016s. Node 1 sent 1250byte data to node7, while node 7received 1249byte. The received and sent data curve is shownin Fig 10. We could see that received data is nearly the same assent date.

    Figure 10. Received and sent data curve.

    We could see the power consumption is less than Fig 9.That means, when lower the data transmitting period, the dataloss could be improved. However, that means whentransmitting a given length signal, the transmitting time willlonger. From this simulation we could see True Time not onlysimulate the network behavior, but also simulate the in-node

    behavior and signal characteristic. However, it is not suitable

    for large scale simulation.

    VI. CONCLUSION In this paper, we use true time as a tool to accomplish

    wireless sensor network simulation. After give some analyzingof True Time and wireless sensor network simulation, we givean example of simulation, which use 8 node deployed in600m*600m areas. Then we give the simulation result. Finallywe draw the conclusion that True Time could not only simulatenetwork behavior, but also simulate the in-node behavior andsignal characteristic.

    ACKNOWLEDGMENT

    We would like to express our gratitude to all the colleaguesin our laboratory for their assistance.

    R EFERENCES [1] The Network Simulator ns-2, Available from

    http://www.isi.edu/nsnam/ns[2] C. Mallanda, A. Suri, V. Kunchakarra, etc. , Simulating Wireless

    Sensor Networks with OMNeT++ IEEE computer,2005[3] Omnest network simulation, Available

    http://www.omnest.com/network-simulation.php[4] Hammoodi, I.S.; Stewart, B.G.; Kocian, A.; McMeekin, S.G. A

    Comprehensive Performance Study of OPNET Modeler for ZigBeeWireless Sensor Networks. NGMAST 09, page 357-362 ,2009

    [5] Philip Levis, Nelson Lee, Matt Welsh, and David Culler. TOSSIM:accurate and scalable simulation of entire TinyOS applications. InProceedings of the 1st international conference on Embedded networkedsensor systems, pages 126137, 2003.

    [6] Chang Chen, Ping Song and Kejie Li, R-Sensing: a Route Solution forWireless Sensor Measurement System. Octember, Beijing, MAPE2009

    [7] http://www.control.lth.se/truetime[8] Anton Cervin and Karl-Eric Arzen. True Time: Simulation tools for

    performance analysis of real-time embedded systems. In Gabriela Nicolescu, Pieter J. Mosterman (Eds.): Model-Based Design for Embedded Systems, CRC Press, November 2009.

    [9] C.E. Perkins and E.M. Royer. Ad-hoc on-demand distance vector(AODV) routing. In Proceedings of the 2nd IEEE Workshop on MobileComputing Systems and Applications, 1999.