CIS 540 Principles of Embedded Computation Spring 2015 Instructor: Rajeev Alur

Slides:



Advertisements
Similar presentations
Costas Busch Louisiana State University CCW08. Becomes an issue when designing algorithms The output of the algorithms may affect the energy efficiency.
Advertisements

1 Routing Protocols I. 2 Routing Recall: There are two parts to routing IP packets: 1. How to pass a packet from an input interface to the output interface.
An Adaptive Compulsory Protocol for Basic Communication in Ad-hoc Mobile Networks Ioannis Chatzigiannakis Sotiris Nikoletseas April 2002.
Chapter 13 Leader Election. Breaking the symmetry in system Similar to distributed mutual exclusion problems, the first process to enter the CS can be.
Distributed Leader Election Algorithms in Synchronous Ring Networks
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Lecture 8: Asynchronous Network Algorithms
Chapter 4 Distributed Bellman-Ford Routing
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Chapter 15 Basic Asynchronous Network Algorithms
Jaroslaw Kutylowski 1 HEINZ NIXDORF INSTITUTE University of Paderborn Algorithms and Complexity Reliable Broadcasting without Collision Detection… … in.
6.852: Distributed Algorithms Spring, 2008 Class 7.
Lecture 7: Synchronous Network Algorithms
Lecture 4: Elections, Reset Anish Arora CSE 763 Notes include material from Dr. Jeff Brumfield.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Failure Detectors. Can we do anything in asynchronous systems? Reliable broadcast –Process j sends a message m to all processes in the system –Requirement:
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Information Dissemination in Highly Dynamic Graphs Regina O’Dell Roger Wattenhofer.
1 Complexity of Network Synchronization Raeda Naamnieh.
Distributed Systems Spring 2009
CS 582 / CMPE 481 Distributed Systems
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 3 – Distributed Systems.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
Performance Comparison of Existing Leader Election Algorithms for Dynamic Networks Mobile Ad Hoc (Dynamic) Networks: Collection of potentially mobile computing.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
Chapter Resynchsonous Stabilizer Chapter 5.1 Resynchsonous Stabilizer Self-Stabilization Shlomi Dolev MIT Press, 2000 Draft of Jan 2004, Shlomi.
Efficient Algorithms to Implement Failure Detectors and Solve Consensus in Distributed Systems Mikel Larrea Departamento de Arquitectura y Tecnología de.
Composition Model and its code. bound:=bound+1.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 8: Bridging Slides used with permissions.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Introduction Distributed Algorithms for Multi-Agent Networks Instructor: K. Sinan YILDIRIM.
Instructor: Rajeev Alur
Leader Election Algorithms for Mobile Ad Hoc Networks Presented by: Joseph Gunawan.
Why do we need models? There are many dimensions of variability in distributed systems. Examples: interprocess communication mechanisms, failure classes,
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CSCI 465 D ata Communications and Networks Lecture 15 Martin van Bommel CSCI 465 Data Communications & Networks 1.
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 8 Instructor: Haifeng YU.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 February 10, 2005 Session 9.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
DISTRIBUTED SYSTEMS II A POLYNOMIAL LOCAL SOLUTION TO MUTUAL EXCLUSION Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Agenda Fail Stop Processors –Problem Definition –Implementation with reliable stable storage –Implementation without reliable stable storage Failure Detection.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Computer Communication & Networks Lecture 21 Network Layer: Delivery, Forwarding, Routing Waleed.
Routing Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific Institute of Information.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
Hwajung Lee.  Models are simple abstractions that help understand the variability -- abstractions that preserve the essential features, but hide the.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Eventual Leader Election in Evolving Mobile Networks Luciana Arantes 1, Fabiola Greve 2, Véronique Simon 1, and Pierre Sens 1 1 Université de Paris 6.
5: DataLink Layer 5a-1 Bridges and spanning tree protocol Reference: Mainly Peterson-Davie.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Chapter 4: Internetworking (IP Routing) Dr. Rocky K. C. Chang 16 March 2004.
Spring Routing: Part I Section 4.2 Outline Algorithms Scalability.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Network Layer COMPUTER NETWORKS Networking Standards (Network LAYER)
Network Layer.
Lecture 9: Asynchronous Network Algorithms
Autonomous Cyber-Physical Systems: Synchronous Components: II
Spring CS 599. Instructor: Jyo Deshmukh
The Network Layer Network Layer Design Issues:
Lecture 8: Synchronous Network Algorithms
Distributed systems Consensus
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur

Bottom-Up Design  Design basic components  Compose existing components in block-diagrams to build new components  Maintain a library of components, and try to reuse at every step  Canonical example: Synchronous circuits CIS 540 Spring 2015; Lecture Feb 2

Combinational Circuits bool in out := ~ in bool out SyncNot inout awaits in SyncNot bool in1 out := in1 & in2 bool out SyncAnd bool in2 in1 out awaits in1, in2 SyncAnd in2 CIS 540 Spring 2015; Lecture Feb 2

Design OR gate in1 out awaits in1, in2 SyncOr in2 CIS 540 Spring 2015; Lecture Feb 2

Synchronous Latch Latch reset=1 -> x:=0 set=1 -> x:=1 (set=0 & reset=0) ? set reset out out := x A1: x -> out A2: x,set,reset -> x bool x := choose {0, 1} Deterministic? Input-enabled? CIS 540 Spring 2015; Lecture Feb 2

Designing Counter Circuit (1)  Are await-dependencies acyclic? 1BitCounter CIS 540 Spring 2015; Lecture Feb 2

Designing Counter Circuit (2) 3BitCounter CIS 540 Spring 2015; Lecture Feb 2

Top-Down Design  Starting point: Inputs and outputs of desired design C  Models/assumptions about the environment in which C operates  Informal/formal description of desired behavior of C  Example: Cruise Controller CIS 540 Spring 2015; Lecture Feb 2

CruiseController event second Driver event cruise event inc event dec ClockSensor event rotate Display nat speedevent(nat) cruiseSpeed ThrottleController event(real) F Top-Down Design of a Cruise Controller CIS 540 Spring 2015; Lecture Feb 2

Decomposing CruiseController CIS 540 Spring 2015; Lecture Feb 2

Tracking Speed  Inputs: Events rotate and second  Output: current speed  Computes the number of rotate events per second (see notes) event rotate nat speed MeasureSpeed event second CIS 540 Spring 2015; Lecture Feb 2

Tracking Cruise Settings  Inputs from the driver: Commands to turn the cruise-control on/off and to increment/decrement desired cruising speed from driver  Input: Current speed  Output: Desired cruising speed  What assumptions can we make about simultaneity of events?  Should we include safety checks to keep desired speed within bounds? event cruise event(nat) cruiseSpeed SetSpeed nat speed event inc event dec CIS 540 Spring 2015; Lecture Feb 2

Controlling Speed  Inputs: Actual speed and desired speed  Output: Pressure on the throttle  Goal: Make actual speed equal to the desired speed (while maintaining key physical properties such as stability)  Design relies on theory of dynamical systems (Chapter 6) nat speed event(real) F ControlSpeed event(nat) cruiseSpeed CIS 540 Spring 2015; Lecture Feb 2

Synchronous Networks  Time divided into slots, with all nodes synchronized  In one round, each node can get a message from each neighbor  Design abstraction for simplicity  Some implementation platforms directly support such a “time- triggered” network: WirelessHART (control), CAN (automotive) 1853 CIS 540 Spring 2015; Lecture Feb 2

Modeling Synchronous Networks  Assume: Each link is directed and connects two nodes  Alternative: Broadcast communication (everyone can listen)  Assume: Communication is reliable  Alternative: Messages may be lost, collisions in broadcast  Network is a directed graph  Each link can carry one message in each slot 1853 CIS 540 Spring 2015; Lecture Feb 2

Component for a network node  A node does not know network topology  Each node has unique identifier, myID  Does not know which nodes it is connected to  Useful for “network identification” problems  Interface for each node  Output is an event carrying msg (may be absent is some rounds)  Input is a set of messages (delivered by the network)  Output should not await input set(msg) in nat id := myID event(msg) out NetworkNode CIS 540 Spring 2015; Lecture Feb 2

Modeling Synchronous Networks  Description of each node does not depend on the network  Network itself is modeled as a synchronous component  Description of Network depends on the network graph  Input variables: for each node n, out n of type event(msg)  Output variables: for each node n, in n of type set(msg)  Network is a combinational component (simply routes messages) CIS 540 Spring 2015; Lecture Feb 2

set(msg) in5 nat id := 5 event(msg) out5 set(msg) in1 nat id := 1 event(msg) out1 set(msg) in3 nat id := 3 event(msg) out3 set(msg) in8 nat id := 8 event(msg) out8 Network CIS 540 Spring 2015; Lecture Feb 2

set(msg) in5 event(msg) out5 set(msg) in1 event(msg) out1 set(msg) in3 event(msg) out3 set(msg) in8 event(msg) out8 Network  Value of in1 should equal the set of messages sent on links incoming to node 1  Sample code: in1 := EmptySet; if out5? then Insert(out5,in1); if out8? Then Insert(out8,in1);  Update of in5, in3, in8 similar CIS 540 Spring 2015; Lecture Feb 2

Leader Election  Classical coordination problem: Elect a unique node as a leader  Exchange messages to find out which nodes are in network  Output the decision using the variable status  Requirements 1.Eventually every node sets status to either leader or follower 2.Only one node sets status to leader set(msg) in nat id := myID NetworkNode event(msg) out {unknown, leader, follower} status CIS 540 Spring 2015; Lecture Feb 2

Leader Election: Flooding Algorithm  Goal: Elect the node with highest identifier as the leader  Strategy: Transmit highest id you have encountered so far to your neighbors  Implementation:  Maintain a state variable, id, initialized to your own identifier  In each round, transmit value of id on output  Receive input values from the network  If a value higher than id received, then update id CIS 540 Spring 2015; Lecture Feb 2

Execution of Leader Election InitiallyAfter first round 1/ / After second round 1/ / After third round CIS 540 Spring 2015; Lecture Feb 2

Leader Election  When should a node stop and make a decision?  When it knows that enough rounds have elapsed for message from every node to reach every other node  Correctness depends on following assumptions: 1.Network is strongly connected: for every pair of nodes m and n, there is a directed path from node m to node n 2.Each node knows an upper bound N on total number of nodes  Implementation of decision rule:  Maintain a state variable r to count rounds, initially 1  In each round, r is incremented  When r = N, decide  What should the decision be? CIS 540 Spring 2015; Lecture Feb 2

Node Component for Leader Election if (r<N) then { out := id; r := r+1} A1: r, id -> r, out A2: r,id,in -> id, status nat id := myID; r := 1 set(msg) in event(msg) out {unknown, leader, follower} status if (in != Empty) then id := max (id, max in); if (r < N) then status := unknown else if (id == myID) then status := leader else status := follower CIS 540 Spring 2015; Lecture Feb 2

Leader Election  Does a node really have to wait for N rounds?  If a node receives a value higher than its own identifier, can it stop participating (i.e. not transmit any more messages)?  Does a node have to transmit in each round? When can it choose to skip a round without affecting correctness? CIS 540 Spring 2015; Lecture Feb 2