• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Stochastic Graph Transformation Systems
 

Stochastic Graph Transformation Systems

on

  • 486 views

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 ...

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.

Statistics

Views

Total Views
486
Views on SlideShare
486
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Stochastic Graph Transformation Systems Stochastic Graph Transformation Systems Document Transcript

    • Fakult¨t f¨r Elektrotechnik, Informatik und Mathematik a u Heinz Nixdorf Institut und Institut f¨r Informatik u Fachgebiet Softwaretechnik Warburger Straße 100 33098 Paderborn Stochastic Graph Transformation Systems by Nitesh Kumar Singh nitesh@mail.uni-paderborn.de Supervisors: Jun.-Prof. Dr.-Ing. Steffen Becker, M.Sc. Matthias Becker Paderborn, September 2013
    • Contents 1 Introduction 1.1 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Document Structure . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3 3 2 Related Work 4 3 Rule Based Graph Transformations 3.1 Stochastic Graph Transformation Systems . . . . . . . . . . . . . . 3.1.1 Basic Notions: . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Generalised Stochastic Graph Transformation Systems . . . . . . . 5 5 9 9 4 Simulation Over Model Checking 4.1 Analysis of P2P using SGTS . . . . . . . . . . . . . . . . . . . . . 4.2 A better solution for analyzing P2P networks . . . . . . . . . . . . 13 13 16 5 Summary 21 Bibliography 22 ii
    • Abstract 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. One of the proposed methods to analyze the non-functional properties that implement stochastic simulation based on semi-Markov processes is presented in the paper. Further, the comparison of this approach with the standard technique is carried out in order to provide an efficient approach to analyze the principal aspects of a system that leads to its success. The comparison is done using P2P networks and the comparative analysis reveals that more realistic data can be obtained by complementing model checking, used by the standard technique with stochastic simulation. 1
    • 1 Introduction Non-functional aspects like performance, reliability, maintainability, portability, to name a few, are not the functions that can be captured in use cases. The behavior of these aspects cannot be analyzed by drawing sequence diagrams or statecharts. Non-functional aspects are more like constraints on a system that define how a system is supposed to be. It is not only hard to model the requirements that are fulfilled by non-functional aspects, but also difficult to capture or predict them. Since, the requirements are stated informally, most often they contradict, and it becomes difficult to enforce them. Moreover, it is not an easy task to measure or evaluate these aspects until the system is operated in its environment. These difficulties encountered during the early development phases of the software projects leads to their failure.[GF88] In the development of a software system, communication between client and developer requires a direct, diagrammatic description of what is required rather than how it is achieved. Models are considered to be the most appropriate means of designing such complex distributed systems since they abstract the irrelevant details. However, in this process information is lost and individual occurrences of events may become unpredictable. Therefore, Stochastic concepts are required to formalize such properties. Most of the stochastic formalisms introduced such as stochastic petri nets and π calculus either concentrated more on ordering of events or was too low-level for expressing the requirements at initial stages of development.[Hec05] Graph transformation systems are more visual and more abstract formalism with similar expressiveness, that views the architecture of a distributed system as a graph and naturally models it by graph transformations. In this approach, only problem and solution space are specified using complex graphical patterns without focussing on how these patterns are linked to each other ( implemented ). [Hec05] Distributed systems are also characterized by a high degree of architectural reconfiguration. For instance, the P2P networks are subjected to a high degree of architectural reconfiguration due the dynamic creation and deletion of peers in the network. Taking into consideration these two views, stochastic graph transformation system is introduced, which is an integrated modeling of architectural reconfiguration and non-functional aspects by associating each rule its application rate.[HLM04] Stochastic Graph Transformation Systems (SGTS) have their own limitations, this approach is not applicable for models with large state space. Moreover, SGTS uses exponential distribution that does not always provide the best abstraction. For example, the time it takes to transmit a message from one peer to another in P2P network is more likely to follow a general distribution. These limitations are quite significant as the distributed systems consists 2
    • 1.1 Objective of a large number of nodes. In order to overcome these drawbacks, Generalized Stochastic Graph Transformation Systems were introduced, that allow for general distributions 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 provide a 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 to measure and predict the non-functional aspects of complex distributed systems. The two approaches discussed in this paper are Stochastic Graph Transformation Systems and Generalised Stochastic Graph Transformation Systems. The comparison and analysis of the two approaches determine, simulation as the most appropriate method for analyzing non-functional aspects of distributed systems with large state space. 1.2 Document Structure The paper is structured as follows. After discussing the related work in Chapter 2. Description of the different rule based transformation systems like Stochastic Graph Transformation Systems (SGTS) and Generalised Stochastic Graph Transformation Systems (GSGTS) is provided in the Chapter 3. In the SGTS section, the derivation of Markov chains, stochastic logic and model checking are also discussed. 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 the two approaches is also given at the end of the chapter. Chapter 5 gives the final conclusion of the paper along with the future work. 3
    • 2 Related Work Stochastic modeling and analysis: The input to the stochastic analysis techniques are obtained from the suitable annotations in the specification and probability distributions for the transitions of the generated transition systems.[HLM04] Markov chains provide the fundamental model for stochastic analysis. Markov chains are transition systems labeled with probability distribution on transitions. One of the convenient methods of describing Markov chains is Stochastic Petri nets, where the underlying transition system is derived from the reachability graph. The state transitions are decorated with the probabilities of the net transitions from which they are generated. Stochastic process algebra also works on the same basis where process algebra like CCS or π-calculus describe the transition systems. [HLM04] However, these formalisms neglect the aspects such as data transformation and changes to software architecture or network topology. The π-calculus is too low-level for expressing requirements in the early stages of a project. Therefore, in this paper A high level formalism is achieved by replacing Petri nets or process algebra[DRH95] with graph transformation systems. Graph transformation for mobility: The language mobility semantics are described by graph transformation systems. Here we are interested in direct applications to model mobile and distributed systems.[HLM04] There are two approaches to modeling: First approach takes a local perspective to model distributed systems from the point of view of a single node. Second, specifies the preconditions and effects of a potentially complex protocol with multiple participants, from a global point of view rather than a single operation as in the former case. Since, the dynamic distributed systems consist of thousands of nodes, the approach which is considered in this paper chooses the second method that supports multiple nodes. Stochastic Context-Free Graph Grammars: Apart from system modeling and analysis, stochastic grammars are also one important feature. There are many kinds of stochastic grammars of which one of the recent topics of interest is modeling biochemical process by graph transformation.[HLM04] Stochastic grammar rules are used to predict the structure of glucan given a set of unknown glucoprotein and a set of glucans as training data. Probabilistic graph transformation: [KG12]Probabilistic graph transformation systems provide better expressiveness in terms of modelling concepts compared to component-based models. PGTSs allows to study different network topologies and requires less effort to adjust protocol. The choice for a particular rule and match in a PGTSs is made nondeterministically whereas the effect of a rule is probabilistic. 4
    • 3 Rule Based Graph Transformations Systems with dynamically changing topologies are modeled by graph transformations. Even though, models are the best means of understanding, they are too abstract and the number of transformation steps involved to reach the real world entity is large. Therefore, while designing and analyzing complex systems, models become non-deterministic due to the loss of information during the process of transformation and the individual occurrences become unpredictable. This problem of information loss and lack of detail due to the usage of models, is overcome by using graphs and analyzing behavior in terms of statistical aggregations instead of individual occurrences. Graph transformation systems being a more visual and abstract formalism, eases communication between the client and developer as a direct and diagrammatic description of what changes are required rather than how these changes are achieved. This is done by specifying the pre and post conditions as graphical patterns, the Markov or Semi-Markov models used to learn and make decisions over sequences of graphs. Yet another advantage of graph transformation system is natural modeling of distributed systems that are highly reconfigurable by viewing their architecture as a graph. The next challenge is the non-functional requirements that are very crucial for any system. In this chapter Stochastic graph transformation system, that utilizes stochastic methods to capture, predict and measure the non-functional requirements and also support architectural reconfiguration is introduced. In the second half of the chapter, Generalised stochastic graph transformation system is presented to overcome the limitations of the earlier approach. 3.1 Stochastic Graph Transformation Systems Stochastic graph transformation is used to analyze the events that occur randomly by probabilistic analysis and also for stochastic validation of graph-based modeling. A simple form of stochastic graph transformation is derived by associating rule names with rate, a probability distribution representing the delay in its application. For example, in a model of a peer-to-peer (P2P) network, operations such as peers joining and leaving the network, making connections can be modeled using the stochastic graph transformation system. 5
    • 3. Rule Based Graph Transformations P2P networks Type Graph and Attributed Type Graph Results and Interpretation Stochastic Analysis in PEPA Graph Transformation model in GROOVE Stochastic Model rates associate with each rule names State Space Exploration Stochastic Model for PAM using Stochastic Graph Transformation on Tool Figure 3.1: SGTS steps for analysing P2P networks Fig.3.1 presents the methodology and tool support for the stochastic modelling and analysis of P2P networks. The following steps describe the SGTS approach: Peer-to-Peer. An example scenario of P2P networks is considered to probe and check the feasibility of stochastic model checking of graph transformation systems. Type graph and Attributed Type Graph. Graphs are used to represent the states of P2P networks to include Peers, Registry servers, links, physical and logical relationship between them. 6
    • 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 and attributed type graph is drawn to represent the states and their logical relationship. Figure 3.3: Instance graph of P2P Networks Graph Transformation Model. Graph transformation system shown in Fig.3.4 consists of a set of rules and these rules are applied on the original graph to comp,m pute the subsequent steps. A graph transformation is denoted by M − → N is − l r defined by the right double push out diagram, where p= ( L← K → R) is a rule − − and m : L → M is a typed graph morphism. Negative Application Condition (NAC) is used to restrict the rules applied and GROOVE is the transformation engine used for employing rules. State Space Exploration. To analyze the network topology and other properties 7
    • 3. Rule Based Graph Transformations l K L m R PO PO M r C N Figure 3.4: Graph transformation of P2P networks, state space formalisms are required. Therefore, the state space exploration is performed in GROOVE. Stochastic Graph Tansformation Model. A State transition matrix is obtained from the state space generated as a labeled transition system by GROOVE. The stochastic graph transformation tool is used for the conversion of state space to transition matrix. The transition system is then transformed into a Markov chain and the rates will be associated against each rule name. The transition matrix is used as an input to a plug in of PEPA. Stochastic Analysis. PEPA performs the stochastic analysis. The non-functional aspects 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 PEPA models of P2P network performed at steady-state. Interpretation of Results. The results thus obtained by the stochastic analysis in PEPA are interpreted for analyzing the P2P network topologies. In Stochastic graph transformation systems, Continuous-Time Markov Chain (CTMC) is derived from the transition systems. The CTMCs acts as a basis for stochastic logic and model checking. Definition (Stochastic GTS) : “A stochastic graph transformation system SG = (Σ, ATG, P, ρ) consists of a graph transformation system (Σ, ATG, P) and a function ρ: P → + associating with every rule name a positive real number R representing 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 a Continuous Time Markov Chain.”[HLM04] The non-functional aspects like reliability, for instance properties like long-term probability of connectedness can be expressed and verified by continuous stochastic logic ( CSL ). Firstly, continuous-time Markov chains ( CTMCs ) are derived, the CTMC is the standard model for stochastic analysis. This in turn enables us to establish a link to continuous stochastic logic ( CSL ). Since SGTS uses exponential 8
    • 3.2 Generalised Stochastic Graph Transformation Systems distribution, Continuous-time Markov Chains can be derived for the verification of 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 is used in order to define random processes. SGTS uses continuous-time random processes in which the number of times the random variable changes, the value is finite or countable.”[Hec05] Stochastic Continuous Time Markov Chain: A Continuous-Time Markov Chain [And91] is a pair (S, Q) where S is a countable set of states and Q is a Qmatrix on S. It is a continuous-time, discrete-state random process. By showing how to derive Continuous-Time Markov Chains, the basis for stochastic logic and model checking is provided. Let G and H be graphs such that the reduced graphs G| ID and H | ID are isomorphic via an isomorphism Φ. As all instantiated rules derive from abstract rules, the transitions out of G and H are instantiations of the same rules, and therefore have the same rates. We can thus, by a suitable adaptation of the attribution, apply the same rules to two states which differ only with respect to the attributes in ID ID’. This means that we can reduce the CTMC dramatically for model checking purposes.[HLM04] Even though SGTS has some explicit features there are certain limitations. As explained above CTMC, which uses SGTS, is basically a model checker but model checking is not feasible for models with large state spaces. Since we are talking about distributed and mobile systems whose performance and reliability depend on the behavior of the large number of entities, this can be considered as a major limitation. Moreover, exponential distribution does not always provide the best abstraction. In order to overcome the limitations of SGTS another concept known as Generalised Stochastic 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 VoIP network is one such example. The representation of states in detail lead to large state spaces with a large rule set giving rise to scalability issues. In this section a methodology for analyzing such complex networks is presented, Fig.3.5 describes the steps involved in the analysis of Skype VoIP networks by Generalised Stochastic graph transformations. GSGTS allows complete or general distribution instead of an exponential distribution. Unlike the rule name association with rate as in SGTS, GSGTS uses rule match pairs. Further SGTS is converted to generalised SGTS by encoding it into generalised semi-Markov schemes (GSMS). GSMS is a generalization of Markov chains associated with generalised semi-Markov processes. Time between two events are continuously distributed because the transitions are not dependent on the past states but depend on the time spent in the 9
    • 3. Rule Based Graph Transformations current state unlike Markov chains. GSGTS treat a graph transformation system as discrete event systems where events are rule matches. The distribution function governing the delay in the application of the corresponding transformation step is associated with each event, thereby introducing the stochastic aspect.The basic notion of stochastic graph transformation together with their semantic model of generalised semi-Markov processes are provided. Skype VoIP networks Type Graph and Attributed Type Graph Results and Interpretation Stochastic simulation in GraSS Stochastic Model rates associate with each rule match pairs Graph Transformation model in VAITRA State Space Exploration Stochastic Model for GraSS plugin using Stochastic Graph Transformation on Tool 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 them expressed as a cumulative distribution function (cdf ) i.e. a function of real numbers to probability values. Here we denote by Dist(e) ⊆ Real→[0,1] the type of the 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) is a distribution assignment, which associates with every event a cdf.”[THR10] 10
    • 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. The probabilistic transitions are associated with timed events consisting of finite state systems. In GSMP, timers and the interevent times can be generally distributed. This is consistent with a model in which events are usually independent of the past states but, unlike Markov processes, they may depend on inter event times. GSMPs are generalizations of continuous-time Markov chains, they can be regarded as Markov processes with generally distributed timers.[HT10] Indeed, a process generated by a GSMS where all timers are exponentially distributed variables is stochastically equivalent to a continuous-time Markov chain. GSMP can be defined 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 a general interface between the stochastic control component of the simulation and graph 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 than d. GSGTS = ( ReachGraphs RuleMatches EnablesMatches : ReachGraph → ϕ RuleMatch GraphTrans : 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 simulation time, then the enabled matches are computed. Finally scheduling times of new matches are determined by random number generator ∆. This leads to decrease in waiting time of the old matches. The number of matches makes a difference in the actual probability of rule application also the waiting times may depend on the local value of attributes. Therefore, it is important to compute all matches at each step. Moreover, the identity of matches needs to be retained due 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 rule number. When the rules have the complex LHS and all the matches are needed, IPM is used. VIATRA (Eclipse plugin) is a graph transformation engine that implements IPM. The Simulation of the model is done using GraSS (Graph based Stochastic Simulation),[KHTR10] a tool developed in Java-Eclipse, as a plugin of a 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 enabled rule matches (i.e. the active events) from the transformation engine, turns them into timed events, by assigning to each of them an expected time value, randomly determined on the basis of the probability distribution which is associated with 11
    • 3. Rule Based Graph Transformations the event type, and sends the events that has been scheduled first back to the transformation engine for execution. In GraSS a graph transformation system is represented as a VIATRA model, consisting of the model space with the current graph and the transformation rules. [KHTR10] GraSS takes as an input an XML file with the distribution associated with transformation rules and events. Additional parameters for simulation are provided to GraSS as a part of VIATRA model. VIATRA, the graph transformation engine computes the matches and executes the selected match.[KHTR10] While the simulation engine (GraSS) determines and manages the waiting time, selects the rule matches for execution from which the statics are extracted. Finally, the simulation engine also controls textual and visual output. Transformation Rules Distributions Simulation Parameters new matches Graph Transformation Engine exec rule preexisting matches selected match Stochastic Simulation Engine enabled matches Model State Visual output Figure 3.6: GraSS [KHTR10] 12 Analysis Textual Output
    • 4 Simulation Over Model Checking In this section self-adaptive systems are considered to discuss the advantages of simulation over model checking. Self adaptive systems are the systems which are capable of dealing with the continuously changing environment and upcoming requirements which are not known at the development time. The meaning of “self” tells that the systems can decide automatically sometimes without or with minimal interference, how to organize or adopt changes in their context of environment and behave accordingly. Moreover there are some self-adaptive systems which can work fully on their own using some algorithms, rules and policies.[BSG+ 09] In order to make such systems, the systems should have the following properties: correctness, robustness, actuality, interoperability, maintainability, portability, security, efficiency, reliability and user-friendliness. All these properties should be adopted autonomously for a self adaptive system.[BSG+ 09] Peer-to-Peer networks are self-adaptive systems in accordance 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 Stochastic graph transformation systems, including the derivation of Markov chains, stochastic logic and model checking. Stochastic graph transformation systems are introduced in order to account for the non-functional aspects of P2P networks by associating an exponentially distributed application delay with each rule. The standard 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 20 seconds after start-up, the long-term probability of connectedness, etc. “Rules generate transformations by replacing in a given graph a match for the left-hand side with a copy of the right-hand side. Thus, a graph transformation from 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, represented by an injective graph morphism m : L→G, and check if it satisfies the 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 graph H.”[Hec05] 13
    • 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, registers it 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 attached to 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 p3 under two conditions. Firstly, when there is a link already present between p2 and p3. Secondly, if the number of additional connection of p2 or p3 is greater than 2. 14
    • 4.1 Analysis of P2P using SGTS p1:P l p3:P p1:P l l :P :P p2:P random l l p3:P l :P p2:P :P Figure 4.3: Rule random [THR10] • Rule smart : As shown in the Fig.4.4 establishes a link between p2 and p3 if there is no two-hop path except the one through p1. p1:P l l p1:P p3:P l l :P p2:P l smart l l p3:P l p2:P Figure 4.4: Rule smart [THR10] In[Hec05] an experiment is conducted using GROOVE as the transformation engine to generate labelled transition and PRISM as a model checker. 15
    • 4. Simulation Over Model Checking Probability of network being disconnected 1.0 S=? ["disconnected"] 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 0 1 2 x shortcut_rate = 10 4 3 random smart Figure 4.5: Result of stochastic model checking [Hec05] Fig.4.5 shows the results of the two, Random and Smart stochastic graph transformation systems. The experiment presented in [Hec05] on a P2P network with a maximum of 7 peers with GOOVE and PRISM as tools. In Fig.4.5, the X-axis represents the rate of rule random and rule smart, the rate increases exponentially by 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, rule smart gives better results than rule random. Fig.4.5 shows that by decreasing the rate of rule smart there is a sharp decrease in the graph indicating the probability of network being disconnected while there are minimal changes in the graph of rule random. 4.2 A better solution for analyzing P2P networks A P2P Skype VoIP network is considered as an example application to demonstrate the analysis of non-functional aspects using GSGTS. The Skype directory structures are completely decentralized which allows access to a large number of users without the requirement of complex infrastructure.[KHTR10] The Skype network structure is as follows. There are two kinds of network nodes: Skype clients are the nodes supporting Skype peers in their computational power, storage capabilities, network connection type and bandwidth. Super nodes are the 16
    • 4.2 A better solution for analyzing P2P networks peers supplied with sufficient resources while they still continue to function as clients.[KHTR10] The Registration server is the central server responsible for storing usernames and passwords, authenticating users and each client has to register with this central server to obtain the address of the super nodes through which they get connected to the network.[KHTR10] RSoverlay RS Packet source OV chronos: T content: string receiver at sender SN target Node register 0..1 bandwidth:int memory:int Exit:bol outTo 1 SC firewall:bool LK linkTo 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 network shown in Fig.4.6. The common super type of the nodes is represented using the type graph while the nodes like registration server (RS), super node (SN) and Skype client (SC) are instance level graphs and are typed over the super type graph. The node type LK is used to model links between the different nodes and OV represents the overlay connection. The edges for registration and RS-overlays are used to show the connection of the SN and SC with RS. As per [KHTR10], in the model, whenever a new SC joins the network, first of all it has to register it with the registration server RS and in the next step it has to select one SN as a local host. This local host will be used for querying the network. In this model if a SC is having bandwidth more than 1.5Mbps than it is promoted to a new role of SN. 17
    • 4. Simulation Over Model Checking RSoverlay sn1:SN rs:RS sn1:SN register outTo linkTo linkTo :LK sc:SC sc.exit =False sn1.exit =False sn1.bandwidth>256 outTo lk1:LK sc:SC sn1 bandwidth= sn1 bandwidth-5 sc bandwidth=sc.bandwidth-5 (a) Connect SC to SN sn2:SN sn1:SN lk1:LK outTo :SN linkTo sc:SC sn1.exit = False sn1.bandwidth>256 outTo lk1:LK sc.bandwidth=sc.bandwidth-5 (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 using random based approach. According to [KHTR10] SC connects itself to a randomly chosen SN when the following conditions are satisfied: SN should not be in the process of leaving the network and the bandwidth of SN should be greater than 256kbps. The simulation performed on a P2P Skype VoIP network using GraSS tool consists of the following steps • First, the enabled match is obtained from graph transformation engine by initializing the simulation time T to 0. A random number generator computes the scheduling time te for each active event on the basis of the probability distribution assigned to the event.[THR10] List of timed events ordered by time is collected. • Then at each simulation step, first element k = (e, t) is removed from the state list due to which the simulation time has increased to t. The graph transformation engine executes the event e.[THR10] A new state list s’ is computed by querying the transformation engine, removing all the disabled elements from the list and adding to the list the newly enabled events. The experiments conducted in [THR10] removes the restriction to 7 nodes that guaranteed a manageable, finite state space. Simulation deals with concrete graphs and transitions and not the states and transitions that are presented up to isomorphism. The experiment is conducted with 10 different models in which 5 versions use random rule and the other 5 versions use smart rule. The rates associated with 18
    • 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 of 10s is used to perform 5 runs for each experiment. The runs never exceed 10s regardless 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 application rate, the second column gives the value of disconnected peers, followed by the average number of steps performed per run, the average maximal extension of the network, and the average time taken for each run. There is no significant change in reliability on increasing the rate in random rule. Whereas the results confirm the inverse dependency between the probability of being disconnected and the rate of the smart rule. The complexity of pattern disconnect limits the number of simulations per sec i.e, performance. The proportion with at least two connections would 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 graph transformation. 19
    • 4. Simulation Over Model Checking Stochastic Graph Transformation Generalised Stochastic Graph System Transformation System Modeling technique Graph Transformation System Graph Transformation System Validation technique Model Checking Simulation Probability distribution Association Exponential Rule name associated with rate General Rule match pairs associated with rate SGTS treat a GT as non discrete event systems, where events are rules GSGTS treat a GT as discrete event systems, where events are rule matches Process Markov 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 Tool support Graph Transformation System:GROOVE Model Checking : PRISM Graph Transformation Engine:VIATRA Simulation : GraSS Event type Figure 4.9: Comparison of the two approaches The comparison of the two approaches used in the paper : Stochastic graph transformation system and Generalised stochastic graph transformation system are shown in the Fig.4.9 and referred from [HTR] [THR10]. 20
    • 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 is developed to validate the practicability of SGTS and to understand its limitations. The addition of redundant links in a P2P network is modeled and analyzed using an experimental tool chain. The results reveal the drawback of SGTS, explaining the need for a more general approach. Therefore, GSGTS is also introduced in the paper that would provide a better means to analyze properties such as performance, reliability and many other non-functional aspects. Another P2P Skype VoIP network is used as an example application to depict GSGTS as a more appropriate and an efficient approach, that uses simulation to compliment model checking to obtain better results. In my opinion, the size of systems and the complexity induced in them is increasing day by day. Therefore, to analyze the models of such complex software systems, 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 predict non-functional properties such as reliability and performance. Moreover, in many systems, there is a mix between stochastic and deterministic behavior. Therefore, stochastic models can be related to stochastic automata. 21
    • Bibliography [And91] William James Anderson. Continuous-time Markov chains: An applications-oriented approach, volume 7. Springer-Verlag New York, 1991. [BSG+ 09] Yuriy Brun, Giovanna Di Marzo Serugendo, Cristina Gacek, Holger Giese, Holger Kienle, Marin Litoiu, Hausi M¨ller, Mauro Pezz`, u e and Mary Shaw. Engineering self-adaptive systems through feedback loops. In Software Engineering for Self-Adaptive Systems, pages 48–70. Springer, 2009. [DRH95] Susanna Donatelli, M Ribaudo, and Jane Hillston. A comparison of performance evaluation process algebra and generalized stochastic petri nets. In Petri Nets and Performance Models, 1995., Proceedings of the Sixth International Workshop on, pages 158–168. IEEE, 1995. [GF88] Tom Gilb and Susannah Finzi. Principles of software engineering management, 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 graph transformation systems. In Graph Transformations, pages 210–225. Springer, 2004. [HT10] Reiko Heckel and Paolo Torrini. Stochastic modelling and simulation of mobile systems. In Graph transformations and model-driven engineering, pages 87–101. Springer, 2010. [HTR] Reiko Heckel, Paolo Torrini, and Istv´n R´th. a a Transformation-based stochastic simulation. [KG12] Christian Krause and Holger Giese. Probabilistic graph transformation systems. In Graph Transformations, pages 311–325. Springer, 2012. Viatra/grass: [KHTR10] Ajab Khan, Reiko Heckel, Paolo Torrini, and Istv´n R´th. Modela a based stochastic simulation of p2p voip using graph transformation system. In Analytical and Stochastic Modeling Techniques and Applications, pages 204–217. Springer, 2010. 22
    • Bibliography [THR10] Paolo Torrini, Reiko Heckel, and Istv´n R´th. Stochastic simulation of a a graph transformation systems. In Fundamental Approaches to Software Engineering, pages 154–157. Springer, 2010. 23