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
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/
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
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
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
7 16-11-08
Conventional Update
Martin Alexander Neumann, KIT
𝑣0 update
stop restart
persist
data
offline
𝑣1 reload
data
online
disruption
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
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
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
𝑢𝑝𝑑𝑎𝑡𝑒 𝑐𝑜𝑑𝑒
𝑎𝑢𝑡𝑜. 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚.
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
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
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
15 16-11-08
Case Study – Message Broker
Martin Alexander Neumann, KIT
Programming effort? Broker performance on update?
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
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
18 16-11-08
Update Point Instrumentation
Martin Alexander Neumann, KIT
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
20 16-11-08
Update Code – Moquette v0.7 to v0.8
Martin Alexander Neumann, KIT
Field moved
Fields renamed
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
22 16-11-08
Throughput Latency
Martin Alexander Neumann, KIT
Updating Performance
Update while no connections or messages are lost
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