1 / 42

Analysis of Message Sequence Charts

Analysis of Message Sequence Charts. Doron Peled Univ. of Warwick Bar Ilan University. Department of Computer Science University of Warwick. MSCs. An ITU standard notation (Z120). Visual + Textual forms. Specifies behaviors of communication protocols. Existing algorithms + tools.

amara
Télécharger la présentation

Analysis of Message Sequence Charts

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Analysis ofMessage Sequence Charts Doron Peled Univ. of Warwick Bar Ilan University Department of Computer ScienceUniversity of Warwick

  2. MSCs • An ITU standard notation (Z120). • Visual + Textual forms. • Specifies behaviors of communication protocols. • Existing algorithms + tools.

  3. MSC visual notation P1 P2 P3 M1 M2 M3 M4 M5 M6

  4. msc MSC; inst P1: process Root, P2: process Root, P3: process Root; instance P1; out M1 to P2; in M5 from P2; in M6 from P3; endinstance; instance P2; in M1 from P1; out M2 to P3; out M3 to P3; in M4 from P3; out M5 to P1; endinstance; MSC Textual form instance P3; in M2 from P2; in M3 from P2; out M4 to P2; out M6 to P1; endinstance; endmsc; P1 P2 P3 M1 M2 M3 M4 M5 M6

  5. Partial order semantics M1 s r M2 s r P1 P2 P3 M1 M2 M3 s M3 r M4 s M4 M5 r M6 s s M5 M6 r r

  6. HMSCs P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report

  7. An execution: infinite or maximal A B Execution: ACACD approve connect connect fail report connect fail fail Req_service report report Req_service C D

  8. Visual semantics • Sends before corresponding receives. • Events on the same process line execute in order of appearance, from top to bottom.

  9. Visual order (wysiwyg) • If some event (send, receive) is higher on the line than another, it comes first. • Sends precede matching receives. P1 P2 P3 M1 M2 M3 M4 M5 M6

  10. Visual order (wysiwyg) M1 s r M2 s P1 P2 P3 r M1 M2 M3 M3 s M4 r M5 s M4 M6 r s s M5 M6 r r

  11. Causal Order and Races P1 P2 P3 M1 • Sends before matching receive. • Receive or sends before sends of same process. • Two receives on the same process sent from the same process. M2 M3 M4 M5 M6 Races: check if every pair of events ordered by the visual order appears in the transitive closure of the causal order.

  12. Races P1 P2 P3 P1 P2 P3 M1 M1 M2 M2 M3 M3 M4 M4 M5 M6 M6 M5

  13. P1 P2 P3 M1 M2 M3 M4 M5 M6 Finding races: P1 P2 P3 M1 M2 M3 M4 M5 Rules: order between - receive and a later send. - two sends from same process. - send and corresponding receive. -fifo order. M6

  14. Causal Order M1 s r M2 s r P1 P2 P3 M1 M2 M3 s M3 M4 r M5 s M4 M6 r s s M5 M6 r r

  15. Calculating the transitive closure • Structure (E, R). • E – Events, R  E  E. • R* The transitive closure. Defined asfollows:a R*b if there is a sequencex1 x2 … xn where a=x1, b=xn,and xi R xi+1 for 1i<n. • Complexity: cubic. In our case: quadratic (every event has 1 or 2 successors).

  16. P1 P2 [2,4] [3,5] [7,10] [2,3] Can also deal with time Use time differencematrices.

  17. Races in HMSCs. Definition For each HMSC M execution Ex, define thelinearizations according to the visual orderlinvis(Ex) and the linearizations according to the causal order lincaus(Ex). Extend to all executions: linvis(Ex) and lincaus(Ex). • Always linvis(Ex)  lincaus(Ex). • Races: when linvis(Ex)  lincaus(Ex).

  18. Mazurkiewicz Traces Alphabet {a,b,c} Independence: aIb, bIc Equivalence classes of words (denoted usingrepresentatives):[aabb]=[abba] Regular trace language: can be defined usingconcatenation, star, union, intersection. Note: [ab]* is not recognizable (by automata).

  19. P1 P2 P3 connect fail report connect fail report connect approve Visual concatenation A B P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report Execution: concatenation of a maximal path in the HMSC. C D

  20. P1 P2 Other problems…Global decision M1 M2 P1 P2 + =? What if one process will start to behave according to M1 and the other will start according to M2?

  21. Races for HMSCs • Undecidable [MP99] • Translate to language theory of traces, which are closed w.r.t. commuting certain pairs of letters. • Intuition: moving from visual to causal semantic introduces more commutations:Two receives on the same process line (from different processes) are dependent on visual and independent on causal order. • Reduction to universality of trace languages (things are independent with causal semantics). Independent Language L Independent

  22. Quantifying the Discord: Order discrepancies in MSCs Doron Peled (Bar Ilan, Warwick) Joint work with: • Edith Elkind, Jerusalem • Blaise Genest, Rennes • Paola Spoletini (Milano)

  23. What is the order between red and orange messages? P1 P2 P3 P1 P2 P3 approve connect P1 P2 P3 P1 P2 P3 fail req_service report

  24. LSC style: assumes sequentiality between occurrences(!?!) P1 P2 P3 P1 P2 P3 approve connect Repeat 3 times P1 P2 P3 P1 P2 P3 fail req_service report

  25. P1 P2 P3 connect fail A report P1 P2 P3 connect fail connect report connect approve P1 P2 P3 fail report C “Harel” Concatenation B P1 P2 P3 approve P1 P2 P3 req_service Execution: concatenation of a maximal path in the HMSC. D

  26. Allen’s logic describes order between intervals Timeline A B … (3 more)

  27. We assume only cases where no two points coincide: 6 cases Timeline ApB We can express \/ by juxtapositioning: A pod B )No need for conjunction) o d-1 o-1 p-1 d

  28. What is the temporal relationship between two messages in an (H)MSC? s1 A r1 B s2 r2 Chain of messages between points A and B:Alternating sequence of send/receive events where receive and subsequent send are on same process.

  29. What kinds of diagrams do we have?Certainly not the next one. (Causal cycle)

  30. All the allowed diagrams up to symmetry (1st+11th are symmetric)

  31. Added implied orders

  32. Projections of message duration on a global time line: pp-1oo-1dd-1 o

  33. P1 P2 P3 P1 P2 P3 Cases when left (red) message is in one HMSC and right (orange) message is in later MSC Cannot have an edge from right to left! Cannot have a chain of messages from orange to red message

  34. Cases when left (red) message is in one HMSC and right (orange) message is in left MSC pp-1oo-1dd-1 p pod-1 po poo-1dd-1 opd

  35. Intuition: worst case when pp-1oo-1dd-1best case when p, pp-1oo-1dd-1 p pod-1 po Can easily determine case:Calculate transitive closure O(n2), then check the order between points. poo-1dd-1 opd

  36. Qualify the “worst” out of order messages p < o < d-1 < d < o-1 < p-1 P1 P2 P3 0 1 2 2 3 4 P1 P2 P3 Best worst Intuition: Red is assumed to appear before green. Count the number of inversions between end events of (s1,r1)(s2,r2). When equal: based on who starts first

  37. po pp-1oo-1dd-1 p pod-1 poo-1dd-1 opd For the 6 patters: based on pessimistic (worst among possibilities) order < < < < <

  38. Discord: measuring the “worst” unordering • For a pair of messages m1, m2 in HMSCpath: the worst “out of order” measure along the path. • For a pair of messages in HMSC (in different MSCs, of course): the worst discord along any path. • For an HMSC: the worst discord for any pair of messages.

  39. poo-1dd-1 Example For path M1;M2, discord is p. For path M1;M3;M1 discord is o-1 due to messages report and 2ndconnect. For M3;M4 discord is d. M2 M1 P1 P2 P3 P1 P2 P3 approve connect M3 M4 P1 P2 P3 P1 P2 P3 fail req_service report

  40. Results • Calculating a discord between messages in HMSC is in CoNP-Complete.(Reduction from 3SAT). • Calculating the discord of an HMSC is polynomial (nontrivial algorithm).

  41. Application • Write a specification. • Convert into MSC or LSC (e.g., Play in-Play out tool). • Specify essential orders between certain messages. • Check discords. • Add synchronization messages to force unachieved order or • Make objects of problematic message orders in same process. • Parallelize the system according to the constraints in 5 and 6.

  42. Visual notation have advantages over textual representation. MSCs is a standard for describing concurrent interactions. MSCs are based on partial order semantics. MSCs raise many interesting research problems, e.g., race condition. Discords allow expressing the migration order between messages. Discords can be calculated to check for violation between intuitive order and actual order in LSC,HMSC. Discords provides framework for synthesizing, then parallelizing algorithms. Conclusions

More Related