stochastic graph transformation systems

25
Fakult¨ at f¨ ur Elektrotechnik, Informatik und Mathematik Heinz Nixdorf Institut und Institut f¨ ur Informatik Fachgebiet Softwaretechnik Warburger Straße 100 33098 Paderborn Stochastic Graph Transformation Systems by Nitesh Kumar Singh [email protected] Supervisors: Jun.-Prof. Dr.-Ing. Steffen Becker, M.Sc. Matthias Becker Paderborn, September 2013

Upload: nitesh-singh

Post on 05-Dec-2014

594 views

Category:

Education


1 download

DESCRIPTION

Analysis of non-functional aspects like performance and reliability are crucial for the success of dynamic distributed systems that are self adaptive. With the success of the Internet and mobile technology, properties like the reliability of connections, available bandwidth and computing resources become an even greater concern. Non-functional requirements, are often difficult to capture, measure, and predict. Therefore, stochastic methods are required to address these aspects. For the same purpose, architecture of dynamic distributed systems, in particular P2P networks is viewed as a graph and modeled by graph transformation.

TRANSCRIPT

Page 1: Stochastic Graph Transformation Systems

Fakultat fur Elektrotechnik, Informatik und MathematikHeinz Nixdorf Institut und Institut fur InformatikFachgebiet SoftwaretechnikWarburger Straße 10033098 Paderborn

Stochastic GraphTransformation Systems

byNitesh Kumar Singh

[email protected]:

Jun.-Prof. Dr.-Ing. Steffen Becker, M.Sc. Matthias Becker

Paderborn, September 2013

Page 2: Stochastic Graph Transformation Systems

Contents

1 Introduction 21.1 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Related Work 4

3 Rule Based Graph Transformations 53.1 Stochastic Graph Transformation Systems . . . . . . . . . . . . . . 5

3.1.1 Basic Notions: . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Generalised Stochastic Graph Transformation Systems . . . . . . . 9

4 Simulation Over Model Checking 134.1 Analysis of P2P using SGTS . . . . . . . . . . . . . . . . . . . . . 134.2 A better solution for analyzing P2P networks . . . . . . . . . . . . 16

5 Summary 21

Bibliography 22

ii

Page 3: Stochastic Graph Transformation Systems

Abstract

Analysis of non-functional aspects like performance and reliability are crucial forthe success of dynamic distributed systems that are self adaptive. With the successof the Internet and mobile technology, properties like the reliability of connections,available bandwidth and computing resources become an even greater concern.Non-functional requirements, are often difficult to capture, measure, and predict.Therefore, stochastic methods are required to address these aspects. For thesame purpose, architecture of dynamic distributed systems, in particular P2Pnetworks is viewed as a graph and modeled by graph transformation. One ofthe proposed methods to analyze the non-functional properties that implementstochastic simulation based on semi-Markov processes is presented in the paper.Further, the comparison of this approach with the standard technique is carriedout in order to provide an efficient approach to analyze the principal aspects ofa system that leads to its success. The comparison is done using P2P networksand the comparative analysis reveals that more realistic data can be obtained bycomplementing model checking, used by the standard technique with stochasticsimulation.

1

Page 4: Stochastic Graph Transformation Systems

1 Introduction

Non-functional aspects like performance, reliability, maintainability, portability, toname a few, are not the functions that can be captured in use cases. The behaviorof these aspects cannot be analyzed by drawing sequence diagrams or statecharts.Non-functional aspects are more like constraints on a system that define how asystem is supposed to be. It is not only hard to model the requirements that arefulfilled by non-functional aspects, but also difficult to capture or predict them.Since, the requirements are stated informally, most often they contradict, and itbecomes difficult to enforce them. Moreover, it is not an easy task to measure orevaluate these aspects until the system is operated in its environment. These dif-ficulties encountered during the early development phases of the software projectsleads to their failure.[GF88] In the development of a software system, communi-cation between client and developer requires a direct, diagrammatic description ofwhat is required rather than how it is achieved.Models are considered to be the most appropriate means of designing such com-plex distributed systems since they abstract the irrelevant details. However, inthis process information is lost and individual occurrences of events may becomeunpredictable. Therefore, Stochastic concepts are required to formalize such prop-erties. Most of the stochastic formalisms introduced such as stochastic petri netsand π calculus either concentrated more on ordering of events or was too low-levelfor expressing the requirements at initial stages of development.[Hec05]Graph transformation systems are more visual and more abstract formalism withsimilar expressiveness, that views the architecture of a distributed system as agraph and naturally models it by graph transformations. In this approach, onlyproblem and solution space are specified using complex graphical patterns withoutfocussing on how these patterns are linked to each other ( implemented ). [Hec05]Distributed systems are also characterized by a high degree of architectural re-configuration. For instance, the P2P networks are subjected to a high degree ofarchitectural reconfiguration due the dynamic creation and deletion of peers inthe network. Taking into consideration these two views, stochastic graph trans-formation system is introduced, which is an integrated modeling of architecturalreconfiguration and non-functional aspects by associating each rule its applica-tion rate.[HLM04] Stochastic Graph Transformation Systems (SGTS) have theirown limitations, this approach is not applicable for models with large state space.Moreover, SGTS uses exponential distribution that does not always provide thebest abstraction. For example, the time it takes to transmit a message fromone peer to another in P2P network is more likely to follow a general distribu-tion. These limitations are quite significant as the distributed systems consists

2

Page 5: Stochastic Graph Transformation Systems

1.1 Objective

of a large number of nodes. In order to overcome these drawbacks, GeneralizedStochastic Graph Transformation Systems were introduced, that allow for generaldistributions dependent on rule - match pairs rather than just rule names.[THR10]“Generalized semi-Markov processes provide a semantic model for such systems,supporting stochastic simulation rather than model checking, simulations providea more flexible analysis in large-scale systems.”[THR10]

1.1 Objective

The objective of this paper is to analyze as to which approach is best suited tomeasure and predict the non-functional aspects of complex distributed systems.The two approaches discussed in this paper are Stochastic Graph TransformationSystems and Generalised Stochastic Graph Transformation Systems. The com-parison and analysis of the two approaches determine, simulation as the mostappropriate method for analyzing non-functional aspects of distributed systemswith large state space.

1.2 Document Structure

The paper is structured as follows. After discussing the related work in Chapter2. Description of the different rule based transformation systems like StochasticGraph Transformation Systems (SGTS) and Generalised Stochastic Graph Trans-formation Systems (GSGTS) is provided in the Chapter 3. In the SGTS section,the derivation of Markov chains, stochastic logic and model checking are alsodiscussed. Chapter 4 explains how each of the approaches ( SGTS and GSGTS )analyze, measure and predict the non-functional aspects of the P2P VoIP network,considered as an example of Self-Adaptive systems. The comparison between thetwo approaches is also given at the end of the chapter. Chapter 5 gives the finalconclusion of the paper along with the future work.

3

Page 6: Stochastic Graph Transformation Systems

2 Related Work

Stochastic modeling and analysis: The input to the stochastic analysis tech-niques are obtained from the suitable annotations in the specification and probabil-ity distributions for the transitions of the generated transition systems.[HLM04]Markov chains provide the fundamental model for stochastic analysis. Markovchains are transition systems labeled with probability distribution on transitions.One of the convenient methods of describing Markov chains is Stochastic Petrinets, where the underlying transition system is derived from the reachability graph.The state transitions are decorated with the probabilities of the net transitionsfrom which they are generated. Stochastic process algebra also works on the samebasis where process algebra like CCS or π-calculus describe the transition systems.[HLM04] However, these formalisms neglect the aspects such as data transforma-tion and changes to software architecture or network topology. The π-calculus istoo low-level for expressing requirements in the early stages of a project. There-fore, in this paper A high level formalism is achieved by replacing Petri nets orprocess algebra[DRH95] with graph transformation systems.Graph transformation for mobility: The language mobility semantics are de-scribed by graph transformation systems. Here we are interested in direct applica-tions to model mobile and distributed systems.[HLM04] There are two approachesto modeling: First approach takes a local perspective to model distributed systemsfrom the point of view of a single node. Second, specifies the preconditions andeffects of a potentially complex protocol with multiple participants, from a globalpoint of view rather than a single operation as in the former case. Since, thedynamic distributed systems consist of thousands of nodes, the approach which isconsidered in this paper chooses the second method that supports multiple nodes.Stochastic Context-Free Graph Grammars: Apart from system modelingand analysis, stochastic grammars are also one important feature. There aremany kinds of stochastic grammars of which one of the recent topics of inter-est is modeling biochemical process by graph transformation.[HLM04] Stochasticgrammar rules are used to predict the structure of glucan given a set of unknownglucoprotein and a set of glucans as training data.Probabilistic graph transformation: [KG12]Probabilistic graph transforma-tion systems provide better expressiveness in terms of modelling concepts com-pared to component-based models. PGTSs allows to study different networktopologies and requires less effort to adjust protocol. The choice for a particu-lar rule and match in a PGTSs is made nondeterministically whereas the effect ofa rule is probabilistic.

4

Page 7: Stochastic Graph Transformation Systems

3 Rule Based Graph Transformations

Systems with dynamically changing topologies are modeled by graph transforma-tions. Even though, models are the best means of understanding, they are tooabstract and the number of transformation steps involved to reach the real worldentity is large. Therefore, while designing and analyzing complex systems, mod-els become non-deterministic due to the loss of information during the process oftransformation and the individual occurrences become unpredictable. This prob-lem of information loss and lack of detail due to the usage of models, is overcomeby using graphs and analyzing behavior in terms of statistical aggregations insteadof individual occurrences. Graph transformation systems being a more visual andabstract formalism, eases communication between the client and developer as adirect and diagrammatic description of what changes are required rather than howthese changes are achieved. This is done by specifying the pre and post conditionsas graphical patterns, the Markov or Semi-Markov models used to learn and makedecisions over sequences of graphs. Yet another advantage of graph transformationsystem is natural modeling of distributed systems that are highly reconfigurableby viewing their architecture as a graph. The next challenge is the non-functionalrequirements that are very crucial for any system. In this chapter Stochastic graphtransformation system, that utilizes stochastic methods to capture, predict andmeasure the non-functional requirements and also support architectural reconfig-uration is introduced. In the second half of the chapter, Generalised stochasticgraph transformation system is presented to overcome the limitations of the earlierapproach.

3.1 Stochastic Graph Transformation Systems

Stochastic graph transformation is used to analyze the events that occur randomlyby probabilistic analysis and also for stochastic validation of graph-based model-ing. A simple form of stochastic graph transformation is derived by associatingrule names with rate, a probability distribution representing the delay in its ap-plication. For example, in a model of a peer-to-peer (P2P) network, operationssuch as peers joining and leaving the network, making connections can be modeledusing the stochastic graph transformation system.

5

Page 8: Stochastic Graph Transformation Systems

3. Rule Based Graph Transformations

P2P

networks

Type Graph

and

Attributed

Type Graph

Graph

Transformation

model in GROOVE

State Space

Exploration

Stochastic Model

for PAM using

Stochastic Graph

Transformation

on Tool

Stochastic

Model

rates associate

with each

rule names

Stochastic

Analysis in

PEPA

Results and

Interpretation

Figure 3.1: SGTS steps for analysing P2P networks

Fig.3.1 presents the methodology and tool support for the stochastic modellingand analysis of P2P networks. The following steps describe the SGTS approach:

Peer-to-Peer. An example scenario of P2P networks is considered to probe andcheck the feasibility of stochastic model checking of graph transformation systems.

Type graph and Attributed Type Graph. Graphs are used to represent the statesof P2P networks to include Peers, Registry servers, links, physical and logicalrelationship between them.

6

Page 9: Stochastic Graph Transformation Systems

3.1 Stochastic Graph Transformation Systems

Figure 3.2: Type graph of P2P Networks

The type graph shown in the Fig.3.2, the instance graph shown in Fig.3.3 andattributed type graph is drawn to represent the states and their logical relation-ship.

Figure 3.3: Instance graph of P2P Networks

Graph Transformation Model. Graph transformation system shown in Fig.3.4consists of a set of rules and these rules are applied on the original graph to com-pute the subsequent steps. A graph transformation is denoted by M

p,m−−→ N is

defined by the right double push out diagram, where p= ( Ll←− K

r−→ R) is a ruleand m : L → M is a typed graph morphism. Negative Application Condition(NAC) is used to restrict the rules applied and GROOVE is the transformationengine used for employing rules.

State Space Exploration. To analyze the network topology and other properties

7

Page 10: Stochastic Graph Transformation Systems

3. Rule Based Graph Transformations

L K R

M C N

mPO PO

rl

Figure 3.4: Graph transformation

of P2P networks, state space formalisms are required. Therefore, the state spaceexploration is performed in GROOVE.

Stochastic Graph Tansformation Model. A State transition matrix is obtainedfrom the state space generated as a labeled transition system by GROOVE. Thestochastic graph transformation tool is used for the conversion of state space totransition matrix. The transition system is then transformed into a Markov chainand the rates will be associated against each rule name. The transition matrix isused as an input to a plug in of PEPA.

Stochastic Analysis. PEPA performs the stochastic analysis. The non-functionalaspects P2P networks can be determined from the resulting output of the analysis.The resulting analysis exhibits the lists of the rate at which the activities of PEPAmodels of P2P network performed at steady-state.

Interpretation of Results. The results thus obtained by the stochastic analysisin PEPA are interpreted for analyzing the P2P network topologies. In Stochasticgraph transformation systems, Continuous-Time Markov Chain (CTMC) is de-rived from the transition systems. The CTMCs acts as a basis for stochastic logicand model checking.

Definition (Stochastic GTS) : “A stochastic graph transformation systemSG = (Σ, ATG, P, ρ) consists of a graph transformation system (Σ, ATG, P)and a function ρ: P → +

R associating with every rule name a positive real numberrepresenting the rate of the exponentially distributed delay of its application.

• Σ= (SΣ,OPΣ) is the data signature with attribute value.

• The attributed type graph ATG = (TG, Z) where Z is the final Σ-algebra.

• The transition probability matrix P (t) describes the dynamic behavior of aContinuous Time Markov Chain.”[HLM04]

The non-functional aspects like reliability, for instance properties like long-termprobability of connectedness can be expressed and verified by continuous stochasticlogic ( CSL ). Firstly, continuous-time Markov chains ( CTMCs ) are derived, theCTMC is the standard model for stochastic analysis. This in turn enables us toestablish a link to continuous stochastic logic ( CSL ). Since SGTS uses exponential

8

Page 11: Stochastic Graph Transformation Systems

3.2 Generalised Stochastic Graph Transformation Systems

distribution, Continuous-time Markov Chains can be derived for the verificationof non-functional properties through model checking.

3.1.1 Basic Notions:

Q-matrix : “The Q-matrix is known as a transition rule matrix. Q-matrix isused in order to define random processes. SGTS uses continuous-time randomprocesses in which the number of times the random variable changes, the value isfinite or countable.”[Hec05]

Stochastic Continuous Time Markov Chain: A Continuous-Time MarkovChain [And91] is a pair (S, Q) where S is a countable set of states and Q is a Q-matrix on S. It is a continuous-time, discrete-state random process. By showinghow to derive Continuous-Time Markov Chains, the basis for stochastic logic andmodel checking is provided. Let G and H be graphs such that the reduced graphsG| ID′ and H | ID′ are isomorphic via an isomorphism Φ. As all instantiatedrules derive from abstract rules, the transitions out of G and H are instantia-tions of the same rules, and therefore have the same rates. We can thus, by asuitable adaptation of the attribution, apply the same rules to two states whichdiffer only with respect to the attributes in ID\ ID’. This means that we can re-duce the CTMC dramatically for model checking purposes.[HLM04] Even thoughSGTS has some explicit features there are certain limitations. As explained aboveCTMC, which uses SGTS, is basically a model checker but model checking is notfeasible for models with large state spaces. Since we are talking about distributedand mobile systems whose performance and reliability depend on the behavior ofthe large number of entities, this can be considered as a major limitation. More-over, exponential distribution does not always provide the best abstraction. Inorder to overcome the limitations of SGTS another concept known as GeneralisedStochastic Graph Transformation System (GSGTS) is introduced.

3.2 Generalised Stochastic Graph Transformation Systems

In a realistic scenario, P2P network models will be large and complex, Skype VoIPnetwork is one such example. The representation of states in detail lead to largestate spaces with a large rule set giving rise to scalability issues. In this section amethodology for analyzing such complex networks is presented, Fig.3.5 describesthe steps involved in the analysis of Skype VoIP networks by Generalised Stochas-tic graph transformations. GSGTS allows complete or general distribution insteadof an exponential distribution. Unlike the rule name association with rate as inSGTS, GSGTS uses rule match pairs. Further SGTS is converted to generalisedSGTS by encoding it into generalised semi-Markov schemes (GSMS). GSMS isa generalization of Markov chains associated with generalised semi-Markov pro-cesses. Time between two events are continuously distributed because the transi-tions are not dependent on the past states but depend on the time spent in the

9

Page 12: Stochastic Graph Transformation Systems

3. Rule Based Graph Transformations

current state unlike Markov chains. GSGTS treat a graph transformation systemas discrete event systems where events are rule matches. The distribution functiongoverning the delay in the application of the corresponding transformation stepis associated with each event, thereby introducing the stochastic aspect.The basicnotion of stochastic graph transformation together with their semantic model ofgeneralised semi-Markov processes are provided.

Skype VoIP

networks

Type Graph

and

Attributed

Type Graph

Graph

Transformation

model in VAITRA

State Space

Exploration

Stochastic Model

for GraSS plugin

using Stochastic

Graph

Transformation on

Tool

Stochastic

Model

rates associate

with each

rule match pairs

Stochastic

simulation in

GraSS

Results and

Interpretation

Figure 3.5: GSGTS steps for analysing Skype VoIP networks

Definition: (Generalised Stochastic Graph Transformation Systems)“GSGTS is defined by associating events with general distributions, each of themexpressed as a cumulative distribution function (cdf ) i.e. a function of real num-bers to probability values. Here we denote by Dist(e) ⊆ Real→[0,1] the type ofthe cdf assigned to event e. A generalised stochastic graph transformation system(GSGTS) is a structure S= (G,∆0). Where G is a GTS, ∆0 : πe ε εG. Dist(e) isa distribution assignment, which associates with every event a cdf.”[THR10]

10

Page 13: Stochastic Graph Transformation Systems

3.2 Generalised Stochastic Graph Transformation Systems

Generalised Semi-Markov Processes :Generalised Semi-Markov Processes (GSMP) are obtained from SGTS [HT10]where we count on the discrete event semantics of stochastic processes. Theprobabilistic transitions are associated with timed events consisting of finite statesystems. In GSMP, timers and the interevent times can be generally distributed.This is consistent with a model in which events are usually independent of thepast states but, unlike Markov processes, they may depend on inter event times.GSMPs are generalizations of continuous-time Markov chains, they can be re-garded as Markov processes with generally distributed timers.[HT10] Indeed, aprocess generated by a GSMS where all timers are exponentially distributed vari-ables is stochastically equivalent to a continuous-time Markov chain. GSMP can bedefined as a process generated by a generalised semi-Markov scheme (GSMS).[THR10]SGTS is defined as a generic notion of graph transformation, in order to derive ageneral interface between the stochastic control component of the simulation andgraph transformation tools for executing rules.GSGTS as GSMS:“A Generalised Stochastic GTS defines a GSMS, where ∆(r,m) (d) is the probability that the waiting time for rule r at match m is less thand. GSGTS = ( ReachGraphsRuleMatchesEnablesMatches : ReachGraph → ϕ RuleMatchGraphTrans : ReachGraph X RuleMatch → ReachGraph∆ : RuleMatch → (R→[1,0])InitialGraph : ReachGraph).”[HTR]

In GSMS based simulation execution is based on the event scheduling scheme.First the event with the shortest time is executed with the updation of the sim-ulation time, then the enabled matches are computed. Finally scheduling timesof new matches are determined by random number generator ∆. This leads todecrease in waiting time of the old matches. The number of matches makes adifference in the actual probability of rule application also the waiting times maydepend on the local value of attributes. Therefore, it is important to computeall matches at each step. Moreover, the identity of matches needs to be retaineddue to which the recompilation of matches cannot be carried out at each step.This problem of matches is overcome using incremental pattern matching (IPM).IPM is a standard approach used to update constantly in model size and rulenumber. When the rules have the complex LHS and all the matches are needed,IPM is used. VIATRA (Eclipse plugin) is a graph transformation engine thatimplements IPM. The Simulation of the model is done using GraSS (Graph basedStochastic Simulation),[KHTR10] a tool developed in Java-Eclipse, as a plugin ofa graph transformation engine called VIATRA. The architecture of the tool [HTR]is shown in Fig 3.1. Essentially, the stochastic engine receives the set of enabledrule matches (i.e. the active events) from the transformation engine, turns theminto timed events, by assigning to each of them an expected time value, randomlydetermined on the basis of the probability distribution which is associated with

11

Page 14: Stochastic Graph Transformation Systems

3. Rule Based Graph Transformations

the event type, and sends the events that has been scheduled first back to thetransformation engine for execution. In GraSS a graph transformation system isrepresented as a VIATRA model, consisting of the model space with the currentgraph and the transformation rules. [KHTR10] GraSS takes as an input an XMLfile with the distribution associated with transformation rules and events. Ad-ditional parameters for simulation are provided to GraSS as a part of VIATRAmodel.VIATRA, the graph transformation engine computes the matches and executesthe selected match.[KHTR10] While the simulation engine (GraSS) determinesand manages the waiting time, selects the rule matches for execution from whichthe statics are extracted. Finally, the simulation engine also controls textual andvisual output.

Transformation

RulesDistributions Simulation

Parameters

Stochastic

Simulation

Engine

Graph

Transformation

Engine

Model

State

Visual output Analysis Textual

Output

new matches

preexisting matches

selected match

enabled

matchesexecrule

Figure 3.6: GraSS[KHTR10]

12

Page 15: Stochastic Graph Transformation Systems

4 Simulation Over Model Checking

In this section self-adaptive systems are considered to discuss the advantages ofsimulation over model checking.

Self adaptive systems are the systems which are capable of dealing with thecontinuously changing environment and upcoming requirements which are notknown at the development time. The meaning of “self” tells that the systemscan decide automatically sometimes without or with minimal interference, how toorganize or adopt changes in their context of environment and behave accordingly.Moreover there are some self-adaptive systems which can work fully on their ownusing some algorithms, rules and policies.[BSG+09] In order to make such systems,the systems should have the following properties: correctness, robustness, actu-ality, interoperability, maintainability, portability, security, efficiency, reliabilityand user-friendliness. All these properties should be adopted autonomously for aself adaptive system.[BSG+09] Peer-to-Peer networks are self-adaptive systems inaccordance with the characteristics discussed earlier.

4.1 Analysis of P2P using SGTS

A case study of P2P networks is used to validate the practicability of Stochasticgraph transformation systems, including the derivation of Markov chains, stochas-tic logic and model checking. Stochastic graph transformation systems are intro-duced in order to account for the non-functional aspects of P2P networks byassociating an exponentially distributed application delay with each rule. Thestandard model for stochastic analysis, continuous-time Markov chains (CTMCs)is derived. This enables us to establish a link to continuous stochastic logic (CSL)to express and verify properties like the probability of being connected within 20seconds after start-up, the long-term probability of connectedness, etc.

“Rules generate transformations by replacing in a given graph a match for theleft-hand side with a copy of the right-hand side. Thus, a graph transformationfrom a pre-state G to a post-state H, is performed in three steps :

• Step1: Find a match of the left-hand side L in the given graph G, repre-sented by an injective graph morphism m : L→G, and check if it satisfiesthe application conditions, if any;

• Step2: Delete from G all vertices and edges matching L \ R;

• Step3: Paste to the result a copy of R \ L, yielding the derived graphH.”[Hec05]

13

Page 16: Stochastic Graph Transformation Systems

4. Simulation Over Model Checking

The Rules listed below explains graph transformations in P2P networks:

• Rule new : As shown in the Fig.4.1 adds a new peer in the network, registersit and links it to an existing peer in the network.

Figure 4.1: Rule new[THR10]

• Rule kill : As shown in the Fig.4.2 deletes a peer with all the links attachedto it in the network.

Figure 4.2: Rule kill[THR10]

• Rule random : As shown in the Fig.4.3 creates a link between p2 and p3under two conditions. Firstly, when there is a link already present betweenp2 and p3. Secondly, if the number of additional connection of p2 or p3 isgreater than 2.

14

Page 17: Stochastic Graph Transformation Systems

4.1 Analysis of P2P using SGTS

p1:Pl

p3:P

p2:P

ll

random:P

:P

p3:P

:P

:P

p1:P

l

l

l

p2:P

Figure 4.3: Rule random[THR10]

• Rule smart : As shown in the Fig.4.4 establishes a link between p2 and p3if there is no two-hop path except the one through p1.

l

ll

p3:P

p2:P

p1:Psmart

p1:Pl

ll

:P

p3:P

p2:Pl

l

Figure 4.4: Rule smart[THR10]

In[Hec05] an experiment is conducted using GROOVE as the transformation en-gine to generate labelled transition and PRISM as a model checker.

15

Page 18: Stochastic Graph Transformation Systems

4. Simulation Over Model Checking

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1.0S=

? ["

dis

connect

ed"]

Probability of network being disconnected

shortcut_rate = 10x

0 1 2 3 4

smart

random

Figure 4.5: Result of stochastic model checking[Hec05]

Fig.4.5 shows the results of the two, Random and Smart stochastic graph trans-formation systems. The experiment presented in [Hec05] on a P2P network witha maximum of 7 peers with GOOVE and PRISM as tools. In Fig.4.5, the X-axisrepresents the rate of rule random and rule smart, the rate increases exponentiallyby a factor 10. Y-axis represents the probability of network being disconnected.The graph shows that on increasing the rate of both the rules by a factor 10, rulesmart gives better results than rule random. Fig.4.5 shows that by decreasing therate of rule smart there is a sharp decrease in the graph indicating the probabilityof network being disconnected while there are minimal changes in the graph ofrule random.

4.2 A better solution for analyzing P2P networks

A P2P Skype VoIP network is considered as an example application to demon-strate the analysis of non-functional aspects using GSGTS. The Skype directorystructures are completely decentralized which allows access to a large number ofusers without the requirement of complex infrastructure.[KHTR10] The Skypenetwork structure is as follows. There are two kinds of network nodes: Skypeclients are the nodes supporting Skype peers in their computational power, stor-age capabilities, network connection type and bandwidth. Super nodes are the

16

Page 19: Stochastic Graph Transformation Systems

4.2 A better solution for analyzing P2P networks

peers supplied with sufficient resources while they still continue to function asclients.[KHTR10] The Registration server is the central server responsible for stor-ing usernames and passwords, authenticating users and each client has to registerwith this central server to obtain the address of the super nodes through whichthey get connected to the network.[KHTR10]

RS

register

RSoverlay

Packet

chronos: T

content: string

receiver atsender

Node

bandwidth:int

memory:int

Exit:bol

SC

firewall:bool

SN

0..1

LK

linkTo

1

outTo

target

source OV

Figure 4.6: Type Graph[KHTR10]

Stochastic simulation of P2P graph transformation system:Graph transformation is used to model the structural evolution of the Skype net-work shown in Fig.4.6. The common super type of the nodes is represented usingthe type graph while the nodes like registration server (RS), super node (SN) andSkype client (SC) are instance level graphs and are typed over the super typegraph. The node type LK is used to model links between the different nodes andOV represents the overlay connection. The edges for registration and RS-overlaysare used to show the connection of the SN and SC with RS. As per [KHTR10], inthe model, whenever a new SC joins the network, first of all it has to register itwith the registration server RS and in the next step it has to select one SN as alocal host. This local host will be used for querying the network. In this model ifa SC is having bandwidth more than 1.5Mbps than it is promoted to a new roleof SN.

17

Page 20: Stochastic Graph Transformation Systems

4. Simulation Over Model Checking

:LK sc:SC

rs:RS

register

linkTo

outTo

outTo

sn2:SN

:SN

sc:SC

lk1:LK

RSoverlay

sn1:SNsn1:SN

linkTo

outTo

lk1:LK

sn1 bandwidth= sn1 bandwidth-5

sc bandwidth=sc.bandwidth-5

sn1:SN

outTo

lk1:LK

sc.bandwidth=sc.bandwidth-5

sc.exit =False

sn1.exit =False

sn1.bandwidth>256

linkTo

sn1.exit = False

sn1.bandwidth>256

(a) Connect SC to SN

sc:SC

(b) Reconfigure to connect to new SN

Figure 4.7: SC connection to SN based on random approach[KHTR10]

Fig.4.7 gives the description of the steps involved in connecting SC to SN usingrandom based approach. According to [KHTR10] SC connects itself to a randomlychosen SN when the following conditions are satisfied: SN should not be in theprocess of leaving the network and the bandwidth of SN should be greater than256kbps. The simulation performed on a P2P Skype VoIP network using GraSStool consists of the following steps

• First, the enabled match is obtained from graph transformation engine byinitializing the simulation time T to 0. A random number generator com-putes the scheduling time te for each active event on the basis of the probabil-ity distribution assigned to the event.[THR10] List of timed events orderedby time is collected.

• Then at each simulation step, first element k = (e, t) is removed from thestate list due to which the simulation time has increased to t. The graphtransformation engine executes the event e.[THR10] A new state list s’ iscomputed by querying the transformation engine, removing all the disabledelements from the list and adding to the list the newly enabled events.

The experiments conducted in [THR10] removes the restriction to 7 nodes thatguaranteed a manageable, finite state space. Simulation deals with concrete graphsand transitions and not the states and transitions that are presented up to isomor-phism. The experiment is conducted with 10 different models in which 5 versionsuse random rule and the other 5 versions use smart rule. The rates associated with

18

Page 21: Stochastic Graph Transformation Systems

4.2 A better solution for analyzing P2P networks

Figure 4.8: Sample results of smart rule and random rule[THR10]

these rules range through x ε 1,10,100,1000,10000. The simulation time bound of10s is used to perform 5 runs for each experiment. The runs never exceed 10sregardless of the number of steps. Fig. 4.8 gives the output of an experiment.The first column indicates the rules (random, smart) along with its applicationrate, the second column gives the value of disconnected peers, followed by theaverage number of steps performed per run, the average maximal extension of thenetwork, and the average time taken for each run. There is no significant changein reliability on increasing the rate in random rule. Whereas the results confirmthe inverse dependency between the probability of being disconnected and therate of the smart rule. The complexity of pattern disconnect limits the number ofsimulations per sec i.e, performance. The proportion with at least two connectionswould do, making them less vulnerable to loss of connectivity. [THR10] Moreover,an increase in the number and complexity of the rules can add to the cost of graphtransformation.

19

Page 22: Stochastic Graph Transformation Systems

4. Simulation Over Model Checking

Stochastic Graph Transformation

SystemGeneralised Stochastic Graph

Transformation System

Modeling

technique

Validation

technique

Probability

distribution

Association

Graph Transformation System

Model Checking

Exponential

Rule name associated with rate

Graph Transformation System

Simulation

General

Rule match pairs associated

with rate

Event typeGSGTS treat a GT as discrete

event systems, where events are

rule matches

SGTS treat a GT as non discrete

event systems, where

events are rules

Tool supportGraph Transformation System:GROOVE

Model Checking : PRISM

Graph Transformation Engine:VIATRA

Simulation : GraSS

ProcessMarkov Process : Next state depends

on the current state only, interevent

time is exponentially distributed

Semi-Markov Process : Next state

depends on time spent in current

state

Figure 4.9: Comparison of the two approaches

The comparison of the two approaches used in the paper : Stochastic graphtransformation system and Generalised stochastic graph transformation systemare shown in the Fig.4.9 and referred from [HTR] [THR10].

20

Page 23: Stochastic Graph Transformation Systems

5 Summary

In this paper, two approaches namely SGTS and GSGTS that are used to analyze,measure and predict the non-functional aspects are discussed. A case study isdeveloped to validate the practicability of SGTS and to understand its limitations.The addition of redundant links in a P2P network is modeled and analyzed usingan experimental tool chain. The results reveal the drawback of SGTS, explainingthe need for a more general approach. Therefore, GSGTS is also introducedin the paper that would provide a better means to analyze properties such asperformance, reliability and many other non-functional aspects. Another P2PSkype VoIP network is used as an example application to depict GSGTS as amore appropriate and an efficient approach, that uses simulation to complimentmodel checking to obtain better results.

In my opinion, the size of systems and the complexity induced in them is in-creasing day by day. Therefore, to analyze the models of such complex softwaresystems, simulation is a more appropriate approach.

In the future, this approach can be used to model complex systems. For instance,the power grid system which consists of a large number of nodes (power plants,transmission substation, power substation and transformer ). The power loss,during the transmission between the nodes can be used to measure and predictnon-functional properties such as reliability and performance. Moreover, in manysystems, there is a mix between stochastic and deterministic behavior. Therefore,stochastic models can be related to stochastic automata.

21

Page 24: Stochastic Graph Transformation Systems

Bibliography

[And91] William James Anderson. Continuous-time Markov chains: Anapplications-oriented approach, volume 7. Springer-Verlag New York,1991.

[BSG+09] Yuriy Brun, Giovanna Di Marzo Serugendo, Cristina Gacek, Hol-ger Giese, Holger Kienle, Marin Litoiu, Hausi Muller, Mauro Pezze,and Mary Shaw. Engineering self-adaptive systems through feedbackloops. In Software Engineering for Self-Adaptive Systems, pages 48–70.Springer, 2009.

[DRH95] Susanna Donatelli, M Ribaudo, and Jane Hillston. A comparisonof performance evaluation process algebra and generalized stochasticpetri nets. In Petri Nets and Performance Models, 1995., Proceedingsof the Sixth International Workshop on, pages 158–168. IEEE, 1995.

[GF88] Tom Gilb and Susannah Finzi. Principles of software engineering man-agement, volume 4. Addison-Wesley Reading, MA, 1988.

[Hec05] Reiko Heckel. Stochastic analysis of graph transformation systems:A case study in p2p networks. In Theoretical Aspects of Computing–ICTAC 2005, pages 53–69. Springer, 2005.

[HLM04] Reiko Heckel, Georgios Lajios, and Sebastian Menge. Stochastic graphtransformation systems. In Graph Transformations, pages 210–225.Springer, 2004.

[HT10] Reiko Heckel and Paolo Torrini. Stochastic modelling and simulationof mobile systems. In Graph transformations and model-driven engi-neering, pages 87–101. Springer, 2010.

[HTR] Reiko Heckel, Paolo Torrini, and Istvan Rath. Viatra/grass:Transformation-based stochastic simulation.

[KG12] Christian Krause and Holger Giese. Probabilistic graph transformationsystems. In Graph Transformations, pages 311–325. Springer, 2012.

[KHTR10] Ajab Khan, Reiko Heckel, Paolo Torrini, and Istvan Rath. Model-based stochastic simulation of p2p voip using graph transformationsystem. In Analytical and Stochastic Modeling Techniques and Appli-cations, pages 204–217. Springer, 2010.

22

Page 25: Stochastic Graph Transformation Systems

Bibliography

[THR10] Paolo Torrini, Reiko Heckel, and Istvan Rath. Stochastic simulation ofgraph transformation systems. In Fundamental Approaches to SoftwareEngineering, pages 154–157. Springer, 2010.

23