fUML-Driven Design and Performance Analysis of Software Agents for Wireless Sensor Networks

Post on 25-Jan-2015

92 views 1 download

description

The growing request for high-quality applications for Wireless Sensor Network (WSN) demands model-driven approaches that facilitate the design and the early validation of extra-functional properties by combining design and analysis models. For this purpose, UML and several analysis-specific languages can be chosen and weaved through translational approaches. However, the complexity brought by the underlying technological spaces may hinder the adoption of UML-based approaches in the WSN domain. The recently introduced Foundational UML (fUML) standard provides a formal semantics to a strict UML subset, enabling the execution of UML models. Leveraging fUML, we realize the Agilla Modeling Framework, an executable fUML model library, to conveniently design agent-based software applications for WSN and analyze their performance through the execution of the corresponding fUML model. A running case study is provided to show our framework at work.

Transcript of fUML-Driven Design and Performance Analysis of Software Agents for Wireless Sensor Networks

fUML-driven Design and Performance Analysisof Software Agents for

Wireless Sensor NetworkLuca Berardinelli, Antinisca Di Marco, Stefano Pace

Post Doc @ DISIMUniversity of L’Aquila

+ +

AGILLA Modeling Framework

The AGILLA Modeling Framework

AGILLA middleware

TinyOS

AgentWSN

Target Platform

FoundationalUML

Model LibraryClasses

Activities

System Response

Time

PerformanceAnalysis

Timings

fUML Simulation

The AGILLA Modeling Framework

AGILLA middleware

FoundationalUML

PerformanceAnalysis

fUML Simulation

MDE user

AGILLA developer fUML modeler

Analysis expert

Modeling&Analysis with AMF

1. Everything is a (UML) Model: the Case Study, AMF, Analysis Results 2. No need of model transformations to external notations3. Tool supported (UML Modeling Tools, fUML Virtual Machine, AMF)

Software Agent for WSN

AGILLA middleware

FoundationalUML

PerformanceAnalysis

fUML Simulation

MDE user

AGILLA developer fUML modeler

Analysis expert

Modeling&Analysis with AMF

AGILLA middleware

TinyOS

AgentWSN

Target Platform

Software Agent for WSN• Software Agents are special software

processes that can explicitly migrate or clone from execution host to execution host while maintaining their state.

Agent

(State)

migrate()clone()

• Wireless Sensor Network are spatially distributed autonomous sensors that monitor physical or environmental conditions (e.g., temperature, sound, pressure) and cooperatively pass their data through the network to a main location (e.g., Base Station with human operators).

<<deployed on>>

node

main location

base station

Software Agent for WSN• AGILLA , a middleware specifically

designed to support the programming of self-adaptive applications on WSNs.

Agent(s)

AGILLA

Tuple Space Neighbors List

• Allows multiple agents to execute on each node autonomouslyo (local) tuple space: shared memory of typed data objects

retrieved by field matching by local agentso neighbors list: to know where to migrate() or clone()

• Implemented on top ofo open source OS, for resource-constrained nodeso written in nesC, a C dialect designed for the OS.

Programmers can write applications in C, the core OS is in nesC.

Node Hardware

(C, nesC)

(State)

Software Agent for WSN

• AGILLA provides an Instruction Set Architecture (ISA) ≈ 80 instructionso e.g., pushc, jumpc, pop, halt, sense, clone...

Tuple Space Neighbors List

Node Hardware

(C, nesC)

AGILLA

Agent

ISA

jumpc Task B

halt

pushc

sense

• AGILLA Agents are not programmed in nesC or C but in an assembly-like language. Task A

Task B

Task ... • Agents are structured in named Tasks

grouping related instructions.

• Control flow instructions (jump, jumpc, rjump) use Tasks as parameter.

Software Agent for WSN• Wildfire Tracking Application

BaseStationPCTemp °C Reader

Agent

node

Software Agent for WSN• Wildfire Tracking Application

BaseStationPC

node

Temp °C ReaderAgent

The BS injects a Tracker Agent that clones itself on nodes until the fire perimeter is detected

TrackerAgent

Software Agent for WSN• Wildfire Tracking Application

BaseStationPC

node

Temp °C ReaderAgent

TrackerAgentThe BS injects a

Tracker Agent that clones itself on nodes until the fire perimeter is detected

perimeter

Softwarecode

1

2

3

4

5

6

7

8

9

10

11

12

8

8

10

10

control flow

TrackerAgent

BEGIN

OUT_DETECTOR

DIE

REGISTER_RXN

CHECK_NEIGHBORS

RANDOM_MOVE

FORM_BARRIER

BARRIER_LOOP

BARRIER_DONE

BARRIER_FIRE

BARRIER_NXT

BARRIER_NXT2

Control Flow: • Determined by goto-like

instructions• E.g, rjump, rjumpc

fUML-Driven Design of Agilla Agents

AGILLA middleware

PerformanceAnalysis

MDE user

AGILLA developer

Analysis expert

Modeling&Analysis with AMF

AGILLA middleware

TinyOS

AgentWSN

Target Platform

FoundationalUML

Model LibraryClasses

Activities

fUML Simulation

fUML modeler

fUML-Driven Design of Agilla Agents• Foundational UML: Executable semantics for a strict subset of

UML, i.e., Classes and ActivitiesMetamodel

COMPONENTS

COMPOSITE STRUCTURES

DEPLOYMENTS

INTERACTIONS

STATE MACHINES

USE CASES

CLASSES

ACTIONS

ACTIVITIES

PROFILES

lightweight extensions by

Executable Model

Simulation Tool

Modeling Tool

including fUML VM by OMG

fUML-Driven Design of Agilla Agents• Design (OO) guideline: Activities as Operations' bodies.

Metamodel Executable Model

fUML-Driven Design of Agilla Agents• Design (OO) guideline: Activities as Operations' bodies.

MM Executable Model of Agilla Agents

Agents and Tasks as user-defined model elements

Tuple Space Neighbors List

AGILLA Middleware

ISA

Agilla ISA asreusable

model elementsi.e., <<model library>>

import

model instrumentation

fUML-Driven Design of Agilla Agents• Design (OO) guideline: Activities as Operations' bodies.

MM Executable Model of Agilla Agents

Structure: composite hierarchy of

1. App [1]as Classes2. Agents[1..*]as Classes

3. Tasks[1..*]as Classes and Operations

4. Instruction[1..*]?from the model library

fUML-Driven Design of Agilla Agents• Design (OO) guideline: Activities as Operations' bodies.

MM Executable Model of Agilla Agents

BEGIN::main()

Tracker::main()

Behavior hierarchy of Activities for Agents and Tasks

from the model library

fUML-Driven Design of Agilla AgentsThe AMF Library exploits the simulation capability of fUML

MM Executable Model of AMF Library

App model (structure) AMF model libAgilla

structural elementssimulation & analysis tracing

…x74

app-specificarchitectural elements

•Parsing it generates AppComp, AgentComp, TaskComp and InstrComp active objects

•Instruction Semantics Different Executors schedule active objects and finally execute() instructions.

•TracingExecution flows as determined by instructions. "Jumps" are stochastic variables

fUML-Driven Design of Agilla AgentsModel Instrumentation: connecting user model with AMF library

MM Executable Model of Agilla Agents and AMF Library combined

Agillastructural elements

simulation & analysis tracingmodel instrumentation

fUML-Driven Performance Analysis

AGILLA middleware

MDE user

AGILLA developer

Analysis expert

Modeling&Analysis with AMF

AGILLA middleware

TinyOS

AgentWSN

Target Platform

FoundationalUML

Model LibraryClasses

Activities

fUML Simulation

fUML modeler

System Response

Time

PerformanceAnalysis

Timings

fUML-Driven Performance AnalysisThe AMF Library enables Performance Analysis

by fUML SimulationMM Executable Model of AMF Library

App model (structure) AMF model libAgilla

structural elementssimulation & analysis tracing

…x74

app-specificarchitectural elements

•Analysis Analyzers execute the performance analysis algorithms during the fUML model simulation

•of the corresponding active objects

•and traces.

fUML-Driven Performance AnalysisSemantics of rdp instruction (fUML Activity)

MM Executable Model of AMF Library

fUML-Driven Performance AnalysisSemantics of rdp instruction (fUML Activity)

MM Executable Model of AMF Library

fUML-Driven Performance Analysis• Foundational UML lacks the concept of time• 4 kinds of Timings for Performance Analysis are managed by AMF

@fUML simulation time

1

2

3

4

5

6

7

8

98

8

control flow1

2

3

4

5

6

7

8

9

:AgentExecTrace:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

:TaskExecTrace

pushn:InstrExecTracepushc:InstrExecTrace

rdp:InstrExecTracerjumpc:InstrExecTrace

ETs for each type Agilla Instructionare given as input and are measured on Target Platforms

Execution Time/Arrival Time/Waiting Time/Completion Time

Other timings (ATs,WTs,CTs) are derived @simulation time by AMF's algorithms

fUML-Driven Performance AnalysisfUML instance model of WTA structure(InstanceSpecification, Slots)

fUML instance model of Execution Traces(InstanceSpecification, Slots)

fUML instance model of Analysis Results(InstanceSpecification, Slots)

fUML-Driven Performance Analysis

fUML-Driven Performance Analysis

WTA fUML Model @ simulation time:

• Queuing Network with M/M/1 service center

• First Come First Served policy for Agents

• Performance Index: System Response Time

• 10# simulation runs

fUML Simulation

Conclusions

• fUML-driven Design and Performance Analysis of Software Agents for Wireless Sensor Network

• Everything is a (UML) Model: the Case Study, AMF, Analysis Results

• No need of model transformations to external notations

• Tool supported (UML Modeling Tools, fUML Virtual Machine, AMF)

• Scalability issue: fUML VM optimization for V&V activities required, better model library design

Conclusions

• Who's next?

?

?

?

?

Luca Berardinelli, Antinisca Di Marco, Stefano PacePost Doc @ DISIM

University of L’Aquila

Questions