21
KIT University of the State of Baden-Wuerttemberg and National Research Center of the Helmholtz Association PERVASIVE COMPUTING SYSTEMS, INSTITUTE FOR TELEMATICS, FACULTY OF INFORMATICS www.kit.edu Always-On Web of Things Infrastructure Dynamic Software Updating 2016-11-07, Web of Things Workshop Martin Alexander Neumann, Christoph Tobias Bach, Andrei Miclaus, Till Riedel, Michael Beigl

Always-On Web of Things Infrastructure Dynamic Software Updating

Embed Size (px)

Citation preview

Page 1: Always-On Web of Things Infrastructure Dynamic Software Updating

KIT – University of the State of Baden-Wuerttemberg and

National Research Center of the Helmholtz Association

PERVASIVE COMPUTING SYSTEMS, INSTITUTE FOR TELEMATICS, FACULTY OF INFORMATICS

www.kit.edu

Always-On Web of Things Infrastructure Dynamic Software Updating 2016-11-07, Web of Things Workshop

Martin Alexander Neumann, Christoph Tobias Bach, Andrei Miclaus, Till Riedel, Michael Beigl

Page 2: Always-On Web of Things Infrastructure Dynamic Software Updating

2 16-11-08

e.g. production control,

health monitoring

Simplify IoT

interoperability

Common technologies/

web standards

HTTP, REST

JSON, JSON-LD

WebSockets, CoAP, MQTT

Martin Alexander Neumann, KIT

Web of Things

http://forklog.net/the-way-iot-and-blockchain-change-the-world/

Page 3: Always-On Web of Things Infrastructure Dynamic Software Updating

3 16-11-08

Updating the Infrastructure

Cloud services and gateways

Highly available, real-time communications

Maintenance windows, or rolling updates

Software updates

Low-disruptive rollout of updates and patches

But, especially: timely rollout of security patches

Martin Alexander Neumann, KIT

Page 4: Always-On Web of Things Infrastructure Dynamic Software Updating

5 16-11-08

Ad Hoc

Approach enabling …

Every update to every

installation of a software

has to be planned

Takes time and effort

General

At least – approach fits

an update to

all installations of a SW

Better – approach fits

all updates to

all installations of a SW

Dynamic Software Updating

Martin Alexander Neumann, KIT

Low-Disruptive and Timely Hot/Live Updates

Least preferrable with

common technologies

widely adopted

Page 5: Always-On Web of Things Infrastructure Dynamic Software Updating

6 16-11-08

1. Preparation

Vendor tailors

program to DSU system

2. Installation/Rollout

Vendor provides

a dynamic update

(instead of a regular one)

to update any old

program instances

Martin Alexander Neumann, KIT

Goal of Dynamic Software Updating

Page 6: Always-On Web of Things Infrastructure Dynamic Software Updating

7 16-11-08

Conventional Update

Martin Alexander Neumann, KIT

𝑣0 update

stop restart

persist

data

offline

𝑣1 reload

data

online

disruption

Page 7: Always-On Web of Things Infrastructure Dynamic Software Updating

8 16-11-08

Transform state in memory → efficient

Stop 𝑣0 immediately → timely

Transform anything → flexible

Use with any software → generic

Dynamic Software Updating

Martin Alexander Neumann, KIT

𝑣0 DSU

offline

𝑣1

online

disruption

Page 8: Always-On Web of Things Infrastructure Dynamic Software Updating

9 16-11-08

Close classes world and load 𝑣1

Compare 𝑣0 to 𝑣1 for automatic transformation

Load update code 𝑣0 → 𝑣1 that finalizes transform.

𝑢𝑛𝑙𝑜𝑎𝑑 𝑣0 𝑙𝑜𝑎𝑑 𝑣1

𝑐𝑜𝑚𝑝𝑎𝑟𝑒

Lusagent DSU Phases – Preparation & Cleanup

Martin Alexander Neumann, KIT

𝑣0 DSU

offline

𝑣1

online

prepare cleanup

update

Page 9: Always-On Web of Things Infrastructure Dynamic Software Updating

10 16-11-08

Stop all threads, transform state, release threads

Properties or onetime instrumentation for safe state

Explore entire heap to find and transform objects

Lusagent DSU Phases – Update

Martin Alexander Neumann, KIT

𝑣1 𝑣0

offline online

prepare cleanup

update

𝑢𝑝𝑑𝑎𝑡𝑒 𝑐𝑜𝑑𝑒

𝑎𝑢𝑡𝑜. 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚.

Page 10: Always-On Web of Things Infrastructure Dynamic Software Updating

12 16-11-08

Develop (one-time) program instrumentation

Definition of update points for timely updates

Lusagent DSU Workflow (1)

Martin Alexander Neumann, KIT

Update Points

𝑣0

𝑣1

𝑣0

Update Points

𝑣1

IDE

Page 11: Always-On Web of Things Infrastructure Dynamic Software Updating

13 16-11-08

Develop update-specific update code/transformations

Understand automatically covered transformations

Program finalization of transformations

Lusagent DSU Workflow (2)

Martin Alexander Neumann, KIT

𝑣0

𝑣1

Analysis Stubs for

Update Code

𝑣0 → 𝑣1

Automatic

Transformation

IDE Update

Code

𝑣0 → 𝑣1

Page 12: Always-On Web of Things Infrastructure Dynamic Software Updating

14 16-11-08

Lusagent DSU Workflow (3)

Martin Alexander Neumann, KIT

Run instance of 𝑣0

Install dynamic update to 𝑣1 (on instance of 𝑣0)

DSU System

Update Points

𝑣1

DSU System

Update Points

𝑣0

Update Points

𝑣1

Update Code

𝑣0 → 𝑣1

DSU System

Update Points

𝑣0

1 3 2

Page 13: Always-On Web of Things Infrastructure Dynamic Software Updating

15 16-11-08

Case Study – Message Broker

Martin Alexander Neumann, KIT

Programming effort? Broker performance on update?

Page 14: Always-On Web of Things Infrastructure Dynamic Software Updating

16 16-11-08

Features

MQTT 3.1, QoS 0, 1, 2

Persistent sessions

Event-processor, netty.io

IoT Framework

MQTT adapter

Fraunhofer’s SensorThingsServer (OGC SensorThings API), …

Releases

Martin Alexander Neumann, KIT

Moquette – Java MQTT Message Broker

Users

Version Date SLoC Classes

v0.7.0 7/2015 8468 151

v0.8.0 1/2016 9691 166

v0.8.1 2/2016 9670 163

Updates

1 major & 1 minor release

Page 15: Always-On Web of Things Infrastructure Dynamic Software Updating

17 16-11-08

Programming Effort – Instrumentation

Martin Alexander Neumann, KIT

Version Date SLoC Classes

v0.7.0 7/2015 8468 151

v0.8.0 1/2016 9691 166

v0.8.1 2/2016 9670 163

Changed

classes

Added

lines

Deleted

lines

3 19 3

2 11 1

same

Add update points (& long-running code interruptable)

4 netty.io event processors 4 update points

Timer (background thread) persisting database

𝑣0.7 uses additional async. ring buffer in reception

Page 16: Always-On Web of Things Infrastructure Dynamic Software Updating

18 16-11-08

Update Point Instrumentation

Martin Alexander Neumann, KIT

Page 17: Always-On Web of Things Infrastructure Dynamic Software Updating

19 16-11-08

Programming Effort – Update Code

Martin Alexander Neumann, KIT

Version Date SLoC Classes

v0.7.0 7/2015 8468 151

v0.8.0 1/2016 9691 166

v0.8.1 2/2016 9670 163

Transformed

classes

SLOC

16 230

3 28

𝑣0.7 → 𝑣0.8 took about 1 day

Page 18: Always-On Web of Things Infrastructure Dynamic Software Updating

20 16-11-08

Update Code – Moquette v0.7 to v0.8

Martin Alexander Neumann, KIT

Field moved

Fields renamed

Page 19: Always-On Web of Things Infrastructure Dynamic Software Updating

21 16-11-08

Update Code – Moquette v0.8 to v0.8.1

Martin Alexander Neumann, KIT

Packages changed, last class renamed

Transform

how persisted

messages

are stored

Page 20: Always-On Web of Things Infrastructure Dynamic Software Updating

22 16-11-08

Throughput Latency

Martin Alexander Neumann, KIT

Updating Performance

Update while no connections or messages are lost

Page 21: Always-On Web of Things Infrastructure Dynamic Software Updating

23 16-11-08

Summary

Web of Things

Common technologies

Updating the infrastructure

Dynamic Software Updating

In-memory updates, generic

Development workflow

Case Study: Moquette MQTT message broker

Programming efforts

Performance properties

Martin Alexander Neumann, KIT