SlideShare a Scribd company logo
Towards a Foundational API for Resilient Distributed
Systems Design
Matteo Francia1, Danilo Pianini1, Jacob Beal2, Mirko Viroli1
1Alma Mater Studiorum—Universit`a di Bologna
2Raytheon BBN Technologies
2nd eCAS Workshop on Engineering Collective Adaptive Systems
2017-09-22 – Tucson, AZ, USA
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 1 / 27
Outline
1 Introduction
Device-centric engineering in the IoT era
Distributed system as a single entity
Resilient building blocks
2 A foundational library for aggregate programming
Goal and methodology
Meta patterns
Organization
Testing environment
3 Evaluation
Meet the VIP
Resource allocation
4 Conclusion
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 2 / 27
Introduction
Outline
1 Introduction
Device-centric engineering in the IoT era
Distributed system as a single entity
Resilient building blocks
2 A foundational library for aggregate programming
Goal and methodology
Meta patterns
Organization
Testing environment
3 Evaluation
Meet the VIP
Resource allocation
4 Conclusion
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 2 / 27
Introduction Device-centric engineering in the IoT era
Computing everywhere
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 3 / 27
Introduction Device-centric engineering in the IoT era
Device-centric engineering
Low-level details impact system design
Communication protocols
Fault tolerance
Power saving policy
...
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 4 / 27
Introduction Distributed system as a single entity
The aggregate programming stack
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 5 / 27
Introduction Distributed system as a single entity
Level 1: Field Calculus
“Everything is a field”
Stateless rounds
3 constructs
(a) State (rep x e0 e)
(b) Neighborhood (nbr x)
(c) Restriction (if c e0 e1)
H A
A
D
H
T
H
K
B
(a) rep (b) nbr
(c) if
Figure: Field calculus constructsFrancia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 6 / 27
Introduction Distributed system as a single entity
Protelis
A concrete implementation of field calculus
Functional paradigm
Java-family syntax
Java interoperability
P ::= I F s; ;; Program
I ::= import m ;; Imports
F ::= def f(x) {s;} ;; Fun definition
s ::= e | let x = e ;; Statement
e ::= ;; Expression
| f(e) | f.apply(e) ;; Fun call
| rep(x<-w){s;} ;; State
| if(e){s;} else {s ;};; Restriction
| nbr{s;} ;; Neighborhood
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 7 / 27
Introduction Resilient building blocks
Back to the stack
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 8 / 27
Introduction Resilient building blocks
Level 2: Building blocks
Coordination in 4 patterns:
G Spreading
C Aggregation
T Evaporation
S Clustering
With nice features:
Self-stabilization [VBDP15]
Composability [BV14]
Substitutability [VAB+17]
Similar in functionality to basic
patterns in bio-inspired
coordination [FSM+13]
(a) G: spreading (b) C: aggregation
3
1
7
2
4
3
3
1
0
(c) T: evaporation (d) S: clustering
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 9 / 27
A foundational library for aggregate programming
Outline
1 Introduction
Device-centric engineering in the IoT era
Distributed system as a single entity
Resilient building blocks
2 A foundational library for aggregate programming
Goal and methodology
Meta patterns
Organization
Testing environment
3 Evaluation
Meet the VIP
Resource allocation
4 Conclusion
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 9 / 27
A foundational library for aggregate programming Goal and methodology
Aggregate programming
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 10 / 27
A foundational library for aggregate programming Goal and methodology
Level 3: protelis-lang
GOALS
Collect existing algorithms
Classify them by scope
Fill in missing patterns
Encapsulate coordination best practices “under the hood”
Two-stages:
1 Search in existing literature
2 Compare with existing abstractions and technologies
[FSM+13, BDU+13]
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 11 / 27
A foundational library for aggregate programming Meta patterns
multiInstance
A
A
B
B
Idea
Running multiple copies of a process in parallel, one for each identified
“source” and aggregate their outputs
This pattern can be leveraged for several applications:
1 Temporal replication [PBV16];
2 acquire information coming from a dynamic number of sources;
3 extend the application scope of existing algorithms.
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 12 / 27
A foundational library for aggregate programming Organization
Library structure
Specialized building blocks
Plus meta-programming
protelis
coord state
time
countDown
cyclicTimer
limitedMemory
T
...
meta
boundSpreading
multiInstance
multiRegion
publishSubscribe
...
sparsechoice
S
spreading
broadcast
crfGradient
distanceTo
distanceBetween
flexGradient
gradcast
G
...
accumulation
average
C
cMultiSum
cMultiMin
consensus
countDevices
...
nonselfstabilizing
accumulation
gossip
...
nonselfstabilizing
time
gossipEver
...
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 13 / 27
A foundational library for aggregate programming Organization
Code snippet
module protelis:coord:spreading
/** Propagation of information from a source.
* @param source bool , whether the device is a source
* @param initial T, information spread by the source
* @param metric () -> num , how to estimate distance
* @param accumulate (T) -> T, how to accumulate information
* @return T, accumulated value
*/
def G(source , initial , metric , accumulate) {
/* implementation with rep , nbr , if ... */
}
/** Distance to the closest source.
* @param source bool , whether the device is a source
* @return num , field distances to the closest source
*/
def distanceTo(source) {
G(source , 0, nbrRange , (v) -> { v + nbrRange.apply () })
}
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 14 / 27
A foundational library for aggregate programming Testing environment
Automated testing I
Testing is a serious concern, as we need to:
verify the correctness of the implementation
prevent regressions
Most of the algorithms in protelis-lang are distributed
testing locally provides information of little use
a simulated environment is required
We exploited Alchemist [PMV13] for testing on simulated networks
Every test is composed of:
An Alchemist YAML specification, commented with the expected result
A Protelis source file
All the provided functions are tested
If a bug is found and solved, a regression test is included
Testing happens at every build
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 15 / 27
A foundational library for aggregate programming Testing environment
Automated testing II
Alchemist
Simulator
Protelis-Lang
Protelis code
Protelis-Test
initialise
check
YAML
# {0 0.00, 1 1.00, 2 2.00, 3 1.00, 4 1.41, 5 2.41, ...}
network-model:
type: EuclideanDistance
parameters: [1.5]
displacements:
- in:
type: Grid # ...
programs:
- program: distanceTo
/* import lang , spreading , time */
let src = uid =="0" || uid =="5" && timeSinceStart () <=50;
distanceTo(src)
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 16 / 27
A foundational library for aggregate programming Testing environment
Testing example: distanceTo
Stabilization: network converges to a stable state
Self-Stabilization: network converges after perturbations
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 17 / 27
Evaluation
Outline
1 Introduction
Device-centric engineering in the IoT era
Distributed system as a single entity
Resilient building blocks
2 A foundational library for aggregate programming
Goal and methodology
Meta patterns
Organization
Testing environment
3 Evaluation
Meet the VIP
Resource allocation
4 Conclusion
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 17 / 27
Evaluation
Evaluation in crowded scenarios
Two scenarios with 1000 devices each
Meet the VIP: steering people towards POIs with fixed capacity
Resource allocation: coordination of emergency responders to
people requesting aid
Comparing functionality and complexity of two implementations
BB “Building-blocks-only” solution not using any library code
Not allowed to use any code from the library
Self stabilizing based on the G/C/T/S blocks
L Solution with library code (L), including multiInstance
Must improve over BB by using multiInstance
Allowed to use any of function of protelis-lang to reduce code
complexity
To reproduce them: https://bitbucket.org/mfrancia/2017-ecas-experiments
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 18 / 27
Evaluation Meet the VIP
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 19 / 27
Evaluation Meet the VIP
Meet the VIP I
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 20 / 27
Evaluation Meet the VIP
Meet the VIP II
Improved functionality
0 5 10 15 20 25
Simulation time (mins)
0
200
400
Devices
Asymmetric - attendees to POI Thr
L-A
L-B
L-C
BB-A
BB-B
BB-C
BB can only allocate attendees to the closest POI, resulting in
over-crowded areas
underutilized areas
L enables to count attendees in each POI, allowing a balanced and fair
allocation
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 21 / 27
Evaluation Meet the VIP
Meet the VIP III
Complexity comparison
BB is 8 lines of code
L is 19 lines of code
With 11 more lines of code, L overcomes BB’s partitioning issues and
enables novel capabilities
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 22 / 27
Evaluation Resource allocation
Resource Allocation I
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 23 / 27
Evaluation Resource allocation
Resource Allocation II
Improved functionality
0 5 10 15 20
Simulation time (mins)
0.0
2.5
5.0
Resources
Asymmetric - resources serving needs L-A
L-B
L-C
L-D
BB-A
BB-B
BB-C
BB-D
BB allocates responders only to the closest need
L is capable of a more complex allocation, for instance:
Responders are allocated to the emergency with the least allocated
resources until its needs are satisfied
If two emergencies have the same amount of resources, responders are
allocated to the closest one
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 24 / 27
Evaluation Resource allocation
Resource Allocation III
Complexity comparison
BB is 29 lines of code
L is 17 lines of code
Here L achieves a better allocation policy in fewer lines of code
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 25 / 27
Conclusion
Outline
1 Introduction
Device-centric engineering in the IoT era
Distributed system as a single entity
Resilient building blocks
2 A foundational library for aggregate programming
Goal and methodology
Meta patterns
Organization
Testing environment
3 Evaluation
Meet the VIP
Resource allocation
4 Conclusion
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 25 / 27
Conclusion
Conclusion
With more than 150 functions, protelis-lang:
offers a systematic coverage of the state-of-the art of coordination
abstractions;
Many distributed functions are usable out of the box
Reduces the abstraction gap when engineering aggregate programs;
Less lines of code for the same application
Introduces multiInstance.
Overcomes the limitations of the building blocks
Paves the way to a novel family of meta patterns
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 26 / 27
Conclusion
References I
Jacob Beal, Stefan Dulman, Kyle Usbeck, Mirko Viroli, and Nikolaus Correll.
Organizing the aggregate: Languages for spatial computing.
In Marjan Mernik, editor, Formal and Practical Aspects of Domain-Specific Languages:
Recent Developments, chapter 16, pages 436–501. IGI Global, 2013.
A longer version available at: tt http://arxiv.org/abs/1202.5509.
Jacob Beal and Mirko Viroli.
Building blocks for aggregate programming of self-organising applications.
In Eighth IEEE International Conference on Self-Adaptive and Self-Organizing Systems
Workshops, SASOW 2014, London, United Kingdom, September 8-12, 2014, pages 8–13,
2014.
Jose Luis Fernandez-Marquez, Giovanna Di Marzo Serugendo, Sara Montagna, Mirko
Viroli, and Josep Llu´ıs Arcos.
Description and composition of bio-inspired design patterns: a complete overview.
Natural Computing, 12(1):43–67, 2013.
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 26 / 27
Conclusion
References II
Danilo Pianini, Jacob Beal, and Mirko Viroli.
Improving gossip dynamics through overlapping replicates.
In Coordination Models and Languages - 18th IFIP WG 6.1 International Conference,
COORDINATION 2016, Held as Part of the 11th International Federated Conference on
Distributed Computing Techniques, DisCoTec 2016, Heraklion, Crete, Greece, June 6-9,
2016, Proceedings, pages 192–207, 2016.
Danilo Pianini, Sara Montagna, and Mirko Viroli.
Chemical-oriented simulation of computational systems with ALCHEMIST.
J. Simulation, 7(3):202–215, 2013.
Mirko Viroli, Giorgio Audrito, Jacob Beal, Ferruccio Damiani, and Danilo Pianini.
Engineering resilient collective adaptive systems by self-stabilisation.
ACM Transactions on Modeling and Computer Simulation (TOMACS), 2017.
Submitted for publication.
Mirko Viroli, Jacob Beal, Ferruccio Damiani, and Danilo Pianini.
Efficient engineering of complex self-organising systems by self-stabilising fields.
In 2015 IEEE 9th International Conference on Self-Adaptive and Self-Organizing Systems,
Cambridge, MA, USA, September 21-25, 2015, pages 81–90, 2015.
Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 27 / 27

More Related Content

PPT
IMPACT at OCR Summit
PDF
LDAC 2015 - Towards an industry-wide ifcOWL: choices and issues
PPTX
ICN in the IRTF and IETF
PDF
RNP Cloud Infrastructure model, services and challenges
PDF
Practical Aggregate Programming with Protelis @ SASO2017
PDF
Continual/Lifelong Learning with Deep Architectures, Vincenzo Lomonaco
PDF
FIDA: a framework to automatically integrate FPGA kernels within Data-Science...
PDF
Modeling for Sustainability
IMPACT at OCR Summit
LDAC 2015 - Towards an industry-wide ifcOWL: choices and issues
ICN in the IRTF and IETF
RNP Cloud Infrastructure model, services and challenges
Practical Aggregate Programming with Protelis @ SASO2017
Continual/Lifelong Learning with Deep Architectures, Vincenzo Lomonaco
FIDA: a framework to automatically integrate FPGA kernels within Data-Science...
Modeling for Sustainability

What's hot (8)

PPTX
A Metadata Model for Peer-to-Peer Media Distribution
PPT
Jacques Magen - Future Internet Research and Experimentation (FIRE): Successf...
PDF
FUTEBOL - Federated Union of Telecommunications Research Facilities for an EU...
PPTX
Integrating Performance Modeling in Industrial Automation through AutomationM...
PPTX
FIT@BR – a Future Internet Testbed in Brazil
PPTX
On The Evolution of CAEX: A Language Engineering Perspective
PDF
AutomationML: A Model-Driven View
PDF
Intelligible Machine Learning with Malibu for bioinformatics ...
A Metadata Model for Peer-to-Peer Media Distribution
Jacques Magen - Future Internet Research and Experimentation (FIRE): Successf...
FUTEBOL - Federated Union of Telecommunications Research Facilities for an EU...
Integrating Performance Modeling in Industrial Automation through AutomationM...
FIT@BR – a Future Internet Testbed in Brazil
On The Evolution of CAEX: A Language Engineering Perspective
AutomationML: A Model-Driven View
Intelligible Machine Learning with Malibu for bioinformatics ...
Ad

Similar to Towards a Foundational API for Resilient Distributed Systems Design (20)

PDF
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
PDF
ScaFi-Web, A Web-Based application for Field-based Coordination
PDF
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
PDF
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
PDF
Building blocks for aggregate programming of self-organising applications
PDF
Pregel - Paper Review
PDF
Simulating Large-scale Aggregate MASs with Alchemist and Scala
PDF
From Field-based Coordination to Aggregate Computing
PDF
Aggregate Programming in Scala
PPTX
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
PDF
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
PPT
IS-ENES COMP Superscalar tutorial
PDF
Data Analytics and Simulation in Parallel with MATLAB*
PDF
SLPAY: Distributed Systems Made Simple
PDF
Control flow-sensitive optimizations In the Druid Meta-Compiler
PDF
Engineering Complex Computational Ecosystems (PhD defense)
PDF
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
PDF
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
PDF
Pregel: A System For Large Scale Graph Processing
PDF
A Distributed Simulation of P-Systems
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
ScaFi-Web, A Web-Based application for Field-based Coordination
FScaFi: A Core Calculus for Collective Adaptive Systems Programming
Engineering the Aggregate - Talk at Software Engineering for Intelligent and ...
Building blocks for aggregate programming of self-organising applications
Pregel - Paper Review
Simulating Large-scale Aggregate MASs with Alchemist and Scala
From Field-based Coordination to Aggregate Computing
Aggregate Programming in Scala
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Towards Automated Engineering for Collective Adaptive Systems: Vision and Res...
IS-ENES COMP Superscalar tutorial
Data Analytics and Simulation in Parallel with MATLAB*
SLPAY: Distributed Systems Made Simple
Control flow-sensitive optimizations In the Druid Meta-Compiler
Engineering Complex Computational Ecosystems (PhD defense)
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
Pregel: A System For Large Scale Graph Processing
A Distributed Simulation of P-Systems
Ad

More from Danilo Pianini (20)

PDF
Towards adaptive trajectories for mixed autonomous and human-operated ships
PDF
Time fluid field-based Coordination
PDF
Versioning and License selection
PDF
Continuous Integration
PDF
Enforce reproducibility: dependency management and build automation
PDF
Productive parallel teamwork: Decentralized Version Control Systems
PDF
Computational Fields meet Augmented Reality: Perspectives and Challenges
PDF
Continuous integration and delivery
PDF
Democratic process and electronic platforms: concerns of an engineer
PDF
Software development made serious
PDF
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
PDF
SAPERE Analysis tools
PDF
Engineering computational ecosystems (2nd year PhD seminar)
PDF
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
PDF
SAPERE WP1 Alchemist status at 02/2013
PDF
Engineering Computational Ecosystems
PDF
Recipes for Sabayon: cook your own Linux distro within two hours
PDF
A Framework to Specify and Verify Computational Fields for Pervasive Computin...
PDF
Towards a comprehensive approach to spontaneous self-composition in pervasive...
PDF
Gradient-based Self-organisation Patterns of Anticipative Adaptation
Towards adaptive trajectories for mixed autonomous and human-operated ships
Time fluid field-based Coordination
Versioning and License selection
Continuous Integration
Enforce reproducibility: dependency management and build automation
Productive parallel teamwork: Decentralized Version Control Systems
Computational Fields meet Augmented Reality: Perspectives and Challenges
Continuous integration and delivery
Democratic process and electronic platforms: concerns of an engineer
Software development made serious
Extending the Gillespie's Stochastic Simulation Algorithm for Integrating Dis...
SAPERE Analysis tools
Engineering computational ecosystems (2nd year PhD seminar)
From Engineer to Alchemist, There and Back Again: An Alchemist Tale
SAPERE WP1 Alchemist status at 02/2013
Engineering Computational Ecosystems
Recipes for Sabayon: cook your own Linux distro within two hours
A Framework to Specify and Verify Computational Fields for Pervasive Computin...
Towards a comprehensive approach to spontaneous self-composition in pervasive...
Gradient-based Self-organisation Patterns of Anticipative Adaptation

Recently uploaded (20)

PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PDF
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PDF
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PPTX
famous lake in india and its disturibution and importance
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PPTX
2Systematics of Living Organisms t-.pptx
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
PPTX
INTRODUCTION TO EVS | Concept of sustainability
PDF
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
PPTX
Pharmacology of Autonomic nervous system
PDF
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
PDF
Sciences of Europe No 170 (2025)
PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
The KM-GBF monitoring framework – status & key messages.pptx
TOTAL hIP ARTHROPLASTY Presentation.pptx
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
Assessment of environmental effects of quarrying in Kitengela subcountyof Kaj...
Taita Taveta Laboratory Technician Workshop Presentation.pptx
famous lake in india and its disturibution and importance
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
2Systematics of Living Organisms t-.pptx
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
INTRODUCTION TO EVS | Concept of sustainability
Unveiling a 36 billion solar mass black hole at the centre of the Cosmic Hors...
2. Earth - The Living Planet Module 2ELS
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
Pharmacology of Autonomic nervous system
Lymphatic System MCQs & Practice Quiz – Functions, Organs, Nodes, Ducts
Sciences of Europe No 170 (2025)
Introduction to Cardiovascular system_structure and functions-1
7. General Toxicologyfor clinical phrmacy.pptx

Towards a Foundational API for Resilient Distributed Systems Design

  • 1. Towards a Foundational API for Resilient Distributed Systems Design Matteo Francia1, Danilo Pianini1, Jacob Beal2, Mirko Viroli1 1Alma Mater Studiorum—Universit`a di Bologna 2Raytheon BBN Technologies 2nd eCAS Workshop on Engineering Collective Adaptive Systems 2017-09-22 – Tucson, AZ, USA Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 1 / 27
  • 2. Outline 1 Introduction Device-centric engineering in the IoT era Distributed system as a single entity Resilient building blocks 2 A foundational library for aggregate programming Goal and methodology Meta patterns Organization Testing environment 3 Evaluation Meet the VIP Resource allocation 4 Conclusion Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 2 / 27
  • 3. Introduction Outline 1 Introduction Device-centric engineering in the IoT era Distributed system as a single entity Resilient building blocks 2 A foundational library for aggregate programming Goal and methodology Meta patterns Organization Testing environment 3 Evaluation Meet the VIP Resource allocation 4 Conclusion Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 2 / 27
  • 4. Introduction Device-centric engineering in the IoT era Computing everywhere Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 3 / 27
  • 5. Introduction Device-centric engineering in the IoT era Device-centric engineering Low-level details impact system design Communication protocols Fault tolerance Power saving policy ... Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 4 / 27
  • 6. Introduction Distributed system as a single entity The aggregate programming stack Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 5 / 27
  • 7. Introduction Distributed system as a single entity Level 1: Field Calculus “Everything is a field” Stateless rounds 3 constructs (a) State (rep x e0 e) (b) Neighborhood (nbr x) (c) Restriction (if c e0 e1) H A A D H T H K B (a) rep (b) nbr (c) if Figure: Field calculus constructsFrancia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 6 / 27
  • 8. Introduction Distributed system as a single entity Protelis A concrete implementation of field calculus Functional paradigm Java-family syntax Java interoperability P ::= I F s; ;; Program I ::= import m ;; Imports F ::= def f(x) {s;} ;; Fun definition s ::= e | let x = e ;; Statement e ::= ;; Expression | f(e) | f.apply(e) ;; Fun call | rep(x<-w){s;} ;; State | if(e){s;} else {s ;};; Restriction | nbr{s;} ;; Neighborhood Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 7 / 27
  • 9. Introduction Resilient building blocks Back to the stack Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 8 / 27
  • 10. Introduction Resilient building blocks Level 2: Building blocks Coordination in 4 patterns: G Spreading C Aggregation T Evaporation S Clustering With nice features: Self-stabilization [VBDP15] Composability [BV14] Substitutability [VAB+17] Similar in functionality to basic patterns in bio-inspired coordination [FSM+13] (a) G: spreading (b) C: aggregation 3 1 7 2 4 3 3 1 0 (c) T: evaporation (d) S: clustering Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 9 / 27
  • 11. A foundational library for aggregate programming Outline 1 Introduction Device-centric engineering in the IoT era Distributed system as a single entity Resilient building blocks 2 A foundational library for aggregate programming Goal and methodology Meta patterns Organization Testing environment 3 Evaluation Meet the VIP Resource allocation 4 Conclusion Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 9 / 27
  • 12. A foundational library for aggregate programming Goal and methodology Aggregate programming Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 10 / 27
  • 13. A foundational library for aggregate programming Goal and methodology Level 3: protelis-lang GOALS Collect existing algorithms Classify them by scope Fill in missing patterns Encapsulate coordination best practices “under the hood” Two-stages: 1 Search in existing literature 2 Compare with existing abstractions and technologies [FSM+13, BDU+13] Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 11 / 27
  • 14. A foundational library for aggregate programming Meta patterns multiInstance A A B B Idea Running multiple copies of a process in parallel, one for each identified “source” and aggregate their outputs This pattern can be leveraged for several applications: 1 Temporal replication [PBV16]; 2 acquire information coming from a dynamic number of sources; 3 extend the application scope of existing algorithms. Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 12 / 27
  • 15. A foundational library for aggregate programming Organization Library structure Specialized building blocks Plus meta-programming protelis coord state time countDown cyclicTimer limitedMemory T ... meta boundSpreading multiInstance multiRegion publishSubscribe ... sparsechoice S spreading broadcast crfGradient distanceTo distanceBetween flexGradient gradcast G ... accumulation average C cMultiSum cMultiMin consensus countDevices ... nonselfstabilizing accumulation gossip ... nonselfstabilizing time gossipEver ... Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 13 / 27
  • 16. A foundational library for aggregate programming Organization Code snippet module protelis:coord:spreading /** Propagation of information from a source. * @param source bool , whether the device is a source * @param initial T, information spread by the source * @param metric () -> num , how to estimate distance * @param accumulate (T) -> T, how to accumulate information * @return T, accumulated value */ def G(source , initial , metric , accumulate) { /* implementation with rep , nbr , if ... */ } /** Distance to the closest source. * @param source bool , whether the device is a source * @return num , field distances to the closest source */ def distanceTo(source) { G(source , 0, nbrRange , (v) -> { v + nbrRange.apply () }) } Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 14 / 27
  • 17. A foundational library for aggregate programming Testing environment Automated testing I Testing is a serious concern, as we need to: verify the correctness of the implementation prevent regressions Most of the algorithms in protelis-lang are distributed testing locally provides information of little use a simulated environment is required We exploited Alchemist [PMV13] for testing on simulated networks Every test is composed of: An Alchemist YAML specification, commented with the expected result A Protelis source file All the provided functions are tested If a bug is found and solved, a regression test is included Testing happens at every build Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 15 / 27
  • 18. A foundational library for aggregate programming Testing environment Automated testing II Alchemist Simulator Protelis-Lang Protelis code Protelis-Test initialise check YAML # {0 0.00, 1 1.00, 2 2.00, 3 1.00, 4 1.41, 5 2.41, ...} network-model: type: EuclideanDistance parameters: [1.5] displacements: - in: type: Grid # ... programs: - program: distanceTo /* import lang , spreading , time */ let src = uid =="0" || uid =="5" && timeSinceStart () <=50; distanceTo(src) Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 16 / 27
  • 19. A foundational library for aggregate programming Testing environment Testing example: distanceTo Stabilization: network converges to a stable state Self-Stabilization: network converges after perturbations Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 17 / 27
  • 20. Evaluation Outline 1 Introduction Device-centric engineering in the IoT era Distributed system as a single entity Resilient building blocks 2 A foundational library for aggregate programming Goal and methodology Meta patterns Organization Testing environment 3 Evaluation Meet the VIP Resource allocation 4 Conclusion Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 17 / 27
  • 21. Evaluation Evaluation in crowded scenarios Two scenarios with 1000 devices each Meet the VIP: steering people towards POIs with fixed capacity Resource allocation: coordination of emergency responders to people requesting aid Comparing functionality and complexity of two implementations BB “Building-blocks-only” solution not using any library code Not allowed to use any code from the library Self stabilizing based on the G/C/T/S blocks L Solution with library code (L), including multiInstance Must improve over BB by using multiInstance Allowed to use any of function of protelis-lang to reduce code complexity To reproduce them: https://bitbucket.org/mfrancia/2017-ecas-experiments Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 18 / 27
  • 22. Evaluation Meet the VIP Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 19 / 27
  • 23. Evaluation Meet the VIP Meet the VIP I Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 20 / 27
  • 24. Evaluation Meet the VIP Meet the VIP II Improved functionality 0 5 10 15 20 25 Simulation time (mins) 0 200 400 Devices Asymmetric - attendees to POI Thr L-A L-B L-C BB-A BB-B BB-C BB can only allocate attendees to the closest POI, resulting in over-crowded areas underutilized areas L enables to count attendees in each POI, allowing a balanced and fair allocation Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 21 / 27
  • 25. Evaluation Meet the VIP Meet the VIP III Complexity comparison BB is 8 lines of code L is 19 lines of code With 11 more lines of code, L overcomes BB’s partitioning issues and enables novel capabilities Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 22 / 27
  • 26. Evaluation Resource allocation Resource Allocation I Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 23 / 27
  • 27. Evaluation Resource allocation Resource Allocation II Improved functionality 0 5 10 15 20 Simulation time (mins) 0.0 2.5 5.0 Resources Asymmetric - resources serving needs L-A L-B L-C L-D BB-A BB-B BB-C BB-D BB allocates responders only to the closest need L is capable of a more complex allocation, for instance: Responders are allocated to the emergency with the least allocated resources until its needs are satisfied If two emergencies have the same amount of resources, responders are allocated to the closest one Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 24 / 27
  • 28. Evaluation Resource allocation Resource Allocation III Complexity comparison BB is 29 lines of code L is 17 lines of code Here L achieves a better allocation policy in fewer lines of code Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 25 / 27
  • 29. Conclusion Outline 1 Introduction Device-centric engineering in the IoT era Distributed system as a single entity Resilient building blocks 2 A foundational library for aggregate programming Goal and methodology Meta patterns Organization Testing environment 3 Evaluation Meet the VIP Resource allocation 4 Conclusion Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 25 / 27
  • 30. Conclusion Conclusion With more than 150 functions, protelis-lang: offers a systematic coverage of the state-of-the art of coordination abstractions; Many distributed functions are usable out of the box Reduces the abstraction gap when engineering aggregate programs; Less lines of code for the same application Introduces multiInstance. Overcomes the limitations of the building blocks Paves the way to a novel family of meta patterns Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 26 / 27
  • 31. Conclusion References I Jacob Beal, Stefan Dulman, Kyle Usbeck, Mirko Viroli, and Nikolaus Correll. Organizing the aggregate: Languages for spatial computing. In Marjan Mernik, editor, Formal and Practical Aspects of Domain-Specific Languages: Recent Developments, chapter 16, pages 436–501. IGI Global, 2013. A longer version available at: tt http://arxiv.org/abs/1202.5509. Jacob Beal and Mirko Viroli. Building blocks for aggregate programming of self-organising applications. In Eighth IEEE International Conference on Self-Adaptive and Self-Organizing Systems Workshops, SASOW 2014, London, United Kingdom, September 8-12, 2014, pages 8–13, 2014. Jose Luis Fernandez-Marquez, Giovanna Di Marzo Serugendo, Sara Montagna, Mirko Viroli, and Josep Llu´ıs Arcos. Description and composition of bio-inspired design patterns: a complete overview. Natural Computing, 12(1):43–67, 2013. Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 26 / 27
  • 32. Conclusion References II Danilo Pianini, Jacob Beal, and Mirko Viroli. Improving gossip dynamics through overlapping replicates. In Coordination Models and Languages - 18th IFIP WG 6.1 International Conference, COORDINATION 2016, Held as Part of the 11th International Federated Conference on Distributed Computing Techniques, DisCoTec 2016, Heraklion, Crete, Greece, June 6-9, 2016, Proceedings, pages 192–207, 2016. Danilo Pianini, Sara Montagna, and Mirko Viroli. Chemical-oriented simulation of computational systems with ALCHEMIST. J. Simulation, 7(3):202–215, 2013. Mirko Viroli, Giorgio Audrito, Jacob Beal, Ferruccio Damiani, and Danilo Pianini. Engineering resilient collective adaptive systems by self-stabilisation. ACM Transactions on Modeling and Computer Simulation (TOMACS), 2017. Submitted for publication. Mirko Viroli, Jacob Beal, Ferruccio Damiani, and Danilo Pianini. Efficient engineering of complex self-organising systems by self-stabilising fields. In 2015 IEEE 9th International Conference on Self-Adaptive and Self-Organizing Systems, Cambridge, MA, USA, September 21-25, 2015, pages 81–90, 2015. Francia, Pianini, Beal, Viroli (UniBo, BBN) protelis-lang 2017-09-18 – eCAS 27 / 27