370 likes | 381 Views
This paper presents a two-level modeling approach using synchronized hyperedge replacement for heterogeneous systems. It discusses the basics of system modeling, hyperedge replacement, synchronization, and introduces synchronization algebras for modeling complex protocols. The approach includes adding mobility to actions and modeling local channels.
E N D
COORDINATION 2005, Namur, 20-23 April 2005 Synchronized Hyperedge Replacement for Heterogeneous Systems Ivan Lanese Dipartimento di Informatica Università di Pisa joint work with Emilio Tuosto Dipartimento di Informatica Università di Pisa
Which kind of systems? • Usually not cats and dogs • Entities on huge networks • applications • web services • computers • … COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Features of the systems • Systems composed by interacting components • pre-existing, off-the-shelf • heterogeneous • different computational power, features, owner, … • Interaction via middleware for communication • many primitives for communication • complex protocols • Mobile/reconfigurable systems COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Classical formal tools • Frameworks in literature usually have one simple primitive for communication • e.g. -calculus uses message passing • Other primitives must be encoded • not always an easy task • No primitives modeling complex protocols • useful for abstract models of coordination COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Our approach • Two level modeling • Modeling the primitives provided by the middleware • synchronization algebras with mobility (SAMs) • Modeling the system • hypergraphs • evolution via synchronized hyperedge replacement (SHR) • synchronization uses SAMs COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Roadmap • Our approach • A simple example • A less simple example • What else? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Roadmap • Our approach • A simple example • A less simple example • What else? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Basics of system modeling • Hyperedges are system components • Nodes are communication channels or ports • Nodes can be global or local COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Basics of hyperedge replacement • Productions rewrite an edge into a general graph attached to the same nodes • Context free mechanism • Limited expressivity • synchronization is needed COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Basics of synchronization • Specified via constraints on nodes adjacent to the rewritten edge • A set of productions can be applied in one step iff the constraints are satisfied • Problems: • how to specify constraints? • when constraints are satisfied? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Synchronization: general idea • A production performs actions on nodes • If the actions can be composed, then constraints are satisfied • Defined using a synchronization algebra (extends Winskel’s definition) a ε b COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Synchronization algebras • A tuple <Act,ActComp,ε> • Act: set of actions • ActComp: set of triples of actions • a triple (a,b,c) specifies that a can synchronize with b giving c • associative and commutative • ε: action • stands for “not involved in the synchronization” • neutral element in the synchronization • c=ε iff a=ε and b=ε • Allow to specify synchronization, nondeterminism, asynchronous execution and incompatibility between actions COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: Milner (CCS) SA • Actions {a, a, ,ε} • Synchronizations • (a,a,) and symmetric • (,ε,) and symmetric • Other synchronizations (broadcast, mutual exclusion,…) can be easily modeled COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Adding mobility • Each action is equipped with a tuple of node references • During synchronization we • compute the references attached to the resulting action • compute a fusion among nodes • mobility in the Fusion Calculus style • apply the fusion to the graph and to the references of the resulting action COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
3 2 2 a b c … Modeling mobility • Actions have an arity (number of attached references) • We extend the tuple (a,b,c) to (a,b,(c,Mob)) • Mob: partial function {1,…,ar(a)} + {1,…,ar(b)} {1,…} • Parameters of c computed using Mob • surjective on {1,…,ar(c)} • Elements that are mapped to the same position are merged COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Other issues • Some channels are local • only actions that do not require further interactions are meaningful here • modeled by a subset Fin of actions • May have many SAMs with the same formal structure • SAMs are named to distinguish them COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: Milner (Fusion) SAM • Actions {a, a, ,ε} • ar(a)=ar(a), ar()=ar(ε)=0 • Synchronizations • (a,a,) and symmetric • corresponding names are merged • (,ε,) and symmetric • names of the non-ε action are propagated • Fin= {,ε} COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Managing multiple SAMs • SAMs label nodes • For new nodes a SAM must be specified • When merging nodes, SAMs must be composed • SAMs form a programmer-defined commutative monoid • monoidal operation used for composition COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Roadmap • Our approach • A simple example • A less simple example • What else? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: graph S1 Au … u:Mil Sn x:Mil C COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: productions x:Mil x:Mil C C auth,y:Mil y:Mil u:Mil u:Mil Au Au x x:Mil auth,u:Mil COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: synchronization S1 Au … u:Mil Sn auth,u:Mil x:Mil auth,y:Mil C COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: final graph S1 Au … u:Mil Sn x:Mil C Assumption: Mil • Mil = Mil COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
The full power of our approach • Suppose servers are search engines and some clients want to submit the request to all of them • Want to use broadcast synchronization between client and servers but Milner synchronization to interact with Au • Just change the production for the client with y:Bdc and define Mil • Bdc = Bdc COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: synchronization again S1 Au … u:Mil Sn auth,u:Mil x:Mil auth,y:Bdc C COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Example: final graph again S1 Au … u:Bdc Sn x:Mil C Assumption: Mil • Bdc = Bdc COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Roadmap • Our approach • A simple example • A less simple example • What else? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
A network example • Network with routers and clients • Channels can have • 4Kb/16Kb packets • error detection/no error detection • To communicate a client creates a virtual communication channel that uses the underlying infrastructure • The communication channel supports 16Kb packets/error detection only if all the underlying channels do COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Modeling the scenario • Eight different SAMs with all the combinations of • 4Kb < 16Kb • no error detection < error detection • communication < control • SAMs provide variants of Milner synchronization • e.g. action for detecting errors • SAMs form a partial order (pointwise) • SAM composition corresponds to glb COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
comm,16,× Building a virtual channel R C Act 4,√ R 16,× 16,√ 4,× 16,√ 4,√ Act C 16,× R R COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Ideas on the productions • Each production creates a node labelled with a SAM • for communication • with the features provided by the nearby channels • During synchronization these nodes are merged to build the communication node • it is automatically labelled with the desired SAM COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Roadmap • Our approach • A simple example • A less simple example • What else? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Behind graphic • A textual representation for hypergraphs, transitions, productions • A labelled transition system for system evolution • Inference rules to derive transitions from productions • Production schemas to define classes of similar productions COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Only for the most proud COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Conclusions • A general framework for modeling heterogeneous systems • SAMs to model synchronization/complex interaction protocols • SHR to model system evolution • Different synchronizations can be used • Synchronization policy can be changed dynamically • Sound mathematical foundations COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Future work • Use SHR+SAMs to model real protocols/heterogeneous systems • Use SAMs for QoS [see Emilio’s poster] • Study the expressivity of the framework • Implement SHR (someone wants to do that?) • Apply SAMs to process calculi [paper submitted to CONCUR] • Study the relationships between SAMs (composition/refinement) COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto
Thanks! Questions? COORDINATION 2005, 20-23 April, Namur, Belgium Ivan Lanese and Emilio Tuosto