Slide 1

Slide 1 text

Engineering Software Diversity: a Model-Based Approach to Systematically Diversity Communications Brice Morin, Jakob Høgenes and Hui Song (SINTEF Digital, Oslo, Norway) Nicolas Harrand and Benoit Baudry (KTH, Stockholm, Sweden)

Slide 2

Slide 2 text

Diversity… Really?! 2 "Mass-produced" software == Very large monocultures

Slide 3

Slide 3 text

3 Microsoft's implementation of SMB Could have been mitigated with more diversity: a) different implem of SMB, b) other protocols

Slide 4

Slide 4 text

4 Diversity-Stability hypothesis: Increased diversity  increased resilience Red Queen hypothesis: Continued adaptation & evolution  sustainability Diversity in space Diversity in time

Slide 5

Slide 5 text

Diversity in communications 5 • Few different protocols (HTTP/REST, MQTT, WS, etc) • Few different programming languages, for which stubs needs to be implemented • Many different serializations (binary, JSON, XML), in theory ∞

Slide 6

Slide 6 text

A simple non-diversified protocol 6 m1(a, b, c, d, e) m2(a, b, c) m3(a) Repeat 100 times:

Slide 7

Slide 7 text

7 Non-diversified network traffic m1 m2 m3 m1 m2 m3 m1 m2 m3 m1 m2 m3m1 m2 m3

Slide 8

Slide 8 text

Where ThingML helps diversity (though not for communications ) • By default, generate code for C/C++, Java, JavaScript, Go  2w-to-2mo to support a new language (1k-10k LoC) • By default, can communicate through MQTT, WS, UDP, etc  2h-to-2d to support a new protocol (100- 1k LoC) Where ThingML support diversity in communications (though very limited by default) • By default, generate 2 (de)serializers (for each supported language) • Binary à la Google Protocol Buffer and JSON 20min-to-2h to write a new (de)serializer (10-1k LoC) • What if you have 1M users and want unique serializations? 40y-to-240y  +10M-1B LoC to be maintained… 8 MDE to Diversify Communications

Slide 9

Slide 9 text

Approach Overview 9 ThingML Model Core Core Serial Proto Serial Proto ThingML Model Diversified

Slide 10

Slide 10 text

10

Slide 11

Slide 11 text

Shuffle parameters 11 payload[2] payload[3] payload[1]

Slide 12

Slide 12 text

Shuffle message definition 12

Slide 13

Slide 13 text

Duplicate messages 13

Slide 14

Slide 14 text

Split messages 14

Slide 15

Slide 15 text

All at once? 15

Slide 16

Slide 16 text

16

Slide 17

Slide 17 text

Measuring diversity in space 17

Slide 18

Slide 18 text

Measuring diversity in time 18

Slide 19

Slide 19 text

What's the overhead? 19

Slide 20

Slide 20 text

Conclusion • Systematic diversification • A perfect use case for MDE! • We applied MDE to the diversification of communications • Significant diversity can be introduced automatically • No overhead at design-time: just specify your API, we take care of the rest • Runtime Overhead is compatible with "mass-produced" software/firmware 20

Slide 21

Slide 21 text

Question? 21 https://github.com/SINTEF-9012/thingml-diversifier https://github.com/modelsconf2018/artifact-evaluation/tree/master/morin See https://github.com/TelluIoT/ThingML @bm0rin brice-morin

Slide 22

Slide 22 text

Teknologi for et bedre samfunn

Slide 23

Slide 23 text

Is that diversity useful? • Note: based on further experiments, not to be found in the paper 24

Slide 24

Slide 24 text

25

Slide 25

Slide 25 text

26