1 / 37

Modeling Clock Synchronization in the Chess gMAC WSN Protocol Mathijs Schuts Feng Zhu Faranak Heidarian Julien S

Modeling Clock Synchronization in the Chess gMAC WSN Protocol Mathijs Schuts Feng Zhu Faranak Heidarian Julien Schmaltz Frits Vaandrager. QFM’09 FM’09. Plan. Intro to WSN and Chess case study A first model + analysis A second model + counterexamples Conclusions & Future Work.

sukey
Download Presentation

Modeling Clock Synchronization in the Chess gMAC WSN Protocol Mathijs Schuts Feng Zhu Faranak Heidarian Julien S

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. Modeling Clock Synchronization in the Chess gMAC WSN ProtocolMathijsSchutsFeng Zhu FaranakHeidarianJulien Schmaltz Frits Vaandrager QFM’09 FM’09

  2. Plan • Intro to WSN and Chess case study • A first model + analysis • A second model + counterexamples • Conclusions & Future Work

  3. WSN – butwith a twist! • Mainchallenges: • Energy efficiency (batteryoperatedorenergyharvesting → lifetime) • Robustness (RF spectrum is extremelynoisy, verybusy and unreliable) • Scalability (101 – 102 – 103 – 104 – 105nodeswith a single protocol) • Self-adaptable (constantlychangingnetworktopology, density, mobility) • Limited resources (CPU processing speed, availablememory, fysicalsize) • There are manyavailable WSN protocols, e.g.: • Wifi • Bluetooth • Zigbee • Z-wave • … • Neither of these technologiesaddresses all challenges!

  4. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  5. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  6. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  7. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  8. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  9. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  10. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  11. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  12. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  13. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  14. WSN – butwith a twist! • Communicationinspiredonbiology and humaninteraction • Epidemiccommunication • Analogy: spreading arumoror a virus • MYRIANED “GOSSIP” protocol • RF broadcast (2.4 Ghz ISM)

  15. Properties of GOSSIP In a nutshell: • Flooding provides robustness • Localcachingprevents overhead • Absense of routing provides scalability • Inherentlyself-configuring • Supports node mobility • Automaticadoption to networkdensity Butwhataboutenergy efficiency?

  16. RF TRANCEIVER (NORDIC SEMI) CPU (ATMEL XMEGA128) RF ANTENNA I/O INTERFACES

  17. Case Study for EU Quasimodo Project Model and analyze Chess WSN, based on • informal specification in deliverable • discussions with experts

  18. Our Focus: Clock Synchronization Time is considered as a sequence of Time Frames. A Time Frame A time frame is composed of a fixed number (C) of Time Slots. tsn RX TX RX idle idle idle idle In a time slot the hardware clock of the sensor node ticks a fixed number (k0) of times.

  19. Goal: Minimalize Energy Consumption TX Time Slot Guard Time Guard Time RX Time Slot

  20. Uppaal Model FM’09 A Wireless Sensor Node Clock Synchronizer

  21. Results FM’09 Paper • Full parametric analysis for clique networks • Parameter constraints found using Uppaal • Proof fully checked using Isabelle/Hol (> 5000 lines) • Correctness also studied for line topologies

  22. Results FM’09 Paper • Full parametric analysis for clique networks • Parameter constraints found using Uppaal • Proof fully checked using Isabelle/Hol (> 5000 lines) • Correctness also studied for line topologies • Model does not correspond to Chess implementation!

  23. HowCurrentImplementation Works • Clocksonlysynchronizedonce per frame • Implementationcomputesmedian of phaseerrors of all messagesreceived in frame • Offset = median * gain • Radio switching time is relevant

  24. Structure of Uppaal Model

  25. Clock

  26. Sender

  27. Receiver

  28. Controller

  29. Synchronizer

  30. compute_phase_correction() if (number of received messages == 0) offset = 0; else if (number of received messages <= 2) offset = the phase error of the first received message * gain; else offset = the median of all phase errors * gain

  31. Invariants for Correctness “Whenever I send all my neighbors listen” INV1 : A[] forall (i: Nodes) forall (j : Nodes) SENDER(i).Sending && neighbor(i,j)imply RECEIVER(j).Receiving “My neighbors never send simultaneously” INV2 : A[] forall (i:Nodes) forall (j:Nodes) forall (k:Nodes) SENDER(i).Sending && neighbor(i,k) && SENDER(j).Sending && neighbor(j,k) imply i == j “There’s no deadlock” INV3 : A[] not deadlock

  32. CounterexamplefoundbyUppaal

  33. Protocol fails for any network that contains 2 clans! Server Watershed Sensor field Gateway Internet Fastnodes Slow nodes

  34. Challenge: Fix the Problem • Assegei (2008) proposeduse of Kalman filter instead of medianalgorithm • Our FM2009 algorithm, possiblywithgain factor • Algorithm of Lenzen, Lochen & Wattenhofer (2008) • Adaptation of algorithmPussente & Barbosa (2009) Itshouldbe easy to adaptourUppaal model

  35. Challenge: Probabilities • Probabilistic model of message loss • Probabilisticalgorithmsfor (dynamic) slot allocation • Probabilisticleaving/joining of nodes/networks • Probabilisticalgorithmsforgossiping • … Key design issue: independence of layers?!?!!

  36. Conclusions • Our contribution: Uppaal model of clock synchronization in Chess WSN; bug found • Never trust your model! • Close interaction between designers and modellers essential • Model checking useful, even if one can only handle trivial instances • Models are imperfect approximations of reality!! (“Physicists approach to modeling”) • Simulation and testing also essential

  37. Questions?

More Related