Verification of Communication Protocols with Messages Carrying - - PowerPoint PPT Presentation

verification of communication protocols with messages
SMART_READER_LITE
LIVE PREVIEW

Verification of Communication Protocols with Messages Carrying - - PowerPoint PPT Presentation

ASYNCHRON 2006 Verification of Communication Protocols with Messages Carrying Values Tristan Le Gall joint work with Bertrand Jeannet and Thierry J eron Vertecs team IRISA/INRIA Rennes page 1 Comunication protocols Communication


slide-1
SLIDE 1

page 1

ASYNCHRON 2006

Verification of Communication Protocols with Messages Carrying Values

Tristan Le Gall joint work with Bertrand Jeannet and Thierry J´ eron Vertecs team IRISA/INRIA Rennes

slide-2
SLIDE 2

page 2

Comunication protocols

  • Communication protocols are widely used with the developpement of the internet and
  • ther networks.
  • Formal verification uses models like Messages Sequence Charts(MSCs), Communi-

cating Finite-State Machines(CFSMs)

  • Our goal : the verification of protocols modeled by an extention of CFSM, using the

abstract interpretation framework.

  • This work can be applied to process/components of a systems using queues or large

buffers, Kahn networks, etc.

slide-3
SLIDE 3

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes

slide-4
SLIDE 4

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes C = {(0, 0), (1, 0), (0, 1), (1, 1)}

slide-5
SLIDE 5

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes Σ = {open, close} ∪ {disconnect}

slide-6
SLIDE 6

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes initial location c0 = (0, 0)

slide-7
SLIDE 7

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes An input : 1?o

slide-8
SLIDE 8

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes An output : 1!o

slide-9
SLIDE 9

page 3

The CFSM model 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server 0,0 1,0 0,1 1,1 2!d 1?c 2?d1!c 2?d 1!c 2!d 1?c 1!o 1?o 1?o 1!o (d) Global CFSM: product of client and server processes A state of the CFSM : a location + contents of all queues

slide-10
SLIDE 10

page 4

Problematics

  • Verification of safety properties
  • Main issue : reachability analysis
  • Undecidable in the general case
  • Our solution : compute an over-approximation of the reachability set
slide-11
SLIDE 11

page 5

Outline

  • Introduction : model and problematics
  • Verification of CFSM
  • Limitations and new model
  • Representation of queues with messages carrying values
  • Application to the verification of symbolic CFSM
  • Conclusion
slide-12
SLIDE 12

page 6

CFSM with a single queue

  • Σ : alphabet of messages
  • a content of a queue : a word w ∈ Σ∗
  • C → L(Σ∗)
  • Operational semantics in terms of operations on languages :

(c1, L)

c1,!a,c2

− → (c2, L.a)

  • Reachability analysis : a fixpoint equation

?a !a a a a

  • Fixpoint equation L = ε ∪ L.a ∪ L/a
  • Solution : L = a∗
slide-13
SLIDE 13

page 7

Abstraction

  • Main idea : work with regular over-approximations of the content of the queue
  • See the regular languages as an abstract lattice (Reg(Σ), ⊆)
  • Compute an over-approximation of the least fix-point with iterations

L0 = ε Li+1 = Li ∪ Li.a ∪ Li/a

  • Use a widening operator so that the computation terminates
slide-14
SLIDE 14

page 8

Widening operator for regular languages(1)

  • Working on the Minimal Deterministic Automaton (MDA) ML
  • Quotient automaton

ML = ML/ ≃k (fusion of states)

a a a b a a a b a b a a

  • ≃k : auto-bisimilarity of depth k
  • ρk(L) : language recognized by this quotient automaton
slide-15
SLIDE 15

page 9

Widening operator for regular languages(2)

  • Widening operator L1∇kL2

= ρk(L1 ∪ L2)

  • The following computation terminates and gives an over-approximation of the reach-

ability set: L0 = ε Li+1 = Li ∇k( Li.a ∪ Li/a)

  • Result : L∞ = a∗
slide-16
SLIDE 16

page 10

Connexion/deconnexion protocol 1 1!open 1!close 2?disconnect close open disconnect 1 1?open 1?close 2!disconnect (a) Client (b) Queues (c) Server

  • The client can open and close a cession, or be forced to close the session if a disconnect

message is received

  • The serveur can ask for a client to terminate his session
slide-17
SLIDE 17

page 11

Analysis of the connexion/deconnexion Protocol

Analysis with dependance Analysis without dependance Client/ Queue 1 # Queue 2 Server 0/0 (co)∗(oc)∗#ε + c(oc)∗#d 1/0 (co)∗(oc)∗o#ε + (co)∗#d 0/1 c(oc)∗#ε 1/1 (co)∗#ε Client/ Queue 1 Queue 2 Server 0/0

  • ∗ + (o∗c)+(ε + o+ + o+c)

d∗ 1/0 (o∗c)∗o+ d∗ 0/1

  • ∗ + (o∗c)+(ε + o+ + o+c)

d∗ 1/1

  • + + o∗(co+)+

d∗

  • Analysing the queues alltogether gives the exact result
  • Analysing each queue independently gives a very bad approximation
slide-18
SLIDE 18

page 12

Protocol with non-regular reachability set 1 2 1!a 2!b 4?d 1 2 2?b 3!c 4!d

  • The reachability set is non-regular
  • Exact result : L(0/0) = an♯ε♯cn♯ε
  • Relational analysis result :

L(0/0) = ε♯ε♯ε♯ε + a♯ε♯c♯ε + aaa∗♯ε♯ccc∗♯ε

slide-19
SLIDE 19

page 13

Outline

  • Introduction : model and problematics
  • Verification of CFSM
  • Limitations and new model
  • Representation of queues with messages carrying values
  • Application to the verification of symbolic CFSM
  • Conclusion
slide-20
SLIDE 20

page 14

Already finished ?

  • The analysis terminates and return an over-approximation of the reachability set
  • The approximations of the queue contents are quite precise
  • We defined an abstract lattice for regular languages
  • But the model is not expressive enough
slide-21
SLIDE 21

page 15

Sliding window protocols

Data(S) Ack(R,list) A S MS R MR

Sender Receiver

H

Can we check the (in)equations : – A ≤ R – S ≥ H – MR − R = MS − A

slide-22
SLIDE 22

page 16

What shall we do ?

  • Do not care about real protocols
  • Add variables and parameters to the CFSM model and use a similar method on the

new model.

slide-23
SLIDE 23

page 17

New Model : Symbolic CFSM p=x !a(p) x := x+1 true ?a(p) y := p Each transition has

  • a guard : predicate on the value of the variables and the parameter
  • a comunication action with a parameter p : emission !a(p) or reception ?a(p)
  • an affectation : gives the new value of the variables
slide-24
SLIDE 24

page 18

Example of analysis p=x !a(p) x := x+1

  • Toy example : the producer
  • Non-relational analysis : does not keep relation between the value of x and the values
  • f the messages
  • Relational analysis : keep relation between the value of x and the values of the

messages

slide-25
SLIDE 25

page 19

Non-relational analysis Computation step Set of reachable states init [0, 0] × ε step 1 [0, 1] × a([0, 0]) step 2 [0, 2] × a([0, 0]) + a([0, 0]).a([0, 1]) step 3 [0, 3] × a([0, 0]) + a([0, 0]).a([0, 1]) + a([0, 0]).a([0, 1]).a([0, 2]) step4* [0, +∞[ × a([0, 1]) + a([0, 1]). (a([0, +∞[))∗ We lose the relation p ≤ x.

slide-26
SLIDE 26

page 20

Relational analysis

Computation step Set of reachable states init {0 ≤ x ≤ 0}∧ ε step 1 {0 ≤ x ≤ 1}∧ a({0 ≤ p = x − 1}) step 2 {0 ≤ x ≤ 2}∧ a({0 ≤ p = x − 1}) + a({0 ≤ p = x − 2}).a({0 ≤ p = x − 1}) step 3 {0 ≤ x ≤ 3}∧ a({0 ≤ p = x − 1})+ +a({0 ≤ p = x − 2}).a({0 ≤ p = x − 1})+ +a({0 ≤ p = x − 3}).a({0 ≤ p = x − 2}).a({0 ≤ p = x − 1}) step 4* {0 ≤ x} a({0 ≤ p ≤ x − 1})+ +a({0 ≤ p ≤ x − 1}). (a({0 ≤ p ≤ x − 1}))∗

slide-27
SLIDE 27

page 21

New abstractions In both cases we need :

  • Abstractions for the values of the variables : intervals, polyhedra,...
  • Representation of languages on the infinite alphabet Σ × Ω
  • Automata “with a lattice feature”
slide-28
SLIDE 28

page 22

Outline

  • Introduction : model and problematics
  • Verification of CFSM
  • Limitations and new model
  • Representation of queues with messages carrying values
  • Application to the verification of symbolic CFSM
  • Conclusion
slide-29
SLIDE 29

page 23

Lattice structure

  • (Ω, ⊑Ω) an abstract lattice (abstract values of the parameter)
  • Σ = {a1, . . . , an} finite alphabet of messages
  • Λ = Σ × Ω the lattice with

(a1, P1) ⊑ (a2, P2) ⇔ a1 = a2 ∧ P1 ⊑Ω P2

  • Example : lattice : Λ = Σ × I ; value: a([0, +∞[)
slide-30
SLIDE 30

page 24

Lattice automaton

  • Finite automaton with transitions labeled by λ ∈ Σ × Ω

a([2,3]) b([1,3]) c([0,0]) b([0,0]) a([0,0]) a([0,4]) a([4,8]) c([4,8])

  • q1

λ

− → q2 if

  • 1. λ = ⊥
  • 2. there is a transition (q1, λ′, q2) in the automaton with λ ⊑ λ′
  • Accepted words : as for classical finite automata.
  • Reg(Λ) : languages recognized by a lattice automaton
slide-31
SLIDE 31

page 25

Algorithms for lattice automata

  • Union : as for classical finite automata
  • Intersection :

a([0,3]) b([2,5]) a([2,5]) a([2,3])

  • Inclusion : simulation taking into account the lattice structure
  • Determinisation, minimisation, quotient of A: use Shape(A)

a([2,3]) b([1,3]) c([0,0]) b([0,0]) a([0,0]) a([0,4]) a([4,8]) c([4,8])

slide-32
SLIDE 32

page 25

Algorithms for lattice automata

  • Union : as for classical finite automata
  • Intersection :

a([0,3]) b([2,5]) a([2,5]) a([2,3])

  • Inclusion : simulation taking into account the lattice structure
  • Determinisation, minimisation, quotient of A: use Shape(A)

a b c b a a a c

slide-33
SLIDE 33

page 26

Determinisation of lattice automata Idea of the algorithm :

1 2 1,2 a([0,2]) a([3,5]) a([0,5])

A a no-deterministic lattice automaton. We get A′ :

  • Shape(A′) is deterministic (so is A′)
  • A′ is an over-approximation of A :

LA ⊆ LA′

  • A′ is the best approximation :

∀B such as Shape(B) is deterministic and LA ⊆ LB, then LA′ ⊆ LB

slide-34
SLIDE 34

page 27

Quotient and minimisation Same principle as before

1 4 a([0,5]) 1 3 a([0,2]) a([3,5]) 1,3 2,4

L recognized by A. There exists an unique A′ :

  • Shape(A′) is deterministic and minimal(so is A′)
  • A′ is an over-approximation of A :

LA ⊆ LA′

  • A′ is the best approximation :

∀B such as Shape(B) is deterministic and minimal, and LA ⊆ LB, then LA′ ⊆ LB

slide-35
SLIDE 35

page 28

Widening operator If LA1 ⊆ LA2 :

  • 1. consider the quotient automaton A2/ ≃k
  • 2. If A1 and A2/ ≃k have the same shape :

b([2,4]) a([2,4])

b([0,4]) a([2,7]) b([−∞, 4]) a([2, +∞])

slide-36
SLIDE 36

page 29

Outline

  • Introduction : model and problematics
  • Verification of CFSM
  • Limitations and new model
  • Representation of queues with messages carrying values
  • Application to the verification of symbolic CFSM
  • Conclusion
slide-37
SLIDE 37

page 30

Non-relational analysis : the lattice of intervalls

  • The value of each variable is represented by an interval
  • Lattice automata on Λ = Σ × I
  • Abstract semantics :

p=x !a(p) x:=x+1

x queue [0, 2] a([0, 1]) − → x queue [1, 3] a([0, 1]).a([0, 2])

slide-38
SLIDE 38

page 31

Relational analysis : the lattice of polyhedra

  • The value of the varaibles are represented by a polyhedron
  • Lattice automata on Λ = Σ × P
  • Abstract semantics :

p=x !a(p) x:=x+1

x queue {0 ≤ x ≤ 2} a({0 ≤ p = x − 1}) − → x queue {1 ≤ x ≤ 3} a({0 ≤ p = x − 2}).a({0 ≤ p = x − 1})

  • The lattice automaton is modified each time the value of x changes
slide-39
SLIDE 39

page 32

Conclusion and ongoing works

  • Sumary of results

− Approximate analysis of protocols using mesaages carying values − Definition of a kind of automata dealing with infinite alphabets

  • Ongoing work

− Implementation of these algorithms − Experimentations − A new version of NBAC ?