md 8 iecon09 final version

Upload: dharani-kumar

Post on 04-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Md 8 Iecon09 Final Version

    1/6

    Simulation Platform for Wireless Sensor Networksbased on the TrueTime Toolbox

    Alberto Cardoso1, Srgio Santos1, Amncio Santos1,2 and Paulo Gil1,31CISUC, Department of Informatics Engineering, University of Coimbra, Portugal

    2Department of Informatics Engineering and Systems, Institute of Engineering of Coimbra, Portugal3Electrical Engineering Department, Universidade Nova de Lisboa, [email protected], [email protected], [email protected], [email protected]

    Abstract Research on Wireless Sensor Networks (WSN) has

    received considerable attention in the last few years due to their

    unique characteristics, including, flexibility, self-organization,

    easy deployment, which make them an ideal candidate for low-

    cost monitoring. In order to help WSN planning and to enable

    the design of new protocols and applications and assess their

    performance, several existent simulation platforms have been

    extended to include simulation frameworks for WSN. In this

    paper, a higher level simulation platform for WSN is proposed

    based on the TrueTime toolbox. Relevant features include

    graphical representation of communication components,

    wireless communication and battery-driven operation. Special

    attention was paid to the 3D graphical interface, simulator

    interactivity and its extendibility. Simulation results

    demonstrate the applicability and usability of the proposed

    simulation platform.

    I. INTRODUCTION

    Wireless Sensor Networks (WSN) [1], [2] consist of anumber of battery powered sensor nodes, endowed withphysical sensing capabilities, limited processing and memory,

    and short-range radio communication. These nodescollectively form a network and forward gathered informationto a data sink or gateway.

    A WSN comprises a potentially large set of nodes that maybe distributed over a wide geographical area, indoor oroutdoor [3]. WSNs enable a number of sensing andmonitoring services in areas of vital importance such asefficient industry production, and environmental monitoring.

    In general, a sensor node includes a sensing device for dataacquisition from the physical environment, a processingsubsystem for local data processing and storage, and awireless communication module. Additionally, a power

    source supplies the energy needed by the device to performall the programmed tasks. This power source is in most casesbattery-driven with limited available energy. Therefore,maximizing the network lifetime is also an importantchallenge (see e.g. [4]) and should be tackled either in theplanning stage or by means of a recursive optimization of thenetwork lifetime under minimal coverage constraint. Thus, inorder to support planning and deployment as well as to enabletesting of new protocols and applications, simulationplatforms have been extended to include simulationframeworks for WSN. A comparative analysis of several

    WSN simulation platforms can be found in [5] and [6].In this paper a new simulation platform for WSN based on

    the TrueTime simulator is presented. Given its underlyingfeatures it provides researchers with a very flexiblesimulation environment with application in a number ofscientific areas, such as, WSN communication protocols ordistributed control over wireless networks.

    The approach followed here makes use of the TrueTime

    toolbox [7], [8], which is a freeware Matlab

    library forsimulating networked and embedded real-time controlsystems. This platform distinguishes from other competitorsin that it i) provides higher level simulations under theMatlab environment; ii) is a simulator and not an emulatoras TOSSIM for TinyOS [9], or Cooja for Contiki [10] andthus, it does not require a complete application for running asimulation, but just the behavior description of the desiredcomponents; iii) presents the extendibility property, asresearchers may take advantage of wide range of librariesavailable in Matlab. This includes libraries for datavisualization, design of fault tolerance mechanisms or datastream processing, just to mention a few. Additionally, theproposed simulator supports the ZigBee protocol(incorporated in the TrueTime toolbox), description of theWSN and its properties through a XML configuration file, 3Dsimulation and visualization as well as the possibility of realtime simulations embedding real motes.

    The organization of this paper is as follows. Section IIgives an overview of the simulation platform, pointing out theenhanced features and flexibility. Two use cases under theform of examples are presented in Section III, while inSection IV some conclusions are drawn.

    II. THE SIMULATION PLATFORMThe simulator under development should support

    researchers and practitioners in the development of tasksrelated to WSN, such as, designing of new protocols andapplications as well as assessing the overall WSNperformance, including the WSN lifetime.

    Furthermore, it should offer a configurable realistic,abstraction of the underlying network and physical details, inorder to be used in the study of data stream processingtechniques. Finally, the platform should be easily extendibleand modular in order to effortless allowing the

  • 7/30/2019 Md 8 Iecon09 Final Version

    2/6

    implementation of specific algorithms, external constraintsand new types of outputs, such as graphical visualizations ordata logs.

    A WSN simulation model must contain the requiredentities for a correct representation. These includecommunication components (motes and gateways), thewireless network interconnecting these elements, sensor

    entities and, finally, the surrounding environment. All shouldbe configurable, act accordingly and yield reliable results.The simulator was built using the Matlab/Simulink

    platform and the TrueTime toolbox. The present version wasimplemented for Matlab R2007b and Simulink 7.0 andbased on TrueTime 1.5. It includes a Simulinkblock library,Matlab source code and a collection of MEX/DLL files. Thekernel block simulates a real-time kernel executing user-defined tasks and interrupt handlers.

    The network blocks allow nodes to communicate oversimulated wired or wireless networks. By using the TrueTimetoolbox it is possible to simulate the temporal behaviour ofcomputer nodes and communication networks that interactwith the physical environment.

    A. The TrueTime toolboxTrueTime is a freeware toolbox1 for simulating networked

    and embedded real-time control systems. One of its mainfeatures involves the possibility of co-simulation of theinteraction between the real-world continuous dynamics andthe computer architecture in the form of task execution andnetwork communication.

    Some fundamental features in the context of this workinclude: i) emulation of a wireless network and transmissionmodels; ii) representation of the kernel of a mobile nodecommunicating through the implemented network; iii)representation of battery-powered devices and some basicconsumption models.

    This tool was essential for a correct, reliable and effortlessabstraction of the underlying layers of the simulator, mainlythe electronics and linking issues behind each wireless nodeand the wireless network.

    B. Graphical front-endThe simulators environment consists of two distinct layers:

    a graphical front-end and a data back-end. The graphicalfront-end (Figure 1) includes all the controls and operations

    for running a given WSN simulation, including Simulink

    blocks and data visualization modules.On the top of this front-end environment, an additional

    graphical user interfaces has been built (see Figure 2) toimprove the usability of the simulator. It enables monitoringrelevant data and executing common tasks, such asreconfiguring the network or selecting the appropriate routingalgorithm.

    1 http://www.control.lth.se/truetime/

    Fig. 1. Main simulation platform interface.

    Fig. 2. Simulator additional graphical user interface.

    C. Features1) Communication Components: These components are

    represented in three categories (see Figure 3). The sensor

    motes have sensing capabilities, which enable the acquisitionof data from the external environment, process and relay dataobjects and are battery-operated with autonomy constraints.Access points or repeaters process and relay messages andmay also have autonomy restrictions, in the case of battery-powered units. Servers or gateways receive the final datapackets, and usually have no autonomy constraints.

    Fig. 3. Communication Components in a WSN.

  • 7/30/2019 Md 8 Iecon09 Final Version

    3/6

    Concerning the components behaviour, there are threedifferent states: Active (fully functional), Idle (inactive butwith minimal power consumption) and Offline (inactive andwith no power consumption). Each network node has its ownrepresentation in a 3D coordinate system, which allowsobtaining its relative position to other units, in a homogenousenvironment. Both properties can be changed while a

    simulation is running, (see Figure 4).The motes energy consumption is evaluated based on theunderlying physical state (Active/Idle/Offline), the distancebetween nodes, transmission/reception costs and wirelessnetwork protocol costs. Other energy consumption modelsmay be developed and integrated within the platform, sincethis functionality is represented by a Simulink block.

    2) Wireless Network: Users are allowed to configureseveral Wireless Network parameters. Some of them areautomatically configured depending on the network type,namely IEEE802.11b or IEEE802.15.4. Those parametersthat are automatically configured by default include data rate,minimum frame size, transmit power, receiver signalthreshold, ACK timeout and maximum of retries.Additionally, the default path loss exponent and error codingthreshold can also be defined.

    An implemented functionality to the TrueTime wirelessnetwork simulation is the support of path loss exponents forspecific network links, which is useful to simulate predictedobstacles between specific motes or in specific network areas.

    Besides the graphical interface shown in Figure 5, all thenetwork configuration, including the nodes parameters andposition, may be set on a single XML file. This approach wasalready implemented in ATEM0 [11], a MICA2 platform

    emulator, though at a lower level than the one consideredhere. Figure 6 presents a partial example of a networkconfiguration XML file, showing the wireless networkparameters, specific path loss exponents and motesparameters.

    Fig. 4. Communication components parameters.

    Fig. 5. Wireless Network parameters.

    Fig. 6. Partial example of a wireless network configuration XML file.

    3) Sensed entities: For simulation purposes, these arerepresented by continuous time signal generators, attached tothe sensor mote analogue input port. Motes acquire thesesignals at a regular user defined sampling time. This can beextended to support more complex models or to integrate datacollected from sensor nodes in real time.

    [m]

    [m]

    [m]

  • 7/30/2019 Md 8 Iecon09 Final Version

    4/6

    4) Environment: The surrounding environment can beemulated in different ways, though most commonly throughthe path loss exponent. This parameter defines the attenuationof the signal with distance, being higher when the attenuationis more significant and the environment is more hostile towireless communications.

    Other ways of representing specific conditions for the

    wireless communication channel, like specific errors at thetransmission or reception level on the respective motesroutines and errors on the network communications, were notimplemented but may easily be included. .

    5)Routing algorithm: A routing algorithm is used on thesimulator, which defines the message distribution routesthroughout the entire network. The teleonomy of thealgorithm is to optimize some features of the network. Itenables the maximization of the network useful lifetime,ensuring the most effective route. This routine is called at aconfigurable period and whenever a change occurs in a nodestate. Additionally, it must ensure coherent results.

    6) Data output: The platform presents in the current stagefour different output formats, although new frameworks foroutputting simulation results could easily be implemented andincluded taking advantage of the available Matlabtoolboxes.

    The common mode is a 3D visualization display of thesimulation outputs. All the nodes in a given WSN topologyunder simulation are represented in a real-time 3D graphic,with specific symbols representing their type and colorsrepresenting their state or battery level (Figure 7). Eachnodes property can be queried by selecting it. In this case,

    some information will appear in a pop-up window on thescreen, like the one shown in Figure 7.

    Fig. 7. 3D nodes visualization.

    It is also possible to visualize feasible routes/links (throughreachable distances between nodes), current active links, andto query each route/link properties, as similar to the nodesquery.

    There are other two real-time graphical visualizations. Oneis a group of graphics representing the battery level for eachnode. The second group of graphics represents the analogue

    output port for each node (Figure 8), which corresponds tothe received data packets. This visualization is useful foridentifying lost packets or communication delays.

    Additionally, at the end of each simulation, a record of theoutput of every routing algorithm execution is saved on a.mat file format.

    III. SIMULATORUSE CASES

    In this Section two WSN simulation examples arepresented so as to highlight the flexibility and applicability ofthis simulation platform for WSN. These use cases aredirectly linked to the purposes of this simulation platform

    within the Ginseng Project2, which main goal is the planneddeployment of WSN that meet application-specificperformance targets, in particular with respect to latency andreliability. It should be mentioned that the platformapplicability does not restrict itself to these particularexamples.

    A. Development of energy optimization algorithmsMaximizing the network lifetime is an important challenge,

    still being currently under investigation (see e.g. [12] and[13]).

    By using a WSN simulation platform it is possible tomonitor the active links, following in real-time the outcomesof its energy optimization algorithm under the constraint ofmaximizing the WSN lifetime. Both the nodes battery andtransmitted messages would reflect this optimizationprocedure.

    The WSN considered in the following examples is spatiallydeployed over a vast region, where each node is battery-powered and all the gathered sensors data must relayed tosink nodes. In addition, all the nodes are packet relay capableand should be able to dynamically adjust the transmit powerdepending on the distance to the node they arecommunicating with.

    Fig. 8. Visualization of the analog output of each node.

    2 EU-FP7 Grant agreement no. 224282

  • 7/30/2019 Md 8 Iecon09 Final Version

    5/6

    Figure 9 shows the schematic 3D representation of a WSN,where motes are presented with cubes, access points/repeaterswith double crosses and the server or gateway is identifiedwith a rectangular box. The visualization also shows the stateof the motes. Since all the motes are green, they are all active.Additionally, it is possible to observe all the feasiblecommunication links. Each mote can only exchange data with

    those sufficiently near, due to the wireless networkcharacteristics.There is an alternative visualization mode of the WSN,

    where instead of the mote state, the color can represent thebattery level. The stronger the color the higher is the batterycapacity. In the initial state (initial conditions), every motesbattery is near the full capacity, represented here by a strongblue color.

    In Figure 10, one particular mote has been selected andmarked in red. Therefore, only its feasible transmission linksare visible. Those links being used for data transmission arelarger and colored blue, while the others are thinner andwhite. In this case, the selected sensor mote has four feasiblelinks.

    Fig. 9. Representation of the state of Sensor motes (cubes), AccessPoints/Signal repeaters (double crosses) and a Server or Gateway(rectangular box) in a WSN.

    Fig.10. Representation of the components power level in a WSN with twosensor motes with a low battery level.

    The information about which links are in use and thecorresponding usage percentage is provided by theoptimization algorithm. Some additional information for theselected mote is available on the information window: type,mote identification number, 3D position and battery levelinformation. During the simulation, the motes powerconsumption will depend on their communication and

    operational costs, while the server is assumed to have nolimited availability of energy. Figure 10 shows the motesbattery levels, where the two nearly white sensor motes havethe lowest amount of available energy.

    Due to the low battery level of those two sensor motes, thenext iteration of the optimization algorithm will redirect lesstraffic to them, in order to maximize the network lifetime.Consequently, the access point selected on Figure 11, hasonly one active transmission link, with nearly 100% of thegenerated traffic.

    Another feature is the possibility of dynamically configurethe motes parameters during simulations. Whenever achange occurs or is detected, the optimization algorithm isexecuted in order to adapt the network active links to the newphysical characteristics. In the situation described on Figure12, the middle access point was deactivated, turning its colorinto white. That action led to a reconfiguration of nearbymotes links. The selected mote stopped transmitting all itsinformation/packets to the middle access point, redirecting itto the two motes with active links.

    Fig. 11. Traffic redirection in a WSN according to the optimizationalgorithm.

    Fig. 12. Deactivation of an access point in a WSN and the correspondinglinks reconfiguration according to the optimization algorithm.

  • 7/30/2019 Md 8 Iecon09 Final Version

    6/6

    Finally, in order to analyze over time the results of a givenoptimization algorithm, a different visualization scope wasimplemented. For each node, a table is rendered containingthe results of the algorithm iterations, during the simulationtime. For a given node, each entry corresponds to thepercentage of traffic routed through all admissible links. Anexample is presented in Figure 13, where the traffic of the

    mote no.6 was routed through nodes 2, 3 and 5, in thesimulation run. The network nodes not receiving any trafficfrom sensor mote no.6 are presented with small blue dots,while the other nodes have black stars with the correspondingtraffic percentage appended.

    Fig 13. Table presenting the evolution of the weight of each network link.

    B. Embedding real motesInstead of constructing models to simulate data collected

    by sensor nodes, the simulation platform can enable itsintegration with real motes.

    Collecting live data from real motes can be useful to

    validate algorithms, evaluate the noise injected by theenvironment, or just retrieve sets that behave more similarlywith the deployment scenario.

    By default, in the simulator all sensor nodes use as inputssamples from a global signal defined by the developer. Sincethrough the Matlab platform it is possible to read from COMor USB ports, the global signal may be easily replaced bydata streams collected from external devices and received inany format.

    Besides collecting data, it is also possible to sendinformation through the same kind of ports to motes. This canbe used not only to relay data, but also to change motesconfigurations or send specific commands, for instance to a

    local agent. This functionality is particularly useful if weconsider motes with digital-analogue conversion (DAC)capabilities, being the output signal sent to an actuator device,such as a valve or a damper.

    In a more elaborated situation, through these interactions,the simulation platform can act as a sub-network inside awider network made of real motes or similar simulationplatforms.

    IV. CONCLUSION

    In this paper a new simulation platform for WSN, based onthe TrueTime toolbox, has been proposed. Special attentionwas paid to 3D network visualization, interactivity andextendibility of this platform. Another useful feature is itsinherent ability to interact with real motes. In order toemphasize the importance of those features in terms of

    simulation capabilities and test bed for optimizationalgorithms, two use cases were presented and analyzed.

    ACKNOWLEDGMENT

    This work was supported in part by the Ginseng Project(FP7 Grant agreement no. 224282) and by the Integration intoResearch Grants from FCT (The Portuguese Foundation forScience and Technology).

    REFERENCES

    [1] G. Borriello, K. I. Farkas, F. Reynolds, and F. Zhao, Building aSensor-Rich World, IEEE Pervasive Computing, 2007, vol. 6, no. 2,pp. 16-18, 2007.

    [2] C.-Y. Chong, and S. P. Kumar, Sensor networks: evolution,opportunities, and challenges, in Proceedings of the IEEE 2003, vol.91, n0. 8, pp. 1247-1256, 2003.

    [3] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci,"Wireless sensor networks: a survey," Computer Networks, vol. 38, pp.393422, 2002.G. Anastasi, M. Conti, M. Di Francesco, and A.Passarella, "Energy conservation in wireless sensor networks: Asurvey,"Ad Hoc Networks, 2008.

    [4] J. C. F. Li and S. Dey, Lifetime Optimization for Multi-hop WirelessSensor Networks with Rate-Distortion Constraints, in Seventh IEEEInternational Workshop on Signal Processing Advances in WirelessCommunications, 2006, pp. 15.

    [5] M. Becker, A. Timm-Giel, K. Murray, C. Lynch, C. Grg, D. Pesch,Comparative Simulations of WSN, Cunningham, P.; Cunningham,

    M. (eds.),ICT-MobileSummit2008.[6] D. Curren, A Survey of Simulation in Sensor Networks.[7] A. Cervin, D. Henriksson, B. Lincoln, J. Eker, and K.-E. rzn, "How

    Does Control Timing Affect Performance?," IEEE Control SystemsMagazine, vol. 23, no. 3, pp. 16-30, 2003.

    [8] M. Ohlin, D. Henriksson, and A. Cervin, "TrueTime 1.5 ReferenceManual," Department of Automatic Control, Lund University, Sweden,2007. Available: http://www.control.lth.se/truetime.

    [9] P. Levis, N. Lee, M. Welsh, D. Culler, TOSSIM: accurate and scalablesimulation of entire TinyOS applications,Proceedings of the 1stinternational conference on Embedded networked sensor systems, pp.129-137, 2003

    [10] F. Osterlind, A. Dunkels, J. Eriksson, N. Finne, T. Voigt, "Cross-LevelSensor Network Simulation with COOJA," pp.641-648,Proceedings.31st IEEE Conference on Local Computer Networks, 2006

    [11] J. Polley, D. Blazakis, J. Mcgee, D. Rusk, J. S. Baras, ATEMU: A

    fine-grained sensor network simulator,IEEE Communications SocietyConference on Sensor and Ad Hoc Communications and Networks,2004

    [12] A. Alfieri, A. Bianco, P. Brandimarte, and C. F. Chiasserini,"Maximizing system lifetime in wireless sensor networks, "EuropeanJournal of Operational Research, vol. 181, pp. 390-402, 2007.

    [13] R. Madan, S. Cui, S. Lall, and A. Goldsmith, Cross-Layer Design forLifetime Maximization in Interference-Limited Wireless SensorNetworks,IEEE Trans. on Wireless Communications, vol. 5, no. 11,pp. 31423152, 2006.