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.
fUML-Driven Design and Performance Analysis of Software Agents for Wireless Sensor Networks
1. fUML-driven Design and
Performance Analysis
of Software Agents for
Wireless Sensor Network
Luca Berardinelli, Antinisca Di Marco, Stefano Pace
Post Doc @ DISIM
University of L’Aquila
2. The AGILLA Modeling Framework
AGILLA Modeling Framework
+ +
AGILLA
middleware
TinyOS
Agent
WSN
Target Platform
Foundational
UML
Model Library
Classes
Activities
Performance
Analysis
System
Response
Time
Timings
fUML Simulation
3. The AGILLA Modeling Framework
AGILLA developer fUML modeler
AGILLA
middleware
MDE user
Foundational
UML
Performance
Analysis
fUML Simulation
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 notations
3.Tool supported (UML Modeling Tools, fUML Virtual Machine, AMF)
5. Software Agent for WSN
are special software
processes that can explicitly migrate or
clone from execution host to execution
host while maintaining their state.
Agent
(State)
migrate()
clone()
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
base station
main location
6. Software Agent for WSN
, a middleware specifically
designed to support the programming of
self-adaptive applications on WSNs.
Agent(s)
(State)
Tuple Space Neighbors List
• Allows multiple agents to execute on each
node autonomously
o (local) tuple space: shared memory of typed data objects
retrieved by field matching by local agents
o neighbors list: to know where to migrate() or clone()
• Implemented on top of
o open source OS, for resource-constrained nodes
o written in nesC, a C dialect designed for the OS.
Programmers can write applications in C, the core OS is in
nesC.
(C, nesC)
Node Hardware
7. Software Agent for WSN
provides an Instruction Set
Architecture (ISA) ≈ 80 instructions
o e.g., pushc, jumpc, pop, halt, sense, clone...
Agent
jumpc Task B
sense
ISA
pushc
halt
Tuple Space Neighbors List
(C, nesC)
Node Hardware
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.
8. Software Agent for WSN
• Wildfire Tracking Application
PC BaseStation
Reader
Agent
node
9. Software Agent for WSN
• Wildfire Tracking Application
PC BaseStation
node
Reader
Agent
The BS injects a
Tracker Agent
that clones itself
on nodes until the
fire perimeter is
detected
Tracker
Agent
10. Software Agent for WSN
• Wildfire Tracking Application
PC BaseStation
node
Reader
Agent
Tracker
Agent
The BS injects a
Tracker Agent
that clones itself
on nodes until the
fire perimeter is
detected
perimeter
12. fUML-Driven Design of Agilla Agents
AGILLA
middleware
Performance
Analysis
MDE user
AGILLA developer
Analysis expert
Modeling&Analysis with AMF
AGILLA
middleware
TinyOS
Agent
WSN
Target Platform
Foundational
UML
Model Library
Classes
Activities
fUML Simulation
fUML modeler
13. fUML-Driven Design of Agilla Agents
• Foundational UML: Executable semantics for a strict subset
of UML, i.e., Classes and Activities
Metamodel
COMPOSITE STRUCTURES
COMPONENTS
DEPLOYMENTS
INTERACTIONS
STATE MACHINES
USE CASES
lightweight extensions by
PROFILES
CLASSES
ACTIVITIES
ACTIONS
Executable Model
Modeling
Tool
Simulation
Tool
including fUML VM
by OMG
14. fUML-Driven Design of Agilla Agents
• Design (OO) guideline: Activities as Operations' bodies.
Metamodel Executable Model
15. 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
ISA
Tuple Space Neighbors List
Agilla ISA as
reusable
model elements
i.e., <<model library>>
import
model instrumentation
16. 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 Classes
2. Agents[1..*]
as Classes
3. Tasks[1..*]
as Classes and Operations
4. Instruction[1..*]?
from the model library
17. fUML-Driven Design of Agilla Agents
• Design (OO) guideline: Activities as Operations' bodies.
MM Executable Model of Agilla Agents
Behavior
hierarchy of Activities
for Agents and Tasks
Tracker::main()
BEGIN::main()
from the model library
18. fUML-Driven Design of Agilla Agents
The AMF Library exploits the simulation capability of fUML
MM Executable Model of AMF Library
•Parsing
it generates AppComp,
AgentComp, TaskComp and
InstrComp active objects
App model (structure) AMF model lib
Agilla
structural elements
simulation & analysis tracing
…
x74
app-specific
architectural elements
•Instruction Semantics
Different Executors schedule
active objects and finally
execute() instructions.
•Tracing
Execution flows as determined
by instructions.
"Jumps" are stochastic
variables
19. fUML-Driven Design of Agilla Agents
Model Instrumentation: connecting user model with AMF library
MM Executable Model of Agilla Agents and AMF Library combined
Agilla
structural elements
simulation & analysis tracing
model instrumentation
20. fUML-Driven Performance Analysis
AGILLA
middleware
MDE user
AGILLA developer
Analysis expert
Modeling&Analysis with AMF
AGILLA
middleware
TinyOS
Agent
WSN
Target Platform
Foundational
UML
Model Library
Classes
Activities
fUML Simulation
fUML modeler
Performance
Analysis
System
Response
Time
Timings
21. fUML-Driven Performance Analysis
The AMF Library enables Performance Analysis
by fUML Simulation
MM Executable Model of AMF Library
•Analysis
Analyzers execute the
performance analysis
algorithms during the fUML
model simulation
App model (structure) AMF model lib
Agilla
structural elements
simulation & analysis tracing
…
x74
app-specific
architectural elements
•of the corresponding
active objects
•and traces.
24. 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
control flow
1
2
3
4
5
6
7
8
9
8
8
:AgentExecTrace
1
:TaskExecTrace
2
3
4
5
6
7
8
9
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
:TaskExecTrace
pushn:InstrExecTrace
pushc:InstrExecTrace
rdp:InstrExecTrace
rjumpc:InstrExecTrace
Execution Time
/Arrival Time
/Waiting Time
/Completion Time
ETs for each type Agilla Instruction
are given as input and are
measured on Target Platforms
Other timings (ATs,WTs,CTs) are
derived @simulation time by
AMF's algorithms
25. fUML-Driven Performance Analysis
fUML instance model of WTA structure
(InstanceSpecification, Slots)
fUML instance model of Execution Traces
(InstanceSpecification, Slots)
fUML instance model of Analysis
Results
(InstanceSpecification, Slots)
27. 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
28. 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