Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAIS, Paphos, Cyprus, 6 June 2007 Observability and Controllability of Wireless Software Components Fabien Romeo.

Similar presentations


Presentation on theme: "DAIS, Paphos, Cyprus, 6 June 2007 Observability and Controllability of Wireless Software Components Fabien Romeo."— Presentation transcript:

1 fabien.romeo@fromeo.fr www.fromeo.fr1 DAIS, Paphos, Cyprus, 6 June 2007 Observability and Controllability of Wireless Software Components Fabien Romeo Liuppa, Université de Pau

2 fabien.romeo@fromeo.fr www.fromeo.fr2 DAIS, Paphos, Cyprus, 6 June 2007 Background Component-Based Software Engineering (CBSE) « A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can be deployed independently and is subject to composition by third parties. » Szyperski et al (2002). CBSE applied to Wireless Systems (WS) WS are heterogeneous systems and software componentization allows adaptation WS are dynamic and open systems, and as such, they often use Service-Oriented Architecture, which relies on software components (eg. OSGi bundles)

3 fabien.romeo@fromeo.fr www.fromeo.fr3 DAIS, Paphos, Cyprus, 6 June 2007 The need for management in WS Toward Open-World Software: Issues and Challenges (IEEE Computer Magazine, October 2006): (IEEE Computer Magazine, October 2006): « A highly dynamic and open system necessitates runtime monitoring to watch for situations that might require suitable reactions to assure the desired level of global quality. […] As a result of monitoring, it should be possible to handle deviations from expected behaviors and plan for a reconfiguration. » I. Crnkovic, Component-based Software Engineering for Embedded Systems, in ICSE05. A. Möller, J. Fröberg, and M. Nolin, Industrial Requirements on Component Technologies for Embedded Systems, in CBSE04. Luciano Baresi, Elisabetta Di Nitto, and Carlo Ghezzi

4 fabien.romeo@fromeo.fr www.fromeo.fr4 DAIS, Paphos, Cyprus, 6 June 2007 Management in CBSE Maintaining component-based systems is a difficult problem – Voas (1998) Black-boxes, in particular COTS components No communication between providers and assemblers Management is often an after-thought Three kinds of approaches in the literature: based on the components infrastructure Lifecycle management, low-level states (attributes) access based on the applications architecture Components reify the architecture, control by replacement based on the components behavior External observations are confronted against behavior models

5 fabien.romeo@fromeo.fr www.fromeo.fr5 DAIS, Paphos, Cyprus, 6 June 2007 Our proposal A runtime management infrastructure Address the internal behavior of software components Wireless remote access Deployment on constrained devices (PDA, mobile phones, …) Model-Driven Engineering philosophy The components behavior is designed with UML State Machines Direct execution and control of components behavior by their internal managers which embed a PauWare Model Execution Engine The same models designed at development time are retrieved at runtime for management purpose

6 fabien.romeo@fromeo.fr www.fromeo.fr6 DAIS, Paphos, Cyprus, 6 June 2007 Wireless Software Components Architecture Managed Component Business Component Internal Manager provided interface required interface external effector external pushed sensor external pulled sensor external application port external management port internal effector internal pulled sensor internal pushed sensor internal management port internal management port

7 fabien.romeo@fromeo.fr www.fromeo.fr7 DAIS, Paphos, Cyprus, 6 June 2007 Statecharts [Harel 1987] : Statecharts = state-diagrams : XOR On Off create/stop/ restart/ destroy/ WaitProcess On request / WaitProcess On [Queue->isNotEmpty] / Listen request / Queue->add(client) + depth : hierarchie + orthogonality : AND + broadcast-communication : Asynchronous Communication Notation: ^signal

8 fabien.romeo@fromeo.fr www.fromeo.fr8 DAIS, Paphos, Cyprus, 6 June 2007 The PauWare Engine Power the execution of Statecharts models (simulation, verification, implementation) All-terrain Java Implementation (J2EE, J2SE et J2ME) Statecharts Model of the application dynamics PauWare Library PauWare Engine

9 fabien.romeo@fromeo.fr www.fromeo.fr9 DAIS, Paphos, Cyprus, 6 June 2007 The PauWare Library Declaration of states : Classes Statechart and Statechart_monitor Composition of states : XOR and AND operators Declaration of transitions : fires(String event, Statechart from, Statechart to, boolean guard, Object target, String action, Object[] args); Generation of events : _statechart_monitor.run_to_completion("event"); Statechart Statechart_monitor

10 fabien.romeo@fromeo.fr www.fromeo.fr10 DAIS, Paphos, Cyprus, 6 June 2007 Example : Light /* UML statecharts */ Statechart _On = new Statechart("On"); _On.doActivity(this,"display"); Statechart _Off = new Statechart("Off"); _Off.inputState(); /* PauWare engine */ OnOff Light turnOff turnOn On Off do / display Statechart_monitor _Light = new Statechart_monitor(_On.xor(_Off),"Light"); /* UML transitions */ _Light.fires("turnOn",_Off,_On); _Light.fires("turnOff",_On,_Off); /* UML events */ public void turnOn() throws Statechart_exception { _Light.run_to_completion("turnOn"); } public void turnOff() throws Statechart_exception { _Light.run_to_completion("turnOff"); } /* the code is incomplete */

11 fabien.romeo@fromeo.fr www.fromeo.fr11 DAIS, Paphos, Cyprus, 6 June 2007 PauWare Component Model « interface » Light functional interface turnOn() turnOff() Light « class » Light implementation class « service » turnOn() « service » turnOff() « action » display() OnOff Light turnOff turnOn On Off do / display _Composytor::Statechart_monitor 1_Light « implement » Internal Manager 1 _StateMachine

12 fabien.romeo@fromeo.fr www.fromeo.fr12 DAIS, Paphos, Cyprus, 6 June 2007 PauWare WMX PauWare with JMX provides a management framework for non-wireless components Too much for constrained devices PauWare Java Reflexion Mechanisms JMX Web Server Not feasible Java ME

13 fabien.romeo@fromeo.fr www.fromeo.fr13 DAIS, Paphos, Cyprus, 6 June 2007 WMX Wireless Management eXtensions http://wmx.fromeo.fr Manager Statechart Management Interface Controle Monitor Application SideManagement Side Java MEJava SE

14 fabien.romeo@fromeo.fr www.fromeo.fr14 DAIS, Paphos, Cyprus, 6 June 2007 Demo : Traffic Light

15 fabien.romeo@fromeo.fr www.fromeo.fr15 DAIS, Paphos, Cyprus, 6 June 2007 WMX: new problems Wireless Management eXtensions http://wmx.fromeo.fr Manager Statechart Management Interface Controle Monitor Replication ? Coherence ? What to transmit and how ? - Events ? - States ? Unreliable Communication: Asynchronous Mode ?

16 fabien.romeo@fromeo.fr www.fromeo.fr16 DAIS, Paphos, Cyprus, 6 June 2007 Coherence of statecharts (1) On Off Component turnOff [component.temperature < 40] turnOn On Off On Off Component turnOff [component.temperature < 40] turnOn On Off event turnOff component.temperature = 43 turnOff Unknown? Application Side Management Side And we dont want to send low-level states (attributes) Forwarding events causes problems with guards

17 fabien.romeo@fromeo.fr www.fromeo.fr17 DAIS, Paphos, Cyprus, 6 June 2007 Coherence of statecharts (2) On Off Component turnOff [component.temperature < 40] turnOn On Off On Off Component On Off transition turnOff component.temperature = 43 Application Side Management Side as we still dont want to send low-level states (attributes)… If we forward the transitions…

18 fabien.romeo@fromeo.fr www.fromeo.fr18 DAIS, Paphos, Cyprus, 6 June 2007 Coherence of statecharts (3) On Off Component turnOff [component.temperature < 40] turnOn On Off On Off Component On Off transition turnOff component.temperature = 39 Application Side Management Side On Off we didnt have to send low-level states (attributes) … the statecharts are synchronized … because the internal manager handled them for us…

19 fabien.romeo@fromeo.fr www.fromeo.fr19 DAIS, Paphos, Cyprus, 6 June 2007 Composition Management Desynchronization of automates (example : Traffic Light) Undetectable Error by Model Checking It is supposed to work Shows the possibility to define management policies based on the replicated statechart

20 fabien.romeo@fromeo.fr www.fromeo.fr20 DAIS, Paphos, Cyprus, 6 June 2007 States – Sub-states (1) TrafficLight Start entry: goRed Red Yellow Green goRed/ ^RedLight.turnOn goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff goYellow/^YellowLight.turnOn, ^GreenLight.turnOff goRed/^RedLight.turnOn, ^YellowLight.turnOff OnOff GreenLight turnOff turnOn On Off do / display OnOff RedLight turnOff turnOn On Off do / display OnOff YellowLight turnOff turnOn On Off do / display

21 fabien.romeo@fromeo.fr www.fromeo.fr21 DAIS, Paphos, Cyprus, 6 June 2007 States – Sub-states (2) TrafficLight Start entry: goRed Red Yellow Green goRed/ ^RedLight.turnOn goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff goYellow/^YellowLight.turnOn, ^GreenLight.turnOff goRed/^RedLight.turnOn, ^YellowLight.turnOff OnOff GreenLight turnOff turnOn On Off do / display OnOff YellowLight turnOff turnOn On Off do / display OnOff RedLight turnOff turnOn On Off do / display

22 fabien.romeo@fromeo.fr www.fromeo.fr22 DAIS, Paphos, Cyprus, 6 June 2007 States – Sub-states (3) TrafficLight Start entry: goRed Red Yellow Green goRed/ ^RedLight.turnOn goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff goYellow/^YellowLight.turnOn, ^GreenLight.turnOff goRed/^RedLight.turnOn, ^YellowLight.turnOff OnOff YellowLight turnOff turnOn On Off do / display OnOff GreenLight turnOff turnOn On Off do / display OnOff RedLight turnOff turnOn On Off do / display

23 fabien.romeo@fromeo.fr www.fromeo.fr23 DAIS, Paphos, Cyprus, 6 June 2007 Composite Manager Monitor Control state_changed(transition) to_state(state) / ^managed.to_state(state) execute(action) / ^managed.execute(action) part_state_changed [not valid_state_guard] Undefined State Composition Defined State Composition part_state_changed / ^self.check [valid_state_guard] check / ^self.to_state(state) [consistency_guard] in(state) / ^managed.in(state) valid_state_guard = [( part1Manager.managedIn(part1ComposedState1) && … && partNManager.managedIn(partNComposedState1) ) || … || ( part1Manager.managedIn(part1ComposedStateN) && … && partNManager.managedIn(partNComposedStateN) )] consistency_guard = [( !(state = compositeState1) && !(self.managedIn(compositeState1)) && part1Manager.managedIn(part1ComposedState1) && … && partNManager.managedIn(partNComposedState1) ) || … || ( !(state = compositeStateN) && !(self.managedIn(compositeStateN)) && part1Manager.managedIn(part1ComposedStateN) && … && partNManager.managedIn(partNComposedStateN) )]

24 fabien.romeo@fromeo.fr www.fromeo.fr24 DAIS, Paphos, Cyprus, 6 June 2007 Part Manager Monitor state_changed(transition) / ^CompositeManager.part_state_changed in(state) / ^managed.in(state) Control to_state(state) / ^managed.to_state(state) execute(action) / ^managed.execute(action)

25 fabien.romeo@fromeo.fr www.fromeo.fr25 DAIS, Paphos, Cyprus, 6 June 2007 Performances? Deployed on a HP iPAQ hx4700 JVM IBM J9 Complex Case Studies : Home automation system Railcar System (J2EE + JMS) …, your system

26 fabien.romeo@fromeo.fr www.fromeo.fr26 DAIS, Paphos, Cyprus, 6 June 2007 ImplementationBenchmarkOverhead per state change Pure Java2 ms0 μs Java + reflect API14 ms0,12 μs JMX (internal access)721ms7,19 μs PauWare (w/o cache)1491 ms14,89 μs PauWare (w cache)1027 ms10,25 μs Velcro (w/o cache)1529 ms15,27 μs Velcro (w cache)1038 ms10,36 μs Following implementations include I/O or networking Pure Java + System.out.print()2584 ms25,82 μs WMX (velcro + sockets)3893 ms38,91 μs JMX + RMI connector22077ms220,75 μs Performances – Quantitative Study Benchmark 100.000 loops of state changes (adapted from JAC Benchmark) Intel Centrino 1600MHz, 512 Mo RAM, WinXP, JVM 1.5 SUN

27 fabien.romeo@fromeo.fr www.fromeo.fr27 DAIS, Paphos, Cyprus, 6 June 2007 Conclusion PauWare Components driven by executable statecharts But also a framework for experimenting research results in MDA, CBSE, … Velcro + WMX Management of the software components behavior in the context of wireless systemsPerspectives Integration into other component models (OSGi, Fractal, …) Persistence at runtime of other types of models, (other views for management) Autonomic Computing: a solution to put the human on the loop…

28 fabien.romeo@fromeo.fr www.fromeo.fr28 DAIS, Paphos, Cyprus, 6 June 2007 Thank you for listening! Fabien Romeo, Franck Barbier, Jean-Michel Bruel, Observability and Controllability of Wireless Software Components, 7th IFIP Conference on Distributed Applications and Interoperable Systems, Paphos, Cyprus, 5-8 june, 2007. Fabien Romeo, Franck Barbier, Jean-Michel Bruel, Observability and Controllability of Wireless Software Components, 7th IFIP Conference on Distributed Applications and Interoperable Systems, Paphos, Cyprus, 5-8 june, 2007. Code available athttp://www.pauware.com Code available athttp://www.pauware.com http://wmx. fromeo.fr http://wmx. fromeo.fr « Power is not a means, it is an end. » George Orwell, Nineteen Eighty-Four [PauWare]

29 fabien.romeo@fromeo.fr www.fromeo.fr29 DAIS, Paphos, Cyprus, 6 June 2007 Bonus Track…

30 fabien.romeo@fromeo.fr www.fromeo.fr30 DAIS, Paphos, Cyprus, 6 June 2007 Velcro PauWare (java.lang.reflect) PauWare (java.lang.reflect) Velcro java.lang.reflect PauWare Velcro

31 fabien.romeo@fromeo.fr www.fromeo.fr31 DAIS, Paphos, Cyprus, 6 June 2007 Horizontal Composition Components have the same granularity Client / Server or Peer to Peer Provided Interfaces / Required Interfaces Low coupling Distributed Application Statecharts Communication by signal JMS, Message-Driven Bean

32 fabien.romeo@fromeo.fr www.fromeo.fr32 DAIS, Paphos, Cyprus, 6 June 2007 Example : Traffic Light TrafficLight Start entry: goRed Red Yellow Green goRed/ ^RedLight.turnOn goGreen/ ^GreenLight.turnOn, ^RedLight.turnOff goYellow/^YellowLight.turnOn, ^GreenLight.turnOff goRed/^RedLight.turnOn, ^YellowLight.turnOff RedLight:LightGreenLight:LightYellowLight:LightTrafficLight OnOff Light turnOff turnOn On Off do / display

33 fabien.romeo@fromeo.fr www.fromeo.fr33 DAIS, Paphos, Cyprus, 6 June 2007 Vertical Composition (De)composition composite/compound Hierarchie (cf. Fractal) A higher coupling Life-cycle Dependances, encapsulation, … Theoretical Foundations Revised formalization of aggregation and composition in UML (IEEE TSE 29(5) et 29(11) - 2003) State Machines of compound components integrated into the State Machine of the composite as concurrent macro states : public class Light extends _PauWare.Composable {/*... */} Light redLight, yellowLight, greenLight; Statechart_monitor trafficLight = new Statechart_monitor(redLight.state_machine().and(yellowLight.state_machine()).and(greenLight.state_machine()).and(start.xor(red).xor(yellow).xor(green)));

34 fabien.romeo@fromeo.fr www.fromeo.fr34 DAIS, Paphos, Cyprus, 6 June 2007 Example : Traffic Light TrafficLight Start entry: goRed Red Yellow Green goRed/ ^self.RedLight::turnOn goGreen/ ^self.GreenLight::turnOn, ^self.RedLight::turnOff goYellow/^self.YellowLight::turnOn, ^self.GreenLight::turnOff goRed/^self.RedLight::turnOn, ^self.YellowLight::turnOff GreenLight:LightYellowLight:LightRedLight:Light TrafficLight RedLight:Light YellowLight:Light GreenLight:Light « delegate »

35 fabien.romeo@fromeo.fr www.fromeo.fr35 DAIS, Paphos, Cyprus, 6 June 2007 PauWare Component Model A State Machine Execution Engine (diagrammes UML 2) Model verification at development time Support for implementation Models persist at runtime State Machine Components ? Structure-Behavior Binding (i.e. component-statechart) Support for horizontal composition and vertical composition (hierarchical)

36 fabien.romeo@fromeo.fr www.fromeo.fr36 DAIS, Paphos, Cyprus, 6 June 2007 PauWare Component Model « interface » Light functional interface turnOn() turnOff() Light « class » Light implementation class « service » turnOn() « service » turnOff() « action » display() OnOff Light turnOff turnOn On Off do / display _Composytor::Statechart_monitor 1_Light « implement »

37 fabien.romeo@fromeo.fr www.fromeo.fr37 DAIS, Paphos, Cyprus, 6 June 2007 Behavior modeled with Statecharts Managed Component S11 entry: action1 S2 entry: action3 S10 entry: action0 S12 entry: action2 SB SA S3 service2 serviceX / action4 service1 service2 service2 [guard1] / ^self.serviceX service2 [guard2] / action1 with (guard1 => not guard2) and (guard2 => not guard1)

38 fabien.romeo@fromeo.fr www.fromeo.fr38 DAIS, Paphos, Cyprus, 6 June 2007 Detailed Architecture «require» «class» Business component implementation class «service» service1() «service» service2() «service» serviceX() «action» action0() «action» action1() «action» action2() «action» action3() «action» action4() «guard» guard1() «guard» guard2() Business Component «implement» «interface» Business Component functional interface service1() service2() serviceX is not part of the functional interface since it is only sent internally 1 «class» Internal Manager implementation class control_service1() control_service2() control_serviceX() execute(action) to_state(state) in(state) «implement» _Composytor::Statechart_monitor «interface» Internal Pushed Sensor control_service1() control_service2() control_serviceX() «interface» Internal Pulled Sensor guard1() guard2() «interface» Internal Effector service1() service2() serviceX() action0() action1() action2() action3() action4() «interface» External Pushed Sensor state_changed(transition) «interface» External Pulled Sensor in(state) «interface» External Effector execute(action) to_state(state) Internal Manager

39 fabien.romeo@fromeo.fr www.fromeo.fr39 DAIS, Paphos, Cyprus, 6 June 2007 Demo Wireless Components (J2ME) Management Communication (WMA) Management Console (JMX)

40 fabien.romeo@fromeo.fr www.fromeo.fr40 DAIS, Paphos, Cyprus, 6 June 2007 PauWare Library public void f_c() throws Statechart_exception { _Programmable_thermostat.fires(_Ambient_temperature_displaying,_Ambient_temp erature_displaying); _Programmable_thermostat.fires(_Target_temperature_displaying,_Target_temperat ure_displaying,true,this,"switch_mode"); _Programmable_thermostat.fires(_Program_target_temperature_refreshing,_Progra m_target_temperature_refreshing,true,this,"switch_mode"); _Programmable_thermostat.run_to_completion(); } UML-2 run-to-completion model execution mode Event State-based programming support

41 fabien.romeo@fromeo.fr www.fromeo.fr41 DAIS, Paphos, Cyprus, 6 June 2007 Model Execution

42 fabien.romeo@fromeo.fr www.fromeo.fr42 DAIS, Paphos, Cyprus, 6 June 2007 Demo off/ ^programmable thermostat.season switch turned off Is cool Is heat Is on cool heat Is off cool heat Season switch Is on Is auto on/ ^programmable thermostat.fan switch turned on Fan switch auto

43 fabien.romeo@fromeo.fr www.fromeo.fr43 DAIS, Paphos, Cyprus, 6 June 2007 Demo : Home Automation System + PauWareView

44 fabien.romeo@fromeo.fr www.fromeo.fr44 DAIS, Paphos, Cyprus, 6 June 2007 MDA + CBSE MDA (Model-Driven Architecture) Model Centric Developpements Model Transformation UML : structural models and behavioral modelsCBSE Structural Models : architecture, composition, interfaces… Technological Component Model (model = format) PIM PSM

45 fabien.romeo@fromeo.fr www.fromeo.fr45 DAIS, Paphos, Cyprus, 6 June 2007 Application Management Monitoring SensorsControlling Activators What to monitor? What to control? Where is the line between the application and the management system? Management System Application sensorsactivators

46 fabien.romeo@fromeo.fr www.fromeo.fr46 DAIS, Paphos, Cyprus, 6 June 2007 Towards Autonomic Computing Cf. Cyril Ballagnys on-going thesis…


Download ppt "DAIS, Paphos, Cyprus, 6 June 2007 Observability and Controllability of Wireless Software Components Fabien Romeo."

Similar presentations


Ads by Google