analysis of a biphase mark protocol with uppaal and pvs
play

Analysis of a Biphase Mark Protocol with Uppaal and PVS Frits - PowerPoint PPT Presentation

Analysis of a Biphase Mark Protocol with Uppaal and PVS Frits Vaandrager and Adriaan de Groot Nijmegen Institute for Computing and Information Sciences Biphase Mark Protocol Convention for representing both a string of bits and clock edges in


  1. Analysis of a Biphase Mark Protocol with Uppaal and PVS Frits Vaandrager and Adriaan de Groot Nijmegen Institute for Computing and Information Sciences

  2. Biphase Mark Protocol Convention for representing both a string of bits and clock edges in a square wave. Used, for instance, in: 1. Intel 82530 Serial Communications Controller 2. Ethernet 3. Optical communications 4. Satellite telemetry applications 5. · · ·

  3. Biphase Mark Protocol (cnt) 1 0 0 0 1 1 message cell cell edges signals sent mark subcell code subcell sampling distance if these two signals are if these two signals are equal, a 0 was sent different, a 1 was sent

  4. Challenges 1. During some time after the sender generates an edge, reading may produce any value. 2. Receiver samples wire nondeterministically at some point during each clock cyle. 3. Clock drift and jitter.

  5. Overview of Uppaal Model Clock s Clock2 tick tock Coder Wire Sampler Decoder edge in w new out get put Tester

  6. Variables and Constants in Uppaal Model (instance) chan get, put, edge, tick, tock; int m, n; int[0,1] in, out, v, w, new, old, buf; clock x, y, z; const cell 32; const mark 16; const sample 23; const min 81; const max 100; const edgelength 81;

  7. Clock tick! X0 x >= min x := 0 x <= max

  8. Coder tick? n < cell - 1 n := n+1 C0 C3 tick? n == cell - 1 n := 0 edge! get? C4 edge! tick? in == 0 n == mark - 1 n := n+1 C2 C1 edge! in == 1 tick? n < mark - 1 n := n+1

  9. Wire edge? z := 0, W2 edge? v := 1 - v W0 W1 z <= edgelength settle! fuzz! z == edgelength w := 1 - w w := v

  10. Sampler s == 0 Sample! new := w, s := 1

  11. Decoder Clock y >=min && s==1 y <= max tock! y := 0, s := 0

  12. Decoder tock? tock? new == old m < sample - 1 m := m+1 tock? D1 D0 new != old old := new tock? m == sample - 1 put! out := (new != old), m := 0 m := m + 1, old := new D2

  13. Tester put? put? out == in out == buf get! get! buf := in, in := 0 in := 0 get! get! get! T0 T1 T2 T3 in := 1 buf := in, in := 1 put? put? put? out != in out != buf Error

  14. Requirements for Correctness Receiver detects edge at begin cell mark · min > 2 · max + edgelength Receiver does not sample too early ( sample − 1) · min > mark · max + edgelength Receiver does not sample too late cell · min > ( sample + 2) · max + edgelength

  15. Receiver misses edge at begin cell Coder start transmission of 1 Coder completes mark phase maximally fast mark * min v w edgelength new max max Sampler samples at very end long clock cycle Sampling at very beginning long clock cycle

  16. Receiver samples too early Coder starts transmission of 1 Coder completes mark phase maximally slow mark * max edgelength v w (sample - 1) * min min new Decoder receives 0 High voltage sampled at beginning clock cycle Sampling at end of cycle, right after edge is generated

  17. Receiver samples too late Coder start transmission of 0 Coder completes transmission maximally fast cell * min v w edgelength new max max sample * max Sampling at very end of cycle, 1 received Decoder detects edge Sampling at very beginning clock cycle

  18. Main result The Error state cannot be reached if and only if the three stated inequalities hold for the parameters. Proof Manual proof, formalized with PVS. Several instances of the 3 coun- terexamples and 36 auxiliary invariants (including 15 trivial ones) have been found resp. checked using Uppaal. Example of invariant that Uppaal cannot handle in general: C2 ∨ ( C3 ∧ in = 0) n · min ≤ z − x ≤ n · max ⇒

  19. Relative Time We assume 0 < min ≤ max and define min = ρ max edgelength = E max

  20. Requirements for Correctness (rephrased) Receiver detects edge at begin cell mark · ρ 2 + E > Receiver does not sample too early ( sample − 1) · ρ mark + E > Receiver does not sample too late sample + 2 + E cell · ρ >

  21. Maximal Tolerance on Timing sample − 1 , sample +2+ E max( 2+ E mark + E ) ρ > mark , cell Example Configurations with E = 1 cell 16 32 18 mark 8 16 5 sample 11 23 10 0.91 0.82 0.73 ρ

  22. Physical Clocks Typical clocks used in hardware are incorrect by less than 15 . 10 − 6 seconds per second. Thus, in practice, 1 − 15 . 10 − 6 1 + 15 . 10 − 6 ≈ 0 . 99997 ρ ≥

  23. Minimizing Cell Size Assume ρ = 1 and E = 1. Then we derive mark 3 > > mark + 2 sample > sample + 3 cell Hence, values of parameters are at least mark = 4 sample = 7 cell = 11 If we require cell = 2 · mark then minimal values are mark = 7 sample = 10 cell = 14

  24. Related Work Moore (’94) Verification of few instances with Boyer-Moore theorem prover. Derived timing bounds not optimal. No clock jitter, E = 1. Ivanov & Griffioen (’98) Automatic verification of few instances with HyTech. Polling only at the end of a read cycle. Van Hung (’96, ’98) Full parameter analysis with PVS + Duration Calculus. Debatable modelling assumptions. No clock jitter. Bensalem et al (’00) & Henzinger et al (’01) Partial success in proving parameter constraints automatically.

  25. Conclusions (cf Moore) 1. We offer our model primarily as a catalyst for thought. Model says certain instances will work. Will they? 2. We ignore various engineering realities: metastability, reflection, noise, and distortion, etc. 3. Uppaal very helpful in model construction, and for gaining insight. Model checking essential for analysis of additional features, such as termination and bus collisions. 4. PVS essential for handling parameter constraints in full generality.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend