Analyzing Interactions of Asynchronously Communicating Systems Tevfik Bultan Department of Computer Science University of California, Santa Barbara

Slides:



Advertisements
Similar presentations
Web Services Choreography Description Language Overview 24th November2004 Steve Ross-Talbot Chief Scientist, Enigmatec Corporation Ltd Chair W3C Web Services.
Advertisements

Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Seyedehmehrnaz Mireslami, Mohammad Moshirpour, Behrouz H. Far Department of Electrical and Computer Engineering University of Calgary, Canada {smiresla,
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Partial Order Reduction: Main Idea
1 University of Pennsylvania Grigoris Karvounarakis February 2004 Conversation Specification: A New Approach to Design and Analysis of E- Service Composition.
1 Intention of slide set Inform WSMOLX of what is planned for Choreography & Orhestration in DIP CONTENTS Terminology Clarification / what will be described.
Architecture Representation
PROTOCOL VERIFICATION & PROTOCOL VALIDATION. Protocol Verification Communication Protocols should be checked for correctness, robustness and performance,
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
Introduction to WSDL presented by Xiang Fu. Source WSDL 1.1 specification WSDL 1.1 specification – WSDL 1.2 working draft WSDL.
Remote Procedure Call (RPC)
CS 290C: Formal Models for Web Software Lectures 14: Formal Modeling and Analysis of Orchestration and Choreography Specifications Instructor: Tevfik Bultan.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
An Associative Broadcast Based Coordination Model for Distributed Processes James C. Browne Kevin Kane Hongxia Tian Department of Computer Sciences The.
A. Bucchiarone / Pisa/ 30 Jan 2007 Dynamic Software Architectures for Global Computing Antonio Bucchiarone PhD Student – IMT Graduate School Piazza S.
1 Introduction to XML. XML eXtensible implies that users define tag content Markup implies it is a coded document Language implies it is a metalanguage.
Latest techniques and Applications in Interprocess Communication and Coordination Xiaoou Zhang.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
A Tool for Choreography Analysis Using Collaboration Diagrams Tevfik Bultan University of California Santa Barbara Xiang Fu Hofstra University Chris Ferguson.
WSAT A Tool for Formal Analysis of Web Services Xiang Fu Tevfik Bultan Jianwen Su Department of Computer Science University of California, Santa Barbara.
Business Process Orchestration
Developing Verifiable Concurrent Software Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Specification of Realizable Service Conversations Using Collaboration Diagrams Tevfik Bultan Department of Computer Science University of California, Santa.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio.
Client and Server Verification for Web Services Using Interface Grammars Graham Huges, Tevfik Bultan, Muath Alkhalaf Department of Computer Science University.
Bridging the gap between Interaction- and Process-Oriented Choreographies Talk by Ivan Lanese Joint work with Claudio Guidi, Fabrizio Montesi and Gianluigi.
Interface Grammars for Modular Software Verification Tevfik Bultan Department of Computer Science University of California, Santa Barbara.
A Top-Down Approach to Modeling Global Behaviors of Web Services Xiang Fu, Tevfik Bultan and Jianwen Su Department of Computer Science University of California,
Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Communication in Distributed Systems –Part 2
Analyzing Conversations of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Service Choreography and Orchestration with Conversations Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Tools for Automated Verification of Web Services Tevfik Bultan Department of Computer Science University of California, Santa Barbara
Chapter 4.1 Interprocess Communication And Coordination By Shruti Poundarik.
INTRODUCTION TO WEB DATABASE PROGRAMMING
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 31 Slide 1 Service-centric Software Engineering 2.
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
CS 290C: Formal Models for Web Software Lectures 13: An Overview of Web Services Instructor: Tevfik Bultan.
Presentation of Singularity OS Seminar, winter 2005 by Jacob Munk-Stander November 23 rd, 2005.
Model-based Methods for Web Service Verification.
Analyzing Interactions of Asynchronously Communicating Software Components Tevfik Bultan Department of Computer Science University of California, Santa.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
1 The CeNTIE project is supported by the Australian Government through the Advanced Networks Program of the Department of Communications, Information Technology.
- 1 - Embedded Systems - SDL Some general properties of languages 1. Synchronous vs. asynchronous languages Description of several processes in many languages.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
95-843: Service Oriented Architecture 1 Master of Information System Management Service Oriented Architecture Lecture 7: BPEL Some notes selected from.
1 Qualitative Reasoning of Distributed Object Design Nima Kaveh & Wolfgang Emmerich Software Systems Engineering Dept. Computer Science University College.
CE Operating Systems Lecture 13 Linux/Unix interprocess communication.
Hwajung Lee.  Interprocess Communication (IPC) is at the heart of distributed computing.  Processes and Threads  Process is the execution of a program.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
Analyzing Interactions of Asynchronously Communicating Software Components Tevfik Bultan Department of Computer Science University of California, Santa.
Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)
Qusay H. Mahmoud CIS* CIS* Service-Oriented Computing Qusay H. Mahmoud, Ph.D.
Dr. Rebhi S. Baraka Advanced Topics in Information Technology (SICT 4310) Department of Computer Science Faculty of Information Technology.
Deciding Choreography Reliazability Samik Basu Iowa State University Tevfik Bultan University of California at Santa Barbara Meriem Ouederni University.
Slide 1 Service-centric Software Engineering. Slide 2 Objectives To explain the notion of a reusable service, based on web service standards, that provides.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Synchronizability for Verification of Asynchronously Communicating Systems Samik Basu Iowa State University Tevfik Bultan University of California at Santa.
Automated Composition and Analysis. Web Services: Design and Analysis2 Automated Composition Given a specification of the composite service, find individual.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
SE 548 Process Modelling WEB SERVICE ORCHESTRATION AND COMPOSITION ÖZLEM BİLGİÇ.
1 Seminar on SOA Seminar on Service Oriented Architecture BPEL Some notes selected from “Business Process Execution Language for Web Services” by Matjaz.
Business Process Execution Language (BPEL) Pınar Tekin.
Service-centric Software Engineering
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Presentation transcript:

Analyzing Interactions of Asynchronously Communicating Systems Tevfik Bultan Department of Computer Science University of California, Santa Barbara

University of California at Santa Barbara

Acknowledgements Joint work with –Xiang Fu, Hofstra University –Jianwen Su, University of California, Santa Barbara –Zachary Stengel, Microsoft –Samik Basu, Iowa State

Motivation 1: Web Services Web services support basic client/server style interactions Example: Amazon E-Commerce Web Service (AWS-ECS) AWS-ECS WSDL specification lists 40 operations that provide differing ways of browsing Amazon’s product database such as –ItemSearch, CartCreate, CartAdd, CartModify, CartGet, CartClear Based on the AWS-ECS WSDL specification one can implement clients that interact with AWS-ECS Service Requester Service Provider Request Response SOAP WSDL Client Server

Composing Services Can this framework support more than basic client/server style interactions? Can we compose a set of services to construct a new service? For example: –If we are building a bookstore service, we may want to use both Amazon’s service and Barnes & Noble’s service in order to get better prices Another (well-known) example: –A travel agency service that uses other services (such as flight reservation, hotel reservation, and car rental services) to help customers book their trips

Orchestration vs Choreography Orchestration: Define an executable process that interacts with existing services and executes them in a particular order and combines the results to achieve a new goal –From atomic services to stateful services –Web Services Business Process Execution Language (WS-BPEL) Choreography: Specify how the individual services should interact with each other. Find or construct individual services that follow this interaction specification –Global specification of interactions among services –Web Services Choreography Description Language (WS-CDL) A choreography can be realized by writing an orchestration for each peer involved in the choreography –Choreography as global behavior specification –Orchestration as local behavior specification that realizes the global specification

Web Services Standards Stack Data Type Service Orchestration Protocol Web Services Business Process Execution Language (WS-BPEL) Web Services Description Language (WSDL) Simple Object Access Protocol (SOAP) XML Schema (XSD) Extensible Markup Language (XML) Atomic Service Atomic Service Orchestrated Service SOAP WSDL Choreography Web Services Choreography Description Language (WS-CDL) WS-BPEL Orchestrated Service WS-BPEL SOAP WS-CDL

Asynchronous Messaging Sender does not have to wait for the receiver –Message is inserted to a message queue –Messaging platform guarantees the delivery of the message Why support asynchronous messaging? –Otherwise the sender has to block and wait for the receiver –Sender may not need any data to be returned –If the sender needs some data to be returned, it should only wait when it needs to use that data –Asynchronous messaging can alleviate the latency of message transmission through the Internet –Asynchronous messaging can prevent sender from blocking if the receiver service is temporarily unavailable Rather then creating a thread to handle the send, use asynchronous messaging

Motivation 2: Singularity OS Experimental OS developed by Microsoft Research to explore new ideas for operating system design Key design principles: –Dependability –Security Key architectural decision: –Implement a sealed process system Software Isolated Processes (SIPs) –Closed code space (no dynamic code loading or code generation) –Closed object space (no shared memory) Inter-process communication occurs via message passing over channels

Singularity Channels Channels allow 2-Party asynchronous communication via FIFO message queues –Sends are non blocking –Receives block until a message is at the head of a receive queue Each channel has exactly two endpoints –Type exposed for each endpoint ( Exp and Imp ) –Each endpoint owned by at most one process at any time Owner of Exp referred to as Server Owner of Imp referred to as Client

Channel Contracts Written in Sing # Contracts specify two things: 1.The messages that may be sent over a channel out message are sent from the Server endpoint to the Client endpoint ( S  C ) in messages are sent from the Client endpoint to the Server endpoint ( C  S ) 2.The set of allowed message sequences out message marked with ! in messages marked with ? public contract KeyboardDeviceContract { out message AckKey( uint key ); out message NakKey(); out message Success(); in message GetKey(); in message PollKey(); state Start { Success! -> Ready; } state Ready { GetKey? -> Waiting; PollKey? -> (AckKey! or NakKey!) -> Ready; } state Waiting { AckKey! -> Ready; NakKey! -> Ready; } }

public contract KeyboardDeviceContract { out message AckKey( uint key ); out message NakKey(); out message Success(); in message GetKey(); in message PollKey(); state Start { Success! -> Ready; } state Ready { GetKey? -> Waiting; PollKey? -> (AckKey! or NakKey!) -> Ready; } state Waiting { AckKey! -> Ready; NakKey! -> Ready; } A contract specifies a finite state machine Each message causes a deterministic transition from one state to another state KeyboardDeviceContract Channel Contracts Start Ready$0ReadyWaiting S  C:Success S  C:AckKey C  S:GetKey C  S:PollKey S  C:NakKey S  C:AckKey Implicit State

Outline Motivation –Composition of Web Services –Singularity Channel Contracts Conversations Realizability Synchronizability Applications Recent Results

Going to Lunch at UCSB Before Xiang left UCSB, Xiang, Jianwen and I were using the following protocol for going to lunch: –Sometime around noon one of us would call another one by phone and tell him where and when we would meet for lunch. –The receiver of this first call would call the remaining peer and pass the information. Let’s call this protocol the First Caller Decides (FCD) protocol. At the time we did not have answering machines or voic !

FCD Protocol Scenarios Possible scenario 1.Tevfik calls Jianwen with the decision of where and when to eat 2.Jianwen calls Xiang and passes the information Another scenario 1.Jianwen calls Tevfik with the decision of where and when to eat 2.Tevfik calls Xiang and passes the information Yet another scenario 1.Tevfik calls Xiang with the decision of where and when to eat Maybe Jianwen also calls Xiang at the same time with a different decision. But the phone is busy. Jianwen keeps calling. But Xiang is not going to answer because according to the protocol the next thing Xiang has to do is to call Jianwen. 2.Xiang calls Jianwen and passes the information

FCD Protocol: Tevfik’s Behavior Tevfik calls Jianwen with the lunch decision Let’s look at all possible behaviors of Tevfik based on the FCD protocol Tevfik is hungry Tevfik calls Xiang with the lunch decision Tevfik receives a call from Jianwen passing him the lunch decision Tevfik receives a call from Xiang passing him the lunch decision Tevfik receives a call from Xiang telling him the lunch decision that Tevfik has to pass to Jianwen

FCD Protocol: Tevfik’s Behavior !T->J:D !T->X:D ?J->T:P ?X->T:P ?X->T:D ?J->T:D !T->J:P !T->X:P T->J:D Tevfik calls Jianwen with the lunch decision Message Labels: ! send ? receive J->X:P Jianwen calls Xiang to pass the decision

!T->J:D ?X->T:D !T->J:D ?J->T:D !T->X:P Tevfik !T->J:P ?J->T:P ?X->T:P !X->J:D ?T->X:D !X->T:D ?J->X:D !X->T:P Xiang !X->J:P ?J->X:P ?T->X:P !J->T:D ?X->J:D !J->X:D ?T->J:D !J->X:P Jianwen !J->T:P ?T->J:P ?X->J:P State machines for the FCD Protocol Three state machines characterizing the behaviors of Tevfik, Xiang and Jianwen according to the FCD protocol

FCD Protocol Has Voic Problems When the university installed a voic system FCD protocol started causing problems –We were showing up at different restaurants at different times! Example scenario: –Tevfik calls Xiang with the lunch decision –Jianwen also calls Xiang with the lunch decision The phone is busy (Xiang is talking to Tevfik) so Jianwen leaves a message – Xiang calls Jianwen passing the lunch decision Jianwen does not answer (he already left for lunch) so Xiang leaves a message –Jianwen shows up at a different restaurant! Message sequence is: T->X:D J->X:D X->J:P –The messages J->X:D and X->J:P are never consumed This scenario is not possible without voic !

A Different Lunch Protocol To fix this problem, Jianwen suggested that we change our lunch protocol as follows: –As the most senior researcher among us Jianwen would make the first call to either Xiang or Tevfik and tell when and where we would meet for lunch. –Then, the receiver of this call would pass the information to the other peer. Let’s call this protocol the Jianwen Decides (JD) protocol

?X->T:P ?J->T:D !T->X:P Tevfik Xiang Jianwen ?T->X:P ?J->X:D !X->T:P !J->T:D !J->X:D State machines for the JD Protocol JD protocol works fine with voic !

Conversations The FCD and JD protocols specify a set of conversations –A conversation is the sequence of messages generated during an execution of the protocol We can specify the set of conversations without showing how the peers implement them –we call such a specification a conversation protocol

T->J:D T->X:D X->J:P X->T:D X->J:D J->T:D J->X:D J->X:P T->J:P J->T:P T->X:P X->T:P FCD Protocol J->T:D J->X:D T->X:P X->T:P JD Protocol FCD and JD Conversation Protocols Conversation set: { T->X:D X->J:P, T->J:D J->X:P, X->T:D T->J:P, X->J:D J->T:P, J->T:D T->X:P, J->X:D X->T:P } Conversation set: { J->T:D T->X:P, J->X:D X->T:P }

Observations & Questions The implementation of the FCD protocol behaves differently with synchronous and asynchronous communication whereas the implementation of the JD protocol behaves the same. –Can we find a way to identify such implementations? The implementation of the FCD protocol does not obey the FCD protocol if asynchronous communication is used whereas the implementation of the JD protocol obeys the JD protocol even if asynchronous communication used. –Given a conversation protocol can we figure out if there is an implementation which generates the same conversation set?

Conversations, Choreography, Orchestration Peer state machines are orchestrations –A peer state machine can be specified using an orchestration language such as WS-BPEL –One can translate WS-BPEL specifications to peer state machines A conversation protocol is a choreography specification –A conversation set corresponds to a choreography –A conversation set can be specified using a choreography language such as WS-CDL –One can translate WS-CDL specifications to conversation protocols

Bottom-Up vs. Top-Down Bottom-up approach Specify the behavior of each peer –For example using an orchestration language such as WS-BPEL The global communication behavior (conversation set) is implicitly defined based on the composed behavior of the peers Global communication behavior is hard to understand and analyze Top-down approach Specify the global communication behavior (conversation set) explicitly as a protocol –For example using a choreography language such as WS-CDL Ensure that the conversations generated by the peers obey the protocol

Conversation Protocol (Choreography Specification) GF( T->X(P)  X->T(P) ) ? LTL property Input Queue... Virtual Watcher ? LTL property Peer TPeer X Peer J J->T:D J->X:D T->X:P X->T:P GF( T->X(P)  X->T(P) ) !J->T:D !J->X:D ?X->T:P ?J->T:D !T->X:P ?T->X:P ?J->X:D !X->T:P Top-Down vs. Bottom-Up

Outline Motivation –Composition of Web Services –Singularity Channel Contracts Conversations Realizability Synchronizability Applications Recent Results

Realizability Question Conversation protocol specifies the global communication behavior –How do we implement the peers? How do we obtain the contracts that peers have to obey from the global contract specified by the conversation protocol? –Synthesize peer implementations by projecting the global protocol to each peer by dropping unrelated messages for each peer If this equality holds the conversation protocol is realizable The JD protocol is realizable The FCD protocol is not realizable Are there conditions which ensure the equivalence? Conversations generated by the projected services Conversations specified by the conversation protocol  ?

Realizability Problem Not all conversation protocols are realizable! A  B: m1 C  D: m2 Conversation protocol m2 m1 Conversation “ m2 m1 ” will also be generated by all peer implementations which follow the protocol !m1 ?m1 !m2 ?m2 Peer APeer BPeer CPeer D Projection of the conversation protocol to the peers

Realizability Conditions Three sufficient conditions for realizability (no message content) Lossless join –Conversation set should be equivalent to the join of its projections to each peer Synchronous compatible –When the projections are composed synchronously, there should not be a state where a peer is ready to send a message while the corresponding receiver is not ready to receive Autonomous –At any state, each peer should be able to do only one of the following: send, receive or terminate (a peer can still choose among multiple messages)

Realizability Conditions A  B: m1 C  D: m2 A  B: m1 B  A: m2 A  C: m3 B  A: m2 A  B: m1 Following protocols fail one of the three conditions but satisfy the other two Not lossless join Not autonomous A  B: m1 C  A: m2 Not synchronous compatible

Outline Motivation –Composition of Web Services –Singularity Channel Contracts Conversations Realizability Synchronizability Some Experiments Applications

Bottom-Up Approach We know that analyzing conversations of composite web services is difficult due to asynchronous communication –Model checking for conversation properties is undecidable even for finite state peers The question is: –Can we identify the composite web services where asynchronous communication does not create a problem? We call such compositions synchronizable The implementation of the JD protocol is synchronizable The implementation of the FCD protocol is not synchronizable

Three Examples, Example 1 requesterserver !r 2 ?a 1 ?a 2 !e !r 1 Conversation set is regular: ( r 1 a 1 | r 2 a 2 )* eConversation set is regular: ( r 1 a 1 | r 2 a 2 )* e During all executions the message queues are bounded r 1, r 2 a 1, a 2 e ?r 1 !a 1 !a 2 ?r 2 ?e

Example 2 Conversation set is not regularConversation set is not regular Queues are not bounded requesterserver !r 2 ?a 1 ?a 2 !e !r 1 r 1, r 2 a 1, a 2 e ?r 1 !a 1 !a 2 ?r 2 ?e

Example 3 Conversation set is regular: ( r 1 | r 2 | ra )* eConversation set is regular: ( r 1 | r 2 | ra )* e Queues are not bounded requesterserver !r 2 ?a!r !e !r 1 r 1, r 2 a 1, a 2 e ?r 1 ?r 2 ?e ?r !a

State Spaces of the Three Examples queue length # of states in thousands Verification of Examples 2 and 3 are difficult even if we bound the queue length How can we distinguish Examples 1 and 3 (with regular conversation sets) from 2? –Synchronizability Analysis

Synchronizability Analysis A composite web service is synchronizable if its conversation set does not change –when asynchronous communication is replaced with synchronous communication If a composite web service is synchronizable we can check the properties about its conversations using synchronous communication semantics –For finite state peers this is a finite state model checking problem

Synchronizability Analysis Sufficient conditions for synchronizability: A composite web service is synchronizable, if it satisfies the synchronous compatible and autonomous conditions Connection between realizability and synchronizability: –A conversation protocol is realizable if its projections to peers are synchronizable and the protocol itself satisfies the lossless join condition

Outline Motivation –Composition of Web Services –Singularity Channel Contracts Conversations Realizability Synchronizability Applications Recent Results

Are These Conditions Too Restrictive? Problem SetSizePass? SourceName#msg#states#trans. ISSTA’04SAS91215yes IBM Conv. Support Project CvSetup444yes MetaConv446no Chat245yes Buy556yes Haggle858no AMAB81015yes BPEL spec shipping233yes Loan666yes Auction9910yes Collaxa. com StarLoan677yes Cauction576yes

Singularity Channel Contract Verification State machine construction allows for automated verification and analysis of channel communication Singularity compiler automatically checks compliance of client and server processes to the specified contract Claim from Singularity documentation: –"clients and servers that have been verified separately against the same contract C are guaranteed not to deadlock when allowed to communicate according to C.“ This claim is wrong!

IO_RUNNING$0ReadyState$1 ReadyState$0 IO_RUNNING Deadlock Example: The TpmContract IO_RUNNING$0 IO_RUNNINGReadyState ReadyState$1 ReadyState$0 ReadyState Server Projection Client Projection C  S:SendS  C:AckStartSend S  C:SendComplete C  S:GetTpmStatus S  C:TpmStatus Send? Send! AckStartSend! AckStartSend? SendComplete! GetTpmStatus! GetTpmStatus? TpmStatus! GetTpmStatus! TpmStatus? TpmStatus! GetTpmStatus? Server Receive Queue Client Receive Queue Conversation SendComplete?

Deadlock Example: The TpmContract IO_RUNNING$0 IO_RUNNINGReadyState ReadyState$1 ReadyState$0 Send? IO_RUNNING$0 IO_RUNNINGReadyState ReadyState$1 ReadyState$0 Server Projection Send! AckStartSend! AckStartSend? SendComplete! GetTpmStatus! GetTpmStatus? TpmStatus! GetTpmStatus! TpmStatus? SendComplete? TpmStatus! GetTpmStatus? Server Receive Queue Client Receive Queue Send AckStartSendSendComplete GetTpmStatus TpmStatus Conversation C  S: Send S  C: AckStartSend S  C: SendComplete C  S: GetTpmStatus S  C: TpmStatus Client Projection

Realizability Problem KeyboardDeviceContract is not realizable –It violates the autonomous condition It turns out that autonomous condition is sufficient (but not necessary) for realizability of two-party protocols (Singularity channel contracts are two-party protocols) –If a contract is autonomous, it is guaranteed to be realizable –However, it can be realizable but not autonomous i.e., false positives are possible when we use autonomous condition as our realizability check

Autonomous condition and false positives Example: TpmContract IO_RUNNING$0 IO_RUNNINGReadyState ReadyState$1 ReadyState$0 C  S:SendS  C:AckStartSend S  C:SendComplete C  S:GetTpmStatus S  C:TpmStatus IO_RUNNING$1 S  C:SendCompleteS  C:TpmStatus Fixed Violates Autonomous condition

Explicit state verification is expensive using asynchronous communication –Exponential state space explosion in the worst case Example: BlowupKContract Model checking efficiency S1 S2 … SkSk S  C:m1 S  C:m2 C  S:m3

Model checking efficiency If contract is realizable, conversations generated using asynchronous communication and synchronous communication are the same –Therefore, synchronous communication model can be used for verification S1 S2 … SkSk S  C:m1 S  C:m2 C  S:m3

Yes Tune: A Tool For Analyzing Sing# Contracts Channel Contract Contract Parser Contract State Machine Contract Analyzer Realizable? Synchronous Promela Generator Asynchronous Promela Generator Sync Promela Async Promela No Spin Data Collector LTL Formulas Report Consumed by Produces File Tune Component External Tool LTL Formulas

Analysis Efficiency Performed autonomous check and exhaustive deadlock search for ~95% of contracts to compare analysis time Results show clear advantage to performing the autonomous check

LTL Property Validation Selected 10 contracts for LTL property validation Both synchronous and asynchronous models were used to compare performance

Realizability Results Ran analysis on 93 contracts from the Singularity code base (version 2.0) and documentation Found two contracts that violate the autonomous condition ( TpmContract and ReservationSession ) Exhaustive search showed deadlocking execution traces for both contracts –Confirmed by Singularity developers Tune did not report any false positives from autonomous check for any of the contracts analyzed In practice, autonomous condition is not too restrictive

Outline Motivation –Composition of Web Services –Singularity Channel Contracts Conversations Realizability Synchronizability Applications Recent Results

Open problems (until recently): –Is realizability decidable? –Is synchronizability decidable? Recent result –Synchronizability is decidable! We are pretty sure that we will also be able to show that realizability is decidable

Synchronizability Result Given a set of peers –Let C-A be their asynchronous composition –Let C-k be their bounded-asynchronous composition where queues are bounded to be of size k A send to a full queue (i.e., a queue with k elements) blocks –C-0 corresponds to synchronous composition Theorem: A composition is synchronizable (i.e., L(C-0)=L(C-A)) if and only if the conversation set of C-0 and C-1 are the same (i.e., L(C-0) = L(C-1))

Reachability & Synchronizability It is well-known that reachability problems for asynchronously communicating systems are undecidable We can extend the synchronizability definition to include reachability –We call a composition reachability-synchronizable if 1) it is synchronizable and 2) the set of states reachable in the synchronous composition is same as the set of empty-queue states reachable in the asynchronous composition Very recent result: Determining if a composition is reachability- synchronizable is decidable –Theorem: A composition is reachability-synchronizable if and only if the conversation set and the (empty-queue) reachable states of C-0 and C-1 are the same

Related Work Singularity: –[Hunt, Larus SIGOPS ‘07] Singularity: rethinking the software stack –[Fähndrich, Aiken, Hawblitzel, et. al SIGOPS/Eurosys ‘07] Language support for fast and reliable message-based communication in singularity os. –Influenced by work on Session Types [Honda, Vasconcelos, Kubo ESOP ’98] Language primitives and type discipline for structured communication-based programming –Source code and RDK:

Related Work Realizability of message sequence charts –[Alur, Etessami, Yannakakis] ICSE’00, ICALP’01] –Defines similar notion of realizability –Different conversation model

Related Work Specification approaches that are similar to conversation protocols –[Parunak ICMAS 96] Visualizing agent conversations: Using enhanced Dooley graphs for agent design and analysis. –[Hanson, Nandi, Kumaran EDOCC’02] Conversation support for business process integration

Related Work Message Sequence Charts (MSC) –[Alur, Etassami, Yannakakis ICSE’00, ICALP’01] Realizability of MSCs and MSC Graphs –[Uchitel, Kramer, Magee ACM TOSEM 04] Implied Scenarios in MSCs

Related Work Verification of web services –Petri Nets [Narayanan, McIlraith WWW’02] Simulation, verification, composition of web services using a Petri net model –Process Algebras [Foster, Uchitel, Magee, Kramer ASE’03] Using MSC to model BPEL web services which are translated to labeled transition systems and verified using model checking –Model Checking Tools [Nakajima ICWE’04] Model checking Web Service Flow Language specifications using SPIN –… See the survey on BPEL verification –[Van Breugel, Koshkina 06] Models and Verification of BPEL

Related Work Modeling Choreography & Orchestration – Process algebras, synchronous communication [Busi, Gorrieri, Guidi, Lucchi, Zavattaro ICSOC’05] [Qiu, Zhao, Chao, Yang WWW’07] –Activity based (rather than message based) approaches [Berardi, Calvanese, DeGiacomo, Hull, Mecella VLDB’05]

THE END