A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron www.dsg.technion.ac.il/fargo-da.

Slides:



Advertisements
Similar presentations
Agents & Mobile Agents.
Advertisements

Mobile Agents Mouse House Creative Technologies Mike OBrien.
Software Connectors Software Architecture. Importance of Connectors Complex, distributed, multilingual, modern software system functionality and managing.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Emery Berger University of Massachusetts Amherst Operating Systems CMPSCI 377 Lecture.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
The road to reliable, autonomous distributed systems
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB JavaForum.
Technical Architectures
Notes to the presenter. I would like to thank Jim Waldo, Jon Bostrom, and Dennis Govoni. They helped me put this presentation together for the field.
Software Connectors. Attach adapter to A Maintain multiple versions of A or B Make B multilingual Role and Challenge of Software Connectors Change A’s.
II. Middleware for Distributed Systems
Communication in Distributed Systems –Part 2
The Architecture of Transaction Processing Systems
Dynamic Layout of Distributed Applications in FarGo Ophir Holder Israel Ben-Shaul Hovav Gazit 1999.
Dynamic layout of Distributed Applications in FarGo Ophir Holder Israel Ben-Shaul Hovav Gazit.
Systems Architecture, Fourth Edition1 Internet and Distributed Application Services Chapter 13.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Course Instructor: Aisha Azeem
DISTRIBUTED PROCESS IMPLEMENTAION BHAVIN KANSARA.
UNIT-V The MVC architecture and Struts Framework.
Distributed Process Implementation Hima Mandava. OUTLINE Logical Model Of Local And Remote Processes Application scenarios Remote Service Remote Execution.
Framework of an Application-Aware Adaptation Scheme for Disconnected Operations Umar Kalim, Hassan Jameel, Ali Sajjad, Sang Man Han, Sungyoung Lee, and.
Behavioral Patterns  Behavioral patterns are patterns whose purpose is to facilitate the work of algorithmic calculations and communication between classes.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Jaeki Song ISQS6337 JAVA Lecture 16 Other Issues in Java.
Object-Oriented Implementation of Reconciliations M.Sc. Seminar Talk by Costa Shapiro under supervision of Prof. Shmuel Katz Computer Science – Technion.
Features, Policies and Their Interactions Joanne M. Atlee Department of Computer Science University of Waterloo.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Other Topics RPC & Middleware.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi
New features for CORBA 3.0 by Steve Vinoski Presented by Ajay Tandon.
Introduction to the Adapter Server Rob Mace June, 2008.
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Tuscany: a SOA framework Jeffrey Guo Accelrys, Inc.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 43 Remote Method Invocation.
Grid Services I - Concepts
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 13. Review Shared Data Software Architectures – Black board Style architecture.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Mobile agents based implementation of a distance evaluation system Vikram Jamwal Sridhar Iyer School of Information Technology IIT Bombay SAINT’2003.
1 Chapter 38 RPC and Middleware. 2 Middleware  Tools to help programmers  Makes client-server programming  Easier  Faster  Makes resulting software.
Status & development of the software for CALICE-DAQ Tao Wu On behalf of UK Collaboration.
Institute for Visualization and Perception Research 1 © Copyright 1999 Haim Levkowitz Java-based mobile agents.
Software Connectors Acknowledgement: slides mostly from Software Architecture: Foundations, Theory, and Practice; Richard N. Taylor, Nenad Medvidovic,
.NET Mobile Application Development XML Web Services.
Architectural Mismatch: Why reuse is so hard? Garlan, Allen, Ockerbloom; 1994.
Software Connectors. What is a Software Connector? 2 What is Connector? – Architectural element that models Interactions among components Rules that govern.
Computer Science Lecture 4, page 1 CS677: Distributed OS Last Class: RPCs RPCs make distributed computations look like local computations Issues: –Parameter.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 29 Remote Method.
A service Oriented Architecture & Web Service Technology.
Towards a High Performance Extensible Grid Architecture Klaus Krauter Muthucumaru Maheswaran {krauter,
Java Distributed Computing
Software Connectors.
Chapter 9: The Client/Server Database Environment
Chapter 3: Windows7 Part 4.
Ch > 28.4.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Knowledge Byte In this section, you will learn about:
Inventory of Distributed Computing Concepts
Chapter 40 Remote Method Invocation
Chapter 46 Remote Method Invocation
Chapter 46 Remote Method Invocation
Chapter 5 Architectural Design.
Design Yaodong Bi.
Presentation transcript:

A Programming Model and System Support for Disconnected-Aware Applications on Resource-Constrained Devices (FarGo-DA) MSc seminar by Weinsberg Yaron January 6,

Outline  Introduction  FarGo-DA’s Programming Model  A sample FarGo-DA application  Runtime infrastructure  Status and Future Work  Summary

Thesis Domain  Modern wide-area networks are characterized by: Dynamic changes of bandwidth, load, machine capacities and availability. Dynamic changes of bandwidth, load, machine capacities and availability.  Requires high level of adaptability from distributed software systems.  We follow the distributed object programming model and use Object mobility to: increase performance increase performance decrease cost decrease cost attain high availability attain high availability  The need: new models and techniques for designing wide-area sw systems.

 A generic framework for constructing disconnected- aware applications. Enable developers to encode connection semantics. Enable developers to encode connection semantics. Dynamically changing the application layout upon (re)disconnection. Dynamically changing the application layout upon (re)disconnection.  A new model and techniques for designing disconnected-aware applications. Separating the connection layout from the application logic. Separating the connection layout from the application logic.  A lightweight mechanism for management and of disconnection and reconnection Research Objectives

 Focus on Voluntary disconnection. User initiated User initiated enables the system to prepare for disconnection enables the system to prepare for disconnection One-to-many One-to-many  Uni-directional client-server applications. NLPCs act as active clients only, and are not servers of any interaction. NLPCs act as active clients only, and are not servers of any interaction. The disconnection request is always initiated by the NLPC (client), not by any server. The disconnection request is always initiated by the NLPC (client), not by any server. Assumptions

 Application objects interact across multiple hosts using remote method invocations (RMI)  FarGo adds a dynamic layout Add dynamic relocation while preserving the distributed object abstraction Add dynamic relocation while preserving the distributed object abstraction All references into and out of a migrating object must remain valid. All references into and out of a migrating object must remain valid. site B site A   FarGo Overview

site B site A  FarGo Overview  Application objects interact across multiple hosts using remote method invocations (RMI)  FarGo adds a dynamic layout Add dynamic relocation while preserving the distributed object abstraction Add dynamic relocation while preserving the distributed object abstraction All references into and out of a migrating object must remain valid. All references into and out of a migrating object must remain valid.

 A unique aspect of FarGo is the ability to associate movement semantics with component references.  The semantics can be changed dynamically. FarGo Overview  A component reference Source component Target component The semantic goes here…  FarGo support the following semantics: Link, Pull, Stamp, Duplicate. Link, Pull, Stamp, Duplicate.

 A Pull reference:  Pull  use r Link A relocator A Sample FarGo Reference  When  moves,  moves along.  Useful for frequent or data-intensive interaction. Core A Core B

 Pull   A Pull reference: Core A Core B use r  When  moves,  moves along.  Useful for frequent or data-intensive interaction. Link A Sample FarGo Reference

 A new programming model: A framework that enables developers to specify architecture-oriented (re)disconnection policies. A framework that enables developers to specify architecture-oriented (re)disconnection policies. A runtime for interpreting and carrying the policies upon disconnection,reconnection. A runtime for interpreting and carrying the policies upon disconnection,reconnection.  FarGo-DA Extends the FarGo implementation with: A whole new class of Disconnected-Aware (or DA) semantics. A whole new class of Disconnected-Aware (or DA) semantics. An extended FarGo invocation mechanism (and FarGo compiler) An extended FarGo invocation mechanism (and FarGo compiler) An extended FarGo serialization mechanism An extended FarGo serialization mechanism FarGo-DA’s Programming Model

 Complet: A mobile java component.  DA-Complet: A complet that is aware of the core’s connectivity Only DA-Complets are affected by (re)disconnection Only DA-Complets are affected by (re)disconnection  Core: A process that can execute, send, and receive complets.  Complet Reference: A reference that points to a complet ( “MetaRef”) Reifies (re)disconnection semantics. Reifies (re)disconnection semantics. Accessible via system methods: Accessible via system methods: FarGo-DA’s Programming Model MetaRef metaRef = Core.getMetaRef(target); metaRef.setDA(new Clone(),new Merge());

 Identify complets and their interactions. Complets are “semantically remote to each other” Complets are “semantically remote to each other”  object parameters are passed by value  complets are passed by reference. Physically, complets may be co-located or remote. Physically, complets may be co-located or remote. Facet 1 Application Logic Design

 Mark the DA components.  Non-DA components are not affected.  Define FarGo-DA’s connection semantics via reference types: Disconnection Semantics: Disconnection Semantics:  Clone, Replace, StoreAndForward, Depart  Define migration priorities. Reconnection Semantics: Reconnection Semantics:  Merge, Purge, Overwrite, Last Facet 2 DA Connection Layout

 A Clone reference. Disconnection Semantics Core A Core B  When core A disconnects,  is cloned to the locality of .  The default connection semantics.  Within each core, the system notifies all DA-complets about the coming disconnection. Enable to dynamically change the connection semantics Enable to dynamically change the connection semantics  Clone  I want to Disconnect!  Disconnection Event MetaRef metaRef = Core.getMetaRef(beta); metaRef.setDA(new Clone());

 A Clone reference. Core A Core B  Clone  I am the clone complet (replica) I am the original complet  The local reference is updated.  the clone complet has the same ID as the original complet. Disconnection Semantics

 A Replace reference. Core A Core B   locates a local instance of  ’s type and connects to it. If non-exist, a new one is created. If non-exist, a new one is created.  Useful when:  reduced functionality (smaller footprint) is sufficient.  the origin complet cannot be migrated.  Replace    lik e 1.same interface same binding-name equivalence method will figure it out… Disconnection Semantics

 A Replace reference. Core A Core B  Replace    lik e  Disconnection Event   locates a local instance of  ’s type and connects to it. If non-exist, a new one is created. If non-exist, a new one is created.  Useful when:  reduced functionality (smaller footprint) is sufficient.  the origin complet cannot be migrated. Disconnection Semantics

 A Replace reference. Core A Core B  Replace    lik e   locates a local instance of  ’s type and connects to it. If non-exist, a new one is created. If non-exist, a new one is created.  Useful when:  reduced functionality (smaller footprint) is sufficient.  the origin complet cannot be migrated. Disconnection Semantics

 A StoreAndForward reference. Core A Core B  StoreAndForward   Disconnection Event Disconnection Semantics  A special kind of reference: Store + Forward.  All invocations are one-way, in order to enable the source complet to continue its work.  All invocations are stored at the local NLPC, pending for reconnection.  The number of invocation stored is limited and can be set by the developer (with a runtime limit).

 A StoreAndForward reference. Core A Core B  StoreAndForward   A special kind of reference: Store + Forward.  All invocations are one-way, in order to enable the source complet to continue its work.  All invocations are stored at the local NLPC, pending for reconnection.  The number of invocation stored is limited and can be set by the developer (with a runtime limit). Local buffer Storing: - method number - parameters. Method invoked… Disconnected Operation Disconnection Semantics

 A StoreAndForward reference. Core A Core B  StoreAndForward   Upon Reconnection, the runtime forwards the pending invocations to the remote complet.  No return values.  An example use of this reference type is for outgoing messages, CVS commits, instant messaging etc. Local buffer Upon Reconnection… method invoked! Disconnection Semantics

 A Depart reference. Core A Core B  Depart  Disconnection Semantics User Invoker return value method invoked!  All invocations are handed over to the remote core prior to disconnection, for remote execution  Upon reconnection the results, if any, are transferred to the source complet  Useful to spawn heavy remote computations without the need to be continuously connected  Partly implemented (based on Miki Abu’s work,ICDCS01) a remote thread created method invoked. return value is available: -  can pull it -can be notified return value is saved if  is currently disconnected.

 Complet Prioritization  NLPCs are resource constrained. not all clone jobs can be fulfilled. not all clone jobs can be fulfilled.  FarGo-DA provides a simple interface to setting priorities, by an additional parameter to the setDA method.  At runtime, the system carries out the disconnection semantics based on the priority order.  Invocations on references without target complets are gracefully handled via FarGo-DA exceptions MetaRef metaRef = Core.getMetaRef(target); metaRef.setDA(new Clone(),new Merge(),Priority.High); Disconnection Semantics

 A Merge reference. Core A Core B  When core A reconnects,  ’s clone is merged with the original complet (explained later).  The default reconnection semantics.  Merge  I want to Reconnect the network… Reconnection Event  Reconnection… Merging… Reconnection Semantics

 A Merge reference. Core A Core B  When core A reconnects,  ’s clone is merged with the original complet (explained later).  The default reconnection semantics.  Merge  merged!! ! Reconnected!!! Reconnection Semantics

 A Purge reference. Core A Core B  When core A reconnects,  ’s clone is purged.   is reconnected to .  Analogous to methods [in] parameters in RPC  Purge  I want to Reconnect the network… Reconnection Event  Reconnection… Reconnection Semantics

 A Purge reference. Core A Core B  Purge  Reconnected!!!  When core A reconnects,  ’s clone is purged.   is reconnected to .  Analogous to methods [in] parameters in RPC Reconnection Semantics

 An Overwrite reference. Core A Core B  The opposite of Purge.  The state of the cloned complet overwrites the state of the original complet.  Analogous to methods [in/out] parameters in RPC   is reconnected to .  Overwrite  I want to Reconnect the network… Reconnection Event  Reconnection… Overwrite Reconnection Semantics

 An Overwrite reference. Core A Core B  Overwrite  Reconnection Semantics  The opposite of Purge.  The state of the cloned complet overwrites the state of the original complet.  Analogous to methods [in/out] parameters in RPC   is reconnected to . Reconnected!!!

 A Last reference. Core A Core B  The state of the complet with the latest timestamp wins.  The clocks of the NLPC and the remote server should be synchronized.   is reconnected to .  Last  I want to Reconnect the network… Reconnection Event  Reconnection… Comparing timestamps… Reconnection Semantics

 A Last reference. Core A Core B  Last  Reconnected!!! I won!!!  The state of the complet with the latest timestamp wins.  The clocks of the NLPC and the remote server should be synchronized.   is reconnected to . Reconnection Semantics

Conflict Resolution  In order to resolve conflicting updates between replicas we must assume application specific knowledge.  FarGo-DA offers two mechanisms in order to resolve merging conflicts: Callback methods- The Merge callback method. Callback methods- The Merge callback method. void Merge(Complet archive,Complet replica, Log localLog,Log remoteLog) Log localLog,Log remoteLog){ // Application-specific merging code // Application-specific merging code} invoked on the original complet Core A Core B   rr original replica aa archive remote log local log

 Reconciliation operators encapsulation of primitive types + a state variable that represents a built-in merging method. encapsulation of primitive types + a state variable that represents a built-in merging method. public class BankAccount_ extends DisconnectedAwareComplet extends DisconnectedAwareComplet{ private discInt private discInt balance = new discInt(Operation.Add); balance = new discInt(Operation.Add);} Conflict Resolution  FarGo-DA provides the following types: discInt, discLong, discString discInt, discLong, discString  And the following operations: Add, Max, Min, Average, Random, Last, First. Add, Max, Min, Average, Random, Last, First.

 Each reconciliation operator must implement the discType interface.  User defined types are created by implementing the merge method declared at discType interface.  FarGo-DA’s Runtime supports the merging of reconciliation operators, contained in Java’s basic container classes (i.e., Vector, Array). Conflict Resolution

Core A Core B  Merge    How reconciliation operators work ? Upon Reconnection…   + Introspection -discInt balance; -discString account; -discInt balance’ ; -discString account ‘ ; -discInt balance;  merged!! ! -discString account;

FarGo-DA Example ManageAnywhere the current customer adds a new product to the order  ManageAnywhere is a simple tool for collaborative management to be used by remote sales forces.  Each sales agent is equipped with a NLPC.  The NLPC may or may not be connected to the central facility, depending on the cellular coverage in the visited area. get the available balance calculates the product price according to the quantity quantity

NLPC Server Logic Configurator Inventory Product Accounts CompanyAccount GUI BasicConfigurator 1 n 1 n Application Logic Design The agents user interface. Handles all Handles all service requests. service requests. - financial calc - financial calc - product’s price calc - product’s price calc - smaller footprint service provider service provider products inventory products inventory customers pre-paid accounts public class ComapnyAccount_ extends DisconnectedAwareComplet extends DisconnectedAwareComplet{ private Integer prePaidBalance= 60102; private discInt totalPurchase = new discInt(Operation.Add); }

Connection Layout Design public class Logic_extends DisconnectedAwareComplet { MetaRef mr = Core.getMetaRef(accounts); MetaRef mr = Core.getMetaRef(accounts); mr.setDA(new Clone(),new Merge(),Priority.LOW); mr.setDA(new Clone(),new Merge(),Priority.LOW); mr = Core.getMetaRef(configurator); mr = Core.getMetaRef(configurator); mr.setDA(new Replace(),new Purge(),Priority.High mr.setDA(new Replace(),new Purge(),Priority.High mr = Core.getMetaRef(inventory); mr = Core.getMetaRef(inventory); mr.setDA(new StoreAndForward(),null,Priority.LOW mr.setDA(new StoreAndForward(),null,Priority.LOW} A look at the Logic complet

Disconnection Exemplified

System Design Core Architecture DM - Manages the Reconnection and Disconnection procedures. and Disconnection procedures. - Realized by the DisconnectionManager (DM) DisconnectionManager (DM) The FarGo-DA’s Implementation enables disconnected operation. operation. FarGo-DA’s Implementation provide a general parameter passing scheme passing scheme

System Design Complet Reference Structure  The connection reference type is encapsulated in a meta-reference object. same interface as  holds the connection semantics. - points to  or to a remote tracker a remote tracker - RMI object

System Design FarGo-DA’s invocation model  In order to support disconnected operation, a new invocation scheme was implemented in FarGo-DA. FarGo assumed that the complet is “always- connected”: FarGo assumed that the complet is “always- connected”:  available on the local core  available on the remote core through a remote tracker. Upon invocation, FarGo always try to invoke the complet. In FarGo-DA this is a reference specific property (for example, StoreAndForward stops the invocation flow) Upon invocation, FarGo always try to invoke the complet. In FarGo-DA this is a reference specific property (for example, StoreAndForward stops the invocation flow) s Tc s T c Tremote

System Design FarGo-DA’s invocation model Invocation starts here… connector’s preInvoke method is activated: -continue invocation ? -store data ? -log ? etc… Invocation continues to complet! decision returned.

System Design The Disconnection Procedure Core A Clone    Replace  Disconnection Event User Asks to Disconnect… Core B

System Design The Disconnection Procedure Core A Clone    Replace DM is loaded…………. DMDM Core B

System Design The Disconnection Procedure Core A Clone    Replace Creating Internal Database… DMDM New Job: -  : should be cloned Core B

System Design The Disconnection Procedure Core A Clone    Replace Cloning… DMDM Core B  disconnection buffer  Is serialized…  type  Is serialized…  type Looking for  … Create a new one!!!  DM discovers that… -  : should be replaced

System Design The Disconnection Procedure Core A Clone    Replace Update References… DMDM Core B   Replace Disconnection Completed! ready to reconnect!

System Design The Reconnection Procedure Core A Merge    Purge DMDM Core B   Purge User Reconnects…. DM use the already created database.  +  merged =

System Design The Reconnection Procedure Core A Merge   Purge DMDM Core B   Purge User Reconnects….  merged

System Design The Reconnection Procedure Core A Merge   Purge DMDM Core B  merged Update References… Reconnection Completed!

Status and Future Work  Publications: A programming Model and System Support – to be published in ICSE’02 (May 2002) A programming Model and System Support – to be published in ICSE’02 (May 2002)  Simulation for NLPC using FarGo’s monitoring API (Hovav' s thesis, MA2000)  System is fully implemented (using JDK1.8) and will soon be available for download.  Ongoing work: DA-Application profiling. DA-Application profiling. Weakly-Connected Operation. Weakly-Connected Operation. More applications. More applications.

Summary  A new programming model: Design time (logical) structural rules. Design time (logical) structural rules. Loose coupling between application-logic and connection layout (re)design. Loose coupling between application-logic and connection layout (re)design. Keeping a uniform (and familiar) language, tools, and object model. Keeping a uniform (and familiar) language, tools, and object model.  System Design: Create a new invocation model to support disconnected operation. Create a new invocation model to support disconnected operation. A system component to handle the (re)disconnections. A system component to handle the (re)disconnections. Implementation of the disconnection semantics is built into a new serialization mechanism Implementation of the disconnection semantics is built into a new serialization mechanism Simple yet powerful conflict resolution mechanisms. Simple yet powerful conflict resolution mechanisms.  An implemented model and system.