Transcript of "A4WSN: an Architecting environment 4 Wireless Sensor Networks"
Università degli Studi dell’Aquila Ivano MalavoltaDISIM Department, University of L’Aquila firstname.lastname@example.org
Who is Ivano? If you think good architecture is expensive, try bad architecture. ... Brian Foote and Joseph Yoder Software Architecture & Model-Driven Engineering applied to Wireless Sensor Networks Mobile Applications Autonomous Quadrotors
* International Workshop on Software Engineering for Sensor Network Applications Problem DefinitionFrom the SESENA* 2012CfP: Abstraction“the development of WSN software is still carried out in a ratherprimitive fashion, by building software directly atop the OS and byrelying on an individuals hard-earned programming skills”“WSN developers must face not only the functional applicationrequirements but also a number of challenging, non-functionalrequirements and constraints resulting from scarce resources” Separation of Model-based concerns Analysis
Main Drivers of A4WSNAbstractionby masking the complexity of low-level, hardware details Separation of concernsby clearly separating application, HW, and deploymentaspects of a WSN Model-based Analysisby facilitating the analysis of both functional and non-functional properties
SA: StructureComponents. Units of computation with internal state and well defined interfacePorts. Interaction points with the external environmentConnections. Message-based communication channels between portsApplication data. Variables in the scope of the component
SA: BehaviourEach Component can contain a description of its behaviourThe behaviour is based on:1. Events-conditions-actions2. Modes
SA: Actions Sense gets some data from a sensor and stores the read value into a specific application data ex: get current temperature Actuate activates and actuator, optionally an application data can be used to pass a parameter to the actuator ex: actuate a water sprinkler SendMessage sends a message via a specific message port Unicast, Multicast and broadcast supported
SA: Actions StartTimer starts a timer which can be triggered later. Cyclyc, delay and period properties supported StopTimer stops a previously started timer StoreData puts some (manipulated) data into an application data of the component SyncServiceCall calls an external service (ex. web service) AsyncServiceCall calls an external service, the result of the call will be available via a dedicated event Fork and Join are used to sync the control flow
SA: Events ServiceCallback is triggered when the result of an AsyncServiceCall is available ReceiveMessage is triggered when the component receives a message TimerFired is triggered when a previously started timer is activated
SA: Behavioural FlowBehavioural flow is specified by means of LinksA link can exist: E A1. from an event E to an action A: in this case after the event E is triggered, A will be executed2. from an action A1 to another action A2: in this case, A2 is executed immediately after A1 A1 A2Conditions are boolean expressions (optionally) associated to links E t > 30 AThe execution flow goes through a link only if its condition evaluates to true
SA: ModesA specific status of the component ex. sleeping mode, energy saving mode, etc.At any given time, one and only one mode can be active in acomponentThe component reacts only to those events which are definedwithin its currently active mode
Example**This example is taken from our journal paper...
Nodes Configuration Types of nodes OS MAC protocol routing protocol installed sensors installed actuators energy sources communication devices
NodeA nodes specification is composed of a set of WSN node typesNode Attributes:• OS • ex. TinyOS, Contiki, Mantis, LiteOS, ...• macProtocol • ex. T-MAC, S-MAC, WiseMAC, SIFT, ...• routingProtocol • ex. GEAR, LEACH, HEED, ...
ex. light sensor,Node temperature sensor, smoke sensor... Node Sensors Sensors Sensors Memory Additional Memory memories Actuators Microcontroller Actuators Actuators RF RF ex. RFs sprinklers, leds, lights, Energy Source Energy Source switches... Energy Sourcescan be either continuous, degradable, or harvested
MicrocontrollerRepresents the entity which performs tasks, processes data andcontrols the functionality of other components in the sensor node Microcontroller 0_1 0_* ADC 1_* RF CPU 0_* CPU DAC CPUs Timer 1_* Storage memory 1_1 1_1 Memory Program memory 1_1
Power ModesA Node can specify a set of Power ModesEach power mode identifies a set of node elements (such asmemory, DAC, RF comm. device, etc.) and distinguishes betweenwhich elements are active and which elements are disabled Communication Mode Sensing Mode
Example**This example is taken from our journal paper...
Keeping Models IntegratedTwo special models weave together SA, nodes andenvironment specifications Actually, they are WEAVING MODELS
The Mapping ModelLinks together an SAML model and a NODEML modelIt defines how components are deployed into each configurednodesSeparation of ConcernsIt helps in clearly separating the application layer of a WSN fromall the other lower levels this aspect is new in the WSN domainArchitects can focus on the application from a functional point of view inSAML, and only later they will focus on low-level aspects
The Deployment ModelWeaves together a NODEML model and an ENVML modelIt defines how node types are1. instantiated, and2. virtually deployed in the physical environmentA DEPML model presents a single type of link: Deployment LinkA deployment link considers a node in the NODEML model, andassigns it to an area in the ENVML model
Area and Nodes DistributionNodes can be distributed in three different ways: Random Grid Custom each node is placed nodes are placed on a each node can be manually grid with a certainrandomly within the area placed within the area number of rows and columns N2 N1 N1 BS N3
The Deployment ModelEach node type can be instantiated ”n” times within a specific area this allow architects to focus on generic components and node types in SAML and NODEML, while in DEPML we consider the final shape of the networkDEPML models are the only place in which we reason about the finalnode instances, in the other models we reason about types
Example* custom distributed nodes NODEML DEPML ENVML oxymeter As Am monitor*This example is taken from our journal paper...
Programming FrameworkCode Generation ManagerDefines the extension point for code generation enginesIt checks which plugins are currently extending its extension pointand makes their facilities available to the end userExposes a common Java API to plugindevelopers, so that they can easilyinteract with all the other components ofA4WSN (validation, model adapters, etc.)Analysis Manager acts similarly, but it is for analysis engines
Programming FrameworkModelsStores all the WSN models developed by architects and designersModels can be stored:- in the file system*- in some server in the cloud- in some in-memory representationModel AdapterExposes a common interface to the other components of A4WSNto access the models in an homogeneous way*currently, this is the only available solution in the A4WSN prototype
Programming FrameworkValidationExecutes all the operations to validate A4WSN models:- predefined checks- user-defined checks (via a plugin)Messages ManagerGraphically shows informative messages to the user.Supports three kind of informative messages: information warning error
Programming FrameworkUI ManagerResponsible for the main facilities interacting with the userinterface:- Code Generation Engines View- Analysis Engines View- Code Generation Contextual Menu- Analysis Contextual Menu- Validation Trigger- Progress Feedback- Additional Parameters View
Programming FrameworkParameter ProviderManages the additional parameters that a code generation oranalysis plugin may requireMakes user-provided parameters available and easily accessibleto the plugin requiring themSupported types:string, integer, float, boolean, local resource,remote resource accessible over HTTP
Anatomy of a PluginTo contribute to A4WSN, each plugin must adhere to thefollowing “signature”, A4WSN will take care of the rest
Anatomy of a Plugin Code generation-specific Analysis-specific
Work-in-Progress ComponentsMAPML: Tree-based editorDEPML: Tree-based editorProgramming Framework as Eclipse pluginswith defined extension pointsFirst version of prototype available athttp://www.di.univaq.it/malavolta/files/ME4AWSN_v0.1.zip
Conclusions & Future Work languages programming refinement framework development nodeconfigurationsmarketplace? code generators analysis engines