implicit middleware
DESCRIPTION
http://link.springer.com/chapter/10.1007%2F978-3-540-88875-8_108 This paper introduces an approach for abstracting access to functionality in Pervasive Computing systems where very different types of devices co-exist. Tiny, resource-poor 8-bit based wireless embedded sensor nodes use highly fragmented programming, with code distributed over possibly hundreds of nodes. More powerful devices as mobile, handled devices, laptops or even server use coarse-grained distribution. The Implicit Middleware approach provides a way to both unify and simplify middleware for Pervasive Computing systems, by means of transparently distributing functionality in the system and making them context aware. The approach ensures optimized run-time behavior and adaptation to the system landscape. We also present an implementation using the XMLVM representation for code generation, and an evaluation running on PCs, J2ME CLDC 1.0 compatible 32Bit sensor nodes and 8Bit-MCU based nodes with an optimized light-weight VM.TRANSCRIPT
Implicit MiddlewareT. Riedel, M. Beigl, M. Berchtold, C. Deckerand A. Puder
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 2
Motivation
Control of complex information flows between processes in the real world and computer-based information systems.
Information systems
Real world
ManualAccumulation
Files
Information
Objects, items, activities, events
Data basesObject-ID
Barcodescanning
RFID Tags
State
Sensor networks
Processes
SmartItems
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 3
Motivation: CoBis
Business Logic describes the real world processes in a virtual representation
Interfaces needed to couple real and virtual world and keep consistency
Smart Items: deploy business logic on sensor nodes
Example CoBIs: SAP Environment Health and Safety (EH&S)
Sensor Nodes on Chemical Drums
Storage Regulations Detection Services: Storage Incompatibility
Absolute volume limit
Temperature / Environmental constraints
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 4
Relocation of Services
Challenge: Integration Sensing Services in Application Framework
Problems: How to provide syntactically and semantically equal Interfaces?How to integrate into development process?How much of the code to execute on “the Node”?How to partition (existing) Services?
Task
Relocated Task
Collaborative Business Item s
Business Logic Backend
Sensor Network Relocated Task
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 5
Design of an Implicit Middleware
How much of code to execute on “the node”? Development date != deployment date
Changing HardwareAdvances in HardwareUse of more constraint/cheaper HW
Changing ConstraintsLifetime/energy saving constraints differ per application (not per service)
Changing Networking/topologies Based on local necessities, link costs vary with topologies (1 vs. n hop)Networks with hybrid nodes: more powerful router/gateway nodes
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 6
Design of an Implicit Middleware
How to partition (existing) Services? Maintain semantics of existing Service (Middleware):
Location transparencyAccess transparencyConcurrency transparencyFailure transparency *Technology transparency
Adding Middleware adds new abstractions: use VM semantics instead !!
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 7
Implicit Middleware Work-flow
Generating the optimal distribution of an application/service Optimality based on model !
Just before deployment
Implementation optimizes execution times network
instruction
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 8
Transformation Architecture
Java App/Service
Allocation Model
Trace Model
Optimization Problem
Distributed App
System Model
Platform ModelsSystem Landscape
Simulation
Optimization
Monitoring
Byte-Code Transformation
DeploymentInstantiation
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 9
Modeling Software and System
Java App/Service
Allocation Model
Trace Model
Optimization Problem
Distributed App
System Model
Platform ModelsSystem Landscape
Simulation Monitoring
Deployment
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 10
System/Trace Model
System Model References Platform Model
Contains cost functions/parametersUser defined/from simulation
Generated from Node Discovery
Trace Model Use Eclipse Test and Performance Tools
Generates ecore model
Use simulated inputs Currently by random distributionSet of simulated runtime libraries
Execute program locally
Approximateaverage execution time of Class Aaverage number of calls from Class A to B
System Model
Platform ModelsSystem Landscape
Monolithic Java App
Trace Model
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 11
Optimization
Java App/Service
Allocation Model
Trace Model
Optimization Problem
Distributed App
System Model
Platform ModelsSystem Landscape
Optimization
Deployment
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 12
Optimization
Generate formal ILP Problem that assigns all classes to a Platform
( is the allocation relation to be found)
while minimizing communication and execution costs
Sensor Classes and immovable interfacesare fixed:
Allocation Model
Trace Model
Optimization Problem
System Model
Optimization
is a product :(
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 13
Byte-Code Transformation
Java App/Service
Allocation Model
Trace Model
Optimization Problem
Distributed App
System Model
Platform ModelsSystem Landscape
Byte-Code Transformation
Deployment
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 14
Byte-Code Transformation
Uses either ASM or XMLVM for code analysis/rewriting
Transformations build to retain code semantics
Statical analysis and rewriting/code generation on byte code/XMLVM level
Monolithic Java App
Allocation Model
Distributed App
Example: computationally heavy orclasses w/ WS interface
1st Stage: Partitioning Generate platform independent middleware code
2nd Stage: Target code generation
Use of XSLT technology
Principal support for arbitrary target language
Proof of concept javascript/C++ targets
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 15
Stub and Dispatcher Generation
Generated class stubs replace remote classes Interface to middleware runtime
Connects local and remote garbage collection
Generated dispatcher No runtime reflection
Perfect hash (possible because of late optimization)
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 16
Transparent Distribution
Stubs call Middleware to marshal calls Simple push interface
Type safe for basic data types
Objects are passed by reference
Add fixed class and method id
Dispatch calls method by id pops arguments from message
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 17
Runtime Architecture
Generic
Portable Specif
ic
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 18
Instantiation
Java App/Service
Allocation Model
Trace Model
Optimization Problem
Distributed App
System Model
Platform ModelsSystem Landscape
DeploymentInstantiation
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 19
Deployment: Java on Particles/Sun Spots
Ultra light-weight Java VM on Particle computersFurther size and static optimizations on byte code level
Platform Independent Java ByteCode
Java ByteCodefor Particles
Strip down, optimization, versioning
Particle Computer
Java Virtual Machine
WirelessTransfer
Versioning control, Selective updates,Mass programming
CLDC 1.1 Java for Sun Spots
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 20
Optimization Results
Optimizing only for execution times
Optimizing only for call latencies
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 21
Performance
Optimizer (Simple Vibration Alarm Example) Using ZIMPL Interface: 342 variables and 980 constraints
Solved 0.2s on 1.65GHz x86 CPU by soPlex solver
Branch and Bound
Called once on deployment
Middleware Overhead Particle Computer
Low execution overhead (typ. <1ms per call vs. 13ms RF slot)Low memory overhead (in bytes):
Sun SpotsStub w/ Methods: code size 4,13 kByte High overhead due to thread generation (round trip >500 ms!!!)
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 22
Limitations/Discussion I
More complex cost models?Trace model based
Also becomes more difficult to modelExhaustive search
implemented but slowPossible heuristics are questionable
Describe as non-linear (convex) optimizations does also not describe most network effects
Simulation in the loopEasy integrability
All VM basedSimulator hooks can be generated
Really costly!
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 23
Limitations/Discussion II
Finer granularity for partitioning?Object mobility
Probably needed for realistic appsStubs for all classesSynchronization overhead = more runtime middlewareEfficient only with more statical analysis (data flow)
Function levelNeed to expose internal state
Instruction levelMore difficult to retain semanticsDistributed VM
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 24
Conclusion
Solution for easy development of “smart item” technology (1-click)
Optimizes partitioning between hybrid devices Based on device capabilities
Network properties
Implementation using generative model based approach Minimal runtime requirements
No reflection / efficient platform independent code
Support for energy efficient Particle sensor nodes and CLDC 1.1
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 25
Future Directions
Integration in Deployment Framework like OSGiRun Implicit Middleware as container/host rOSGi synergies?
Start directly from Abstract Models Does not require “reverse” engineering of classes
System already nicely integrates in EMF Toolchain
Build better models for simulation aspects
Integrate e.g. performance measures earlier in development process
Support for distributed sensor networking Capture semantics of context
Move away from pure Java semantics
Support parallel aggregating/redundant operations with variable # of nodes
Till Riedel , TecO Persys'08, Monterrey, 14.11.2008 26
Questions?