35
1 A Petri Net Siphon Based Solution to A Petri Net Siphon Based Solution to Protocol-level Service Composition Protocol-level Service Composition Mismatches Mismatches Pengcheng Xiong 1 , Mengchu Zhou 2 and Calton Pu 1 1 College of Computing, Georgia Institute of Technology 2 Department of ECE, New Jersey Institute of Technology Presented on ICWS2009 July, 2009

1 A Petri Net Siphon Based Solution to Protocol-level Service Composition Mismatches Pengcheng Xiong 1, Mengchu Zhou 2 and Calton Pu 1 1 College of Computing,

Embed Size (px)

Citation preview

1

A Petri Net Siphon Based Solution to A Petri Net Siphon Based Solution to Protocol-level Service Composition Protocol-level Service Composition

MismatchesMismatches

Pengcheng Xiong1, Mengchu Zhou2 and Calton Pu1

1College of Computing, Georgia Institute of Technology 2Department of ECE, New Jersey Institute of Technology

Presented on ICWS2009July, 2009

2

Web service compositionWeb service composition Everyone wants sEveryone wants seamless eamless

composition of Web servicescomposition of Web services What’s missing in achieving this goal What’s missing in achieving this goal

is the mismatch between invokers and is the mismatch between invokers and invokees.invokees.

Now interface mismatches have been Now interface mismatches have been well addressed while protocol mismatcwell addressed while protocol mismatches remain a challenge. hes remain a challenge.

3

A concrete exampleA concrete example

How does message deadlock happen?

How to break the message deadlock?

Customer Online shop

Test result by Oracle BPELBoth of the services are blocked

4

AgendaAgenda

Background about mismatches in web Background about mismatches in web service compositionservice composition

Related works and our contributionsRelated works and our contributions Modeling methodsModeling methods Message ordering mismatch detection Message ordering mismatch detection

and solutionand solution ConclusionConclusion

5

Mismatches in Web Service Mismatches in Web Service CompositionComposition

Interface mismatches (Mostly solved)Interface mismatches (Mostly solved) Message signature mismatches (by schema Message signature mismatches (by schema

matching-based method, information matching-based method, information retrieval techniques)retrieval techniques)

Message split/merge mismatches (by Message split/merge mismatches (by clustering-based approach)clustering-based approach)

Protocol-level mismatches (Partially Protocol-level mismatches (Partially solved)solved) Unspecified reception (by adaptor-based Unspecified reception (by adaptor-based

method)method) Message deadlock (remains a challenge)Message deadlock (remains a challenge)

message ordering mismatchesmessage ordering mismatches non-local choice mismatchesnon-local choice mismatches

6

Message deadlock Message deadlock example (1)example (1)

OrderRequest

Obtain Delivery

Pay for the Bill

End

Obtain Payment

Delivery product

End

Customer Online Shop

Start Start

OrderProcess

Make confirmation

Obtain confirmation

Order information

Confirmatoin

Payment information

Delivery information

7

Message deadlock Message deadlock example (2)example (2)

Customer Online shopTime

Result: Both of the parties are waiting for each other

orderSend

Wait for

orderReceive

Delivery info. Wait for Payment info.

CHOICE 1CHOICE 2CHOICE 3

8

Solving the problem using reachability tree based Solving the problem using reachability tree based methodmethod

Choice 1, provide delivery and Choice 1, provide delivery and payment information.payment information.

Customer Online shopTime

Delivery info.Receive

Send

Payment info.Receive

Payment info. ConfirmationWait for

Send Confirmation ConfirmationReceive

9

Solving the problem using reachability tree based Solving the problem using reachability tree based methodmethod

Choice 2, provide payment Choice 2, provide payment information.information.

Customer Online shopTime

Delivery info.Wait for Payment info.Receive

ConfirmationWait for

10

Solving the problem using reachability tree based Solving the problem using reachability tree based methodmethod

Choice 3, provide delivery Choice 3, provide delivery information.information.

Customer Online shopTime

Delivery info.Receive

Send Payment info. Payment info.Receive

Send Confirmation ConfirmationReceive

11

Limitations of reachability tree based Limitations of reachability tree based methodmethod

The cost for the construction of a reachabiThe cost for the construction of a reachability tree is exponential, i.e., O(elity tree is exponential, i.e., O(eNN)(N is the )(N is the number of nodes)number of nodes)

22k k is the number of choices (k is the numbis the number of choices (k is the number of messages)er of messages) Some choice can not solve the problem complSome choice can not solve the problem compl

etely, which needs a second interfere by progretely, which needs a second interfere by programmer, e.g., choice 2.ammer, e.g., choice 2.

Some choice is not optimal, which requires mSome choice is not optimal, which requires more information than really needed, e.g., choiore information than really needed, e.g., choice 1.ce 1.

Total cost to find the best choice is O(2Total cost to find the best choice is O(2kkeeN N ))

12

Our contributionsOur contributions We model web service composition as a special kiWe model web service composition as a special ki

nd of Petri nets in which we have a hypothesis: thnd of Petri nets in which we have a hypothesis: there is a deadlock in web service composition if anere is a deadlock in web service composition if and only if there is an empty siphon in Petri nets.d only if there is an empty siphon in Petri nets.

The cost for enumerating all the empty siphon is eThe cost for enumerating all the empty siphon is exponential, i.e., O(exponential, i.e., O(eNN)(N is the number of nodes))(N is the number of nodes)

By linear programming, we can find the optimal sBy linear programming, we can find the optimal solution. The cost for linear programming is polynolution. The cost for linear programming is polynomial.omial.

Total cost will be O(eTotal cost will be O(eNN)(N is the number of nodes))(N is the number of nodes)

13

AgendaAgenda

Background about mismatches in web Background about mismatches in web service compositionservice composition

Related works and our contributionsRelated works and our contributions Modeling methodsModeling methods Message ordering mismatch detection Message ordering mismatch detection

and solutionand solution ConclusionConclusion

14

Petri nets and Composition net (C-Petri nets and Composition net (C-net)net)

We divide the basic structuWe divide the basic structures in BPEL, i.e., res in BPEL, i.e., receive, rreceive, reply, invoke, assign, throw, eply, invoke, assign, throw, terminate, waitterminate, wait, , emptyempty and and linklink into two categories. into two categories.

The first category is internal The first category is internal control logic that includes control logic that includes assassign, terminate, wait ign, terminate, wait andand empt emptyy. We model them as internal . We model them as internal status places and transitions. status places and transitions.

The second category is externThe second category is external control logic that includes al control logic that includes receive, replyreceive, reply, , invokeinvoke,, throw throw and and linklink. we model them as tr. we model them as transitions connected with inteansitions connected with internal status places and interfarnal status places and interface places ce places

“Receive” in BPEL<receive name="Receive_Order" partnerLink="client" portType="client:OrderIn“ operation="Order" variable="Order"

createInstance="yes"/>

receive

Internal Status Places

Interface Places

15

Petri nets and modeling (1)Petri nets and modeling (1)Internal status places Interface places

receive reply and throw

sequence

… … …

switch

… …

pick

link

16

Petri nets and modeling (2)Petri nets and modeling (2)

OrderRequest

Customer

StartOrder information

1t

1p

2p

11p

Online Shop

Start

OrderProcess

Order information 11p

6t

6p

7p

1t

1p

2p

11p 6

t

6p

7p

OrderRequest

Customer

StartOrder information

1t

1p

2p

11p

Online Shop

Start

OrderProcess

Order information 11p

6t

6p

7p

1t

1p

2p

11p 6

t

6p

7p

OrderRequest

Customer

StartOrder information

1t

1p

2p

11p

Online Shop

Start

OrderProcess

Order information 11p

6t

6p

7p

1t

1p

2p

11p 6

t

6p

7p

Based on the Based on the basic structure basic structure models, we models, we model model structured structured activities in a activities in a BPEL process, BPEL process, i.e., i.e., sequence, sequence, flow, pick, flow, pick, switchswitch and and whilewhile, etc, etc. . Here Here is an example.is an example.

17

Physical SiphonPhysical Siphon A physical siphon is a continuous tube that

allows liquid to drain from a reservoir through an intermediate point that is higher, or lower, than the reservoir.

The liquid can only go from higher point to the lower point

18

Siphon in Petri netsSiphon in Petri nets A siphon of a

Petri net is defined as a set S of places such that

:the input

set of S :the output

set of S

1p

2p

3p

1t

2t

1{ }S t

1 2{ , }S t t

S S

1 2 3{ , , }S p p p

S is a siphon

1p

2p

3p

1t

2t

1 2{ , }S t t

1{ }S t

S S

1 2 3{ , , }S p p p

S is not a siphon

19

Siphon in Petri netsSiphon in Petri nets The number of tokens in a siphon will never increase

and an empty siphon will always remain empty.

1p

2p

3p

1t

2t

1p

2p

3p

1t

2t

1t fires

The number of tokens remains 2

1p

2p

3p

1t

2t

1p

2p

3p

1t

2t

Empty siphon remains empty

20

AgendaAgenda

Background about mismatches in web Background about mismatches in web service compositionservice composition

Related works and our contributionsRelated works and our contributions Modeling methodsModeling methods Message orderingMessage ordering mismatch detection mismatch detection

and solutionand solution ConclusionConclusion

21

Detecting Detecting message orderingmessage ordering mismatchmismatch (1) (1)

Theorem 1: There is a dTheorem 1: There is a dead transition in C-net iead transition in C-net if and only if there is an f and only if there is an empty siphon. empty siphon.

For example, there are For example, there are 5 minimum siphons in 5 minimum siphons in the fig, i.e., the fig, i.e., SS11={={pp1-51-5},}, S S22=={{pp6-106-10},}, S S33={={pp11,, p p3-53-5,, p p7-97-9,, p p11

11,, p p1414},}, S S44={={ p p33,, p p8-98-9,, p p1212,, p p1414},}, S S55={={ p p3-43-4,, p p99,, p p13-1413-14}. }. MM00((SS1-31-3)=1)=1 and and MM00((SS4-54-5)=0. )=0.

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

22

Non-empty siphonsNon-empty siphons

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

1S

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

2S

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

3S

23

Empty siphonsEmpty siphons

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

4S

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

5S

24

Detecting Detecting message orderingmessage ordering mismatchmismatch (2) (2)

Since there are Since there are initial empty initial empty siphons, i.e., siphons, i.e., SS44 and and SS55, there exists , there exists message ordering message ordering mismatching. This mismatching. This is true because is true because after after tt11 and and tt66 fire, fire, there is a message there is a message deadlock deadlock

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

t1 fires

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

t6 fires

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

4S

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

5S

25

Correcting message ordering Correcting message ordering mismatchmismatch

Developers provide additional information to bDevelopers provide additional information to break the message deadlock.reak the message deadlock.

Developers will have too many choices if using Developers will have too many choices if using reachability based method and some of the choireachability based method and some of the choices will lead to additional work in the future ances will lead to additional work in the future and some of them are not optimal.d some of them are not optimal.

We optimize the choices by linear programminWe optimize the choices by linear programming. g.

Deadlock happens

No deadlock

Empty siphon

No empty siphon

Construct msg.Add tokens

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

1t

5t

1p

2t

2p

3t

3p

4t

4p

8t

8p

9t

9p

10p

12p

5p

10t

11p 6

t

6p

7t

7p

14p

13p

(a) (b)

26

Linear programming to optimize choicLinear programming to optimize choices (1)es (1)

Objective: minimum number of messagesObjective: minimum number of messages Constraint: (1)the relationship between information Constraint: (1)the relationship between information

places and siphons (2) all the empty siphons markedplaces and siphons (2) all the empty siphons marked Compute the following linear programming probleCompute the following linear programming proble

m:m:Minimize Minimize 11**LLs.t. s.t. AA**L≧L≧11TT

L: A list of messages that should be provided. L: A list of messages that should be provided. A: The contribution matrix of every message to a siphA: The contribution matrix of every message to a siph

on.on.

27

Linear programming to optimize choicLinear programming to optimize choices (2)es (2)

5

4S

S

0 1 0 1

0 0 1 1

1

2

3

4

L

L

L

L

≥ 1

1

11 12 13 14 p p p p

Order

info.

Paymen

t inf

o.

Confir

mation

Delive

ry in

fo.

Minimize L1+ L2+ L3+ L4 Minimize total numbMinimize total number of msgser of msgs

Contribution matrixContribution matrix

Every empty siphon Every empty siphon is marked nowis marked now

SS44={={ p p33,, p p8-98-9,, pp1212,, p p1414},},

SS55={={ p p3-43-4,, p p99,, pp13-1413-14}}

28

ChoicesChoices Choice 1: Provide both the delivery Choice 1: Provide both the delivery

information and the payment information and the payment information. information. LL11=(0,1,0,1)=(0,1,0,1)TT

Choice 2: Provide the payment Choice 2: Provide the payment information. information. LL22=(0,1,0,0)=(0,1,0,0)TT

Choice 3: Provide the delivery Choice 3: Provide the delivery information. information. LL33=(0,0,0,1)=(0,0,0,1)T T (Solution (Solution of linear programming)of linear programming)

29

Choice 1: provide both info.Choice 1: provide both info. LL11=(0,1,0,1)=(0,1,0,1)TT. It is a feasible solution of the . It is a feasible solution of the

linear programming, but not an optimal linear programming, but not an optimal solution.solution.

5

4S

S

0 1 0 1

0 0 1 1

0

1

0

1

= 2

1

11 12 13 14 p p p p

Order

info.

Paymen

t inf

o.

Confir

mation

Delive

ry in

fo.

L1+ L2+ L3+ L4=2

30

Choice 2: provide only payment inChoice 2: provide only payment info.fo.

LL22=(0,1,0,0)=(0,1,0,0)TT. It is NOT a feasible solution of the . It is NOT a feasible solution of the linear programming. Because linear programming. Because AA**L’L’=(1,0)=(1,0)TT, , although although SS44 is marked, is marked, SS55 is still empty. is still empty.

5

4S

S

0 1 0 1

0 0 1 1

0

1

0

0

= 1

0

11 12 13 14 p p p p

Order

info.

Paymen

t inf

o.

Confir

mation

Delive

ry in

fo.

L1+ L2+ L3+ L4=1

31

Choice 3: provide only delivery infChoice 3: provide only delivery info.o.

LL33=(0,0,0,1)=(0,0,0,1)TT. It is the optimal solution of . It is the optimal solution of the linear programming. the linear programming.

5

4S

S

0 1 0 1

0 0 1 1

0

0

0

1

= 1

1

11 12 13 14 p p p p

Order

info.

Paymen

t inf

o.

Confir

mation

Delive

ry in

fo.

L1+ L2+ L3+ L4=1

32

Local choice mismatch Local choice mismatch solutionsolution

Different from the message ordering Different from the message ordering mismatch where there are initial empty mismatch where there are initial empty siphons, there are no initial empty siphons, there are no initial empty siphons in local choice mismatch. But siphons in local choice mismatch. But some of the siphons may lose their some of the siphons may lose their tokens if some transitions fire. tokens if some transitions fire.

We propose a method based on We propose a method based on additional information channels in [6] to additional information channels in [6] to hold the tokens in siphons such that hold the tokens in siphons such that every siphon is always marked. every siphon is always marked.

33

AgendaAgenda

Background about mismatches in web Background about mismatches in web service compositionservice composition

Related works and our contributionsRelated works and our contributions Modeling methodsModeling methods Message ordering mismatch detection Message ordering mismatch detection

and resolutionand resolution ConclusionConclusion

34

ConclusionConclusion Although the existing studies can analyze the Although the existing studies can analyze the

mismatch problems at the interface and protomismatch problems at the interface and protocol levels based on reachability analysis, they col levels based on reachability analysis, they do not provide a direct solution. do not provide a direct solution.

The main contribution of this paper is to propThe main contribution of this paper is to propose a siphon-based analysis technique that yieose a siphon-based analysis technique that yields a variant of component service without milds a variant of component service without mismatches. Without checking the state space, osmatches. Without checking the state space, our approach provides an optimized and also aur approach provides an optimized and also automatic solution for correcting protocol-misutomatic solution for correcting protocol-mismatches. This approach greatly reduces the amatches. This approach greatly reduces the amount of interactions with developers. mount of interactions with developers.

35

Thank you!Thank you!