Time for High-Confidence Distributed Embedded Systems Edward Ashford Lee Robert S. Pepper Distinguished Professor UC Berkeley Invited keynote talk IEEE.

Slides:



Advertisements
Similar presentations
Leveraging Synchronized Clocks in Distributed Applications Edward A. Lee Robert S. Pepper Distinguished Professor UC Berkeley Swarm Lab Retreat January.
Advertisements

February 21, 2008 Center for Hybrid and Embedded Software Systems Cyber-Physical Systems (CPS): Orchestrating networked.
Lecture 1: Introduction II EEN 112: Introduction to Electrical and Computer Engineering Professor Eric Rozier, 1/16/2013.
PTIDES Project Overview
Overview of PTIDES Project
2/11/2010 BEARS 2010 On PTIDES Programming Model John Eidson Jeff C. Jensen Edward A. Lee Slobodan Matic Jia Zou PtidyOS.
PTIDES: Programming Temporally Integrated Distributed Embedded Systems Yang Zhao, EECS, UC Berkeley Edward A. Lee, EECS, UC Berkeley Jie Liu, Microsoft.
Integrated Design and Analysis Tools for Software-Based Control Systems Shankar Sastry (PI) Tom Henzinger Edward Lee University of California, Berkeley.
CS599 Software Engineering for Embedded Systems1 Software Engineering for Real-Time: A Roadmap Presentation by: Mandar Samant Raghbir Singh Banwait.
February 11, 2010 Center for Hybrid and Embedded Software Systems Ptolemy II - Heterogeneous Concurrent Modeling and Design.
April 16, 2009 Center for Hybrid and Embedded Software Systems PtidyOS: An Operating System based on the PTIDES Programming.
Causality Interface  Declares the dependency that output events have on input events.  D is an ordered set associated with the min ( ) and plus ( ) operators.
Behavioral Design Outline –Design Specification –Behavioral Design –Behavioral Specification –Hardware Description Languages –Behavioral Simulation –Behavioral.
Review of “Embedded Software” by E.A. Lee Katherine Barrow Vladimir Jakobac.
The Case for Precision Timed (PRET) Machines Edward A. Lee Professor, Chair of EECS UC Berkeley With thanks to Stephen Edwards, Columbia University. National.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 Cyber-Physical Systems: A Vision of the Future Edward A. Lee Robert S. Pepper Distinguished.
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
Real-Time Systems and Programming Languages
February 21, 2008 Center for Hybrid and Embedded Software Systems Mapping A Timed Functional Specification to a Precision.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 13th Lecture Christian Schindelhauer.
SEC PI Meeting Annapolis, May 8-9, 2001 Component-Based Design of Embedded Control Systems Edward A. Lee & Jie Liu UC Berkeley with thanks to the entire.
Soft. Eng. II, Spr. 2002Dr Driss Kettani, from I. Sommerville1 CSC-3325: Chapter 9 Title : Reliability Reading: I. Sommerville, Chap. 16, 17 and 18.
MoBIES Working group meeting, September 2001, Dearborn Ptolemy II The automotive challenge problems version 4.1 Johan Eker Edward Lee with thanks.
7th Biennial Ptolemy Miniconference Berkeley, CA February 13, 2007 PTIDES: A Programming Model for Time- Synchronized Distributed Real-time Systems Yang.
Designing Predictable and Robust Systems Tom Henzinger UC Berkeley and EPFL.
CprE 458/558: Real-Time Systems
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
EMBEDDED SOFTWARE Team victorious Team Victorious.
Software Reliability Categorising and specifying the reliability of software systems.
Course Outline DayContents Day 1 Introduction Motivation, definitions, properties of embedded systems, outline of the current course How to specify embedded.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Chapter 1 Introduction to Simulation
Tufts Wireless Laboratory School Of Engineering Tufts University “Network QoS Management in Cyber-Physical Systems” Nicole Ng 9/16/20151 by Feng Xia, Longhua.
Enabling Dependable Communication in Cyber-Physical Systems with a Wireless Bus Federico Ferrari PhD Defense October 18, 2013 — Zurich, Switzerland Computer.
Computer Science Open Research Questions Adversary models –Define/Formalize adversary models Need to incorporate characteristics of new technologies and.
Cluster Reliability Project ISIS Vanderbilt University.
1. Introduction 1.1 Background 1.2 Real-time applications 1.3 Misconceptions 1.4 Issues in real-time computing 1.5 Structure of a real-time system.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Tufts University School Of Engineering Tufts Wireless Laboratory TWL Direction Almir Davis 09/28/20091.
Model-Driven Analysis Frameworks for Embedded Systems George Edwards USC Center for Systems and Software Engineering
Time for High-Confidence Cyber-Physical Systems
Boundary Assertion in Behavior-Based Robotics Stephen Cohorn - Dept. of Math, Physics & Engineering, Tarleton State University Mentor: Dr. Mircea Agapie.
REAL-TIME SOFTWARE SYSTEMS DEVELOPMENT Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
William Stallings Data and Computer Communications
Global Time in Distributed Real-Time Systems Dr. Konstantinos Tatas.
Conformance Test Experiments for Distributed Real-Time Systems Rachel Cardell-Oliver Complex Systems Group Department of Computer Science & Software Engineering.
The 14 th IEEE Real-Time and Embedded Technology and Applications Symposium, April 2008 Real-Time Distributed Discrete-Event Execution with Fault Tolerance.
Computing For Embedded System IEEE Instrumentation and Measurement Technology Conference Budapest, Hungary, May 21-23, Author : Edward A. Lee UC.
CS4730 Real-Time Systems and Modeling Fall 2010 José M. Garrido Department of Computer Science & Information Systems Kennesaw State University.
Course: COMS-E6125 Professor: Gail E. Kaiser Student: Shanghao Li (sl2967)
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
Agenda  Quick Review  Finish Introduction  Java Threads.
February 12, 2009 Center for Hybrid and Embedded Software Systems Timing-aware Exceptions for a Precision Timed (PRET)
Ptolemy Project Vision Edward A. Lee Robert S. Pepper Distinguished Professor Eighth Biennial Ptolemy Miniconference April 16, 2009 Berkeley, CA, USA.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
February 11, 2016 Center for Hybrid and Embedded Software Systems Organization Faculty Edward A. Lee, EECS Alberto Sangiovanni-Vincentelli,
February 14, 2013 Center for Hybrid and Embedded Software Systems Organization Faculty Edward A. Lee, EECS Alberto Sangiovanni-Vincentelli,
Real-Time Operating Systems RTOS For Embedded systems.
Model-Driven Analysis Frameworks for Embedded Systems
Shanna-Shaye Forbes Ben Lickly Man-Kit Leung
Retargetable Model-Based Code Generation in Ptolemy II
COT 5611 Operating Systems Design Principles Spring 2012
Timing-aware Exceptions for a Precision Timed (PRET) Target
An overview of the CHESS Center
Embedded Systems: A Focus on Time
An overview of the CHESS Center
COT 5611 Operating Systems Design Principles Spring 2014
Presentation transcript:

Time for High-Confidence Distributed Embedded Systems Edward Ashford Lee Robert S. Pepper Distinguished Professor UC Berkeley Invited keynote talk IEEE Real-Time Systems Symposium (RTSS) San Juan, Puerto Rico Dec. 4-7, 2012 Key collaborators: Patricia Derler John Eidson Slobodan Matic Sanjit Seshia Yang Zhao Michael Zimmer Jia Zou

Lee, Berkeley 2Courtesy of Kuka Robotics Corp. The Context Cyber-Physical Systems (CPS) Courtesy of Doug Schmidt Power generation and distribution Courtesy of General Electric Military systems: Transportation (Air traffic control at SFO) Avionics Telecommunications Factory automation Instrumentation (Soleil Synchrotron) Daimler-Chrysler Automotive Building Systems Orchestrating networked computational resources with physical systems

Lee, Berkeley 3 A Prediction Time synchronization is going to change the world (again) 1500s days Gregorian Calendar (BBC history) Lackawanna Railroad Station, 1907, Hoboken. Photograph by Alicia Dudek 1800s seconds 2000s nanoseconds 2005: first IEEE 1588 plugfest

Lee, Berkeley 4 Today’s networks “On August 12, 1853, two trains on the Providence & Worcester Railroad were headed toward each other on a single track. The conductor of one train thought there was time to reach the switch to a track to Boston before the approaching train was scheduled to pass through. But the conductor's watch was slow. As his speeding train rounded a blind curve, it collided head-on with the other train—fourteen people were killed. The public was outraged. All over New England, railroads ordered more reliable watches for their conductors and issued stricter rules for running on time.” Source: National Museum of American History

Lee, Berkeley 5 Precision Time Protocols (PTP) IEEE 1588 on Ethernet This is becoming routine! With this PHY, clocks on a LAN agree on the current time of day to within 8ns, far more precise than older techniques like NTP. A question we are addressing at Berkeley: How does this change how we develop distributed CPS software? Press Release October 1, 2007

Lee, Berkeley 6 A Cyber-Physical System Printing Press Hundreds of microcontrollers and an Ethernet network are orchestrated with precisions on the order of microseconds. Software for such systems can be developed in a completely new way. Bosch-Rexroth Time synchronization enables tightly coordinated actions and reliable networking with bounded latency.

Lee, Berkeley 7 PTP in the Network for Critical Infrastructure Substation Timing Synchronization Using IEEE-1588 Power Profile (Cisco)

Lee, Berkeley 8 An Extreme Example: The Large Hadron Collider The WhiteRabbit project at CERN is synchronizing the clocks of computers 10 km apart to within about 80 psec using a combination of IEEE 1588 PTP and synchronous ethernet.

Lee, Berkeley 9 Wireless Wireless HART uses Time Synchronized Mesh Protocol (TSMP) in a Mote-on-Chip (MoC), from Dust Networks Inc.

Lee, Berkeley 10 But software technology will need to adapt to take advantage of this revolution… For cyber-physical systems, programs do not adequately control timing. The core notions of “computation” today ignore time. The core notions tomorrow will not…

Lee, Berkeley 11 Challenges that We are Addressing Representation of time Data types, superdense time, operations on time, etc. Gaining control over timing in software PRET – Precision-timed computer architecture Multiform time Hierarchical clocks proceeding at different rates. Joint modeling of functionality and implementation Timing emerges from the implementation Programming models that specify timed behavior PTIDES – A programming model for distributed systems

Lee, Berkeley 12 Schematic of a simple CPS:

Lee, Berkeley 13 Computation given in an untimed, imperative language.

Lee, Berkeley 14 This code is attempting to control timing. But will it really?

Lee, Berkeley 15 Timing behavior emerges from the combination of the program and the hardware platform.

Lee, Berkeley 16 A Key Challenge: Timing is not Part of Software Semantics Correct execution of a program in C, C#, Java, Haskell, OCaml, etc. has nothing to do with how long it takes to do anything. Nearly all our computation and networking abstractions are built on this premise. Programmers have to step outside the programming abstractions to specify timing behavior.

Lee, Berkeley 17 Consequences When precise control over timing is needed, designs are brittle. Small changes in the hardware, software, or environment can cause big, unexpected changes in timing. Results: System behavior emerges only at system integration. Manufacturers stockpile parts to suffice for the complete production run of a product. Manufacturers cannot leverage improvements in the hardware (e.g. weight, power). Any change forces re-testing and re-certifying. Designs are over provisioned, increasing cost, weight, and energy usage.

Lee, Berkeley 18 The first edition of Hennessy and Patterson (1990) revolutionized the field of computer architecture by making performance metrics the dominant criterion for design. Today, for computers, timing is merely a performance metric. It needs to be a correctness criterion. Computer Science has not ignored timing…

Lee, Berkeley 19 Correctness criteria We can safely assert that line 8 does not execute (In C, we need to separately ensure that no other thread or ISR can overwrite the stack, but in more modern languages, such assurance is provided by construction.) We can develop absolute confidence in the software, in that only a hardware failure is an excuse. But not with regards to timing!!

Lee, Berkeley 20 The hardware out of which we build computers is capable of delivering “correct” computations and precise timing… The synchronous digital logic abstraction removes the messiness of transistors. … but the overlaying software abstractions discard the timing precision. // Perform the convolution. for (int i=0; i<10; i++) { x[i] = a[i]*b[j-i]; // Notify listeners. notify(x[i]); }

Lee, Berkeley 21 As with processors, for networks, timing is a performance metric, not a correctness criterion The point of these abstraction layers is to isolate a system designer from the details of the implementation below. In today’s networks, timing emerges from the details of the implementation. Even QoS-aware networks (e.g. AVB) derive timing properties from packet priorities & network topology.

Lee, Berkeley 22 Project 1: (which I will not talk about today) PRET Machines PREcision-Timed processors = PRET Predictable, REpeatable Timing = PRET Performance with REpeatable Timing = PRET = PRET+ ComputingWith time // Perform the convolution. for (int i=0; i<10; i++) { x[i] = a[i]*b[j-i]; // Notify listeners. notify(x[i]); }

Lee, Berkeley 23 Project #2: PTIDES A Programming Model for Distributed Cyber-Physical Systems Based on Discrete Events (DE) Concurrent actors Exchange time-stamped messages (“events”) A “correct” execution is one where every actor reacts to input events in time-stamp order. PTIDES leverages network time synchronization to deliver determinate distributed real-time computation.

Lee, Berkeley 24 Discrete-Event Models (in Ptolemy II) DE Director specifies that this will be a DE model

Lee, Berkeley 25 Discrete-Event Models (in Ptolemy II) Model of regularly spaced events (e.g., a clock signal).

Lee, Berkeley 26 Discrete-Event Models (in Ptolemy II) Model of irregularly spaced events (e.g., a failure event).

Lee, Berkeley 27 Discrete-Event Models (in Ptolemy II) Model of a subsystem that changes modes at random (event-triggered) times

Lee, Berkeley 28 Discrete-Event Models (in Ptolemy II) Model of an observer subsystem

Lee, Berkeley 29 Discrete-Event Models (in Ptolemy II) Events on the two input streams must be seen in time stamp order.

Lee, Berkeley 30 This is a Component Technology Model of a subsystem given as an imperative program.

Lee, Berkeley 31 This is a Component Technology Model of a subsystem given as a state machine.

Lee, Berkeley 32 Using Discrete Event Semantics in Distributed Real-Time Systems DE is usually used for simulation (HDLs, network simulators, …) Distributing DE is done to accelerate simulation. We are using DE for distributed real-time software, binding time stamps to real time only where necessary. PTIDES: Programming Temporally Integrated Distributed Embedded Systems

Lee, Berkeley 33 Ptides: Programming Temporally Integrated Distributed Embedded Systems First step: Time-stamped messages. Messages carry time stamps that define their interleaving Actors specify computation

Lee, Berkeley 34 Ptides: Second step: Network time synchronization GPS, NTP, IEEE 1588, time-triggered busses, … they all work. We just need to bound the clock synchronization error. Assume bounded clock error Assume bounded clock error e

Lee, Berkeley 35 Ptides: Third step: Bind time stamps to real time at sensors and actuators Input time stamps are ≥ real time Output time stamps are ≤ real time Messages are processed in time- stamp order. Clock synchronization gives global meaning to time stamps Actors wrap sensors Actors wrap actuators

Lee, Berkeley 36 Global latencies between sensors and actuators become controllable, which enables analysis of system dynamics. Ptides: Fourth step: Specify latencies in the model Model includes manipulations of time stamps, which control latencies between sensors and actors Actuators may be designed to interpret input time stamps as the time at which to take action. Feedback through the physical world

Lee, Berkeley 37 Ptides: Fifth step Safe-to-process analysis (ensures determinacy) Safe-to-process analysis guarantees that the generated code obeys time-stamp semantics (events are processed in time-stamp order), given some assumptions. Assume bounded network delay d Assume bounded clock error Assume bounded clock error e An earliest event with time stamp t here can be safely merged when real time exceeds t + s + d + e – d2 Assume bounded clock error e Assume bounded sensor delay s Application specification of latency d2

Lee, Berkeley 38 Bounded network delay is enabled by time synchronization… ARINC 429 Local area network used in avionics systems. WorldFIP (Factory Instrumentation Protocol) Created in France, 1980s, used in train systems CAN: Controller Area Network Created by Bosch, 1980s/90s, ISO standard Various ethernet variants PROFInet, EtherCAT, Powerlink, … TTP/C: Time-Triggered Protocol Created around 1990, TU Vienna, supported by TTTech MOST: Media Oriented Systems Transport Created by a consortium of automotive & electronics companies Under active development today FlexRay: Time triggered bus for automotive applications Created by a consortium of automotive & electronics companies Under active development today

Lee, Berkeley 39 Ptides Schedulability Analysis Determine whether deadlines can be met Schedulability analysis incorporates computation times to determine whether we can guarantee that deadlines are met. Deadline for delivery of event with time stamp t here is t – c3 – d2 Deadline for delivery here is t Assume bounded computation time c1 Assume bounded computation time c3 Assume bounded computation time c2

Lee, Berkeley 40 Workflow Structure for Experiments HW Platform Software Component Library Ptides Model Code Generator PtidyOS Cod e Plant Model Network Model HW in the Loop Simulator Causality Analysis Program Analysis Schedulability Analysis Analysis Mixed Simulator Ptolemy II Ptides domain Ptolemy II Discrete-event, Continuous, and Wireless domains Luminary Micro 8962 IEEE 1588 Network time protocol

Lee, Berkeley 41 Designing & Evaluating PTIDES-based Systems To meet real-time constraints, the implementation platform matters. Conventional approach: Specify functionality and implementation. Then measure temporal properties. Our approach: Specify temporal requirements. Then verify that they are met by a candidate implementation.

Lee, Berkeley 42 Topics for further discussion How to represent time? Need superdense time for a clean semantics of simultaneity. How to advance time? Need multiform time to model inhomogeneity and imperfect sync. How to determine the required accuracy of time sync? PTIDES offers a tradeoff between latency and time sync accuracy. How to handle faults? PTIDES can detect violations of assumptions (bounded clock error, bounded network latency, and bounded sensor delay). Security? Does time synchronization create a point of vulnerability?

Lee, Berkeley 43 Security With stable local clocks you can: Prevent packet losses. Detect hardware failures. Detect denial of service. Detect GPS and PTP spoofing. Coordinate w/out communication. GPS Jammer, courtesy of Kyle D. Wesson, UT Austin

Lee, Berkeley 44 Synchronized Clocks In my view, synchronized clocks offer as big a change as: Synchronous digital circuit design. Imperative programming languages. both of which are models with strong formal properties.

Lee, Berkeley 45 Modeling vs. Reality Solomon Golomb: Mathematical models – Uses and limitations. IEEE Transactions on Reliability, 1971 Solomon Wolf Golomb (1932) mathematician and engineer and a professor of electrical engineering at the University of Southern California. Best known to the general public and fans of mathematical games as the inventor of polyominoes, the inspiration for the computer game Tetris. He has specialized in problems of combinatorial analysis, number theory, coding theory and communications. You will never strike oil by drilling through the map!

Lee, Berkeley 46 Don’t confuse models with reality! The Kopetz Principle Many (predictive) properties that we assert about systems (determinism, timeliness, reliability) are in fact not properties of an implemented system, but rather properties of a model of the system. We can make definitive statements about models, from which we can infer properties of system realizations. The validity of this inference depends on model fidelity, which is always approximate. (paraphrased) Synchronized clocks enable determinate models for distributed real-time software that have high-fidelity realizations. Prof. Dr. Hermann Kopetz

Lee, Berkeley 47 High-fidelity determinate models for CPS 1. Regain control over timing at the microarchitecture level (the PRET project, Precision Timed Machines). 2. Regain control over timing at the network level (the PTIDES project, Programming Timed Distributed Embedded Systems). Our Dual Solution:

Lee, Berkeley 48 Conclusions Today, timing emerges from realizations of digital systems. Tomorrow, timing behavior will be a semantic property of networks, programs, and models. Raffaello Sanzio da Urbino – The Athens School Overview References: Lee. Computing needs time. CACM, 52(5):70–79, 2009 Eidson et. al, Distributed Real-Time Software for Cyber-Physical Systems, Proc. of the IEEE January, 2012.

Lee, Berkeley 49 Determinate Models Physical System Model Synchronous digital logic

Lee, Berkeley 50 Determinate Models Physical System Model Single-threaded imperative programs

Lee, Berkeley 51 Modeling Time Variable time passage across distributed systems. Clocks drift Clock synchronization Next steps: -notation and theory that enables designers to easily converse about multiform time -Multiform notion of time in abstract actor semantics -Test on models of real systems reference regular to fast offset, regular to slow suspend, resume

Lee, Berkeley 52 Backup: How PTP Synchronization works