Outline for Today Objectives: –Time and Timers Administrative details: –About the final…

Slides:



Advertisements
Similar presentations
Time Synchronization - using Reference-Broadcast Synchronization
Advertisements

HIERARCHY REFERENCING TIME SYNCHRONIZATION PROTOCOL Prepared by : Sunny Kr. Lohani, Roll – 16 Sem – 7, Dept. of Comp. Sc. & Engg.
Time and Clock Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Distributed Systems Spring 2009
Time in Embedded and Real Time Systems Lecture #6 David Andrews
Distributed Systems Fall 2010 Time and synchronization.
Time Synchronization (RBS, Elson et al.) Presenter: Peter Sibley.
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Jonathan.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 15th Lecture Christian Schindelhauer.
Time Synchronization Murat Demirbas SUNY Buffalo.
Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented by Reinette Grobler.
1 University of Freiburg Computer Networks and Telematics Prof. Christian Schindelhauer Wireless Sensor Networks 13th Lecture Christian Schindelhauer.
Fine-Grained Network Time Synchronization using Reference Broadcasts Jeremy Elson, Lewis Girod, and Deborah Estrin U.C.L.APresenter: Todd Fielder.
Lecture 9: Time & Clocks CDK4: Sections 11.1 – 11.4 CDK5: Sections 14.1 – 14.4 TVS: Sections 6.1 – 6.2 Topics: Synchronization Logical time (Lamport) Vector.
Distributed Systems Foundations Lecture 1. Main Characteristics of Distributed Systems Independent processors, sites, processes Message passing No shared.
1 Physical Clocks need for time in distributed systems physical clocks and their problems synchronizing physical clocks u coordinated universal time (UTC)
Fine-Grained Network Time Synchronization Using Reference Broadcasts Jeremy Elson, Lew Girod, and Deborah Estrin University of California, Los Angeles.
GPS based time synchronization of PC hardware Antti Gröhn
Real-Time Systems Design1 Priority Inversion When a low-priority task blocks a higher-priority one, a priority inversion is said to occur Assume that priorities:
Time Management.  Time management is concerned with OS facilities and services which measure real time, and is essential to the operation of timesharing.
Outline for Today Objectives: –Time and Timers Administrative details: –Talk on learning at 4 in 130 North Building –Questions?
Fine-Grained Network Time Synchronization using Reference Broadcasts Jeremy Elson, Lew Girod, and Deborah Estrin OSDI Boston, MA Speaker : hsiwei-Chen.
Software Development Infrastructure for Sensor Networks Operating systems (TinyOS) –Resource (device) management –Basic primitives –Protocols (MAC, routing)
1 Soft Timers: Efficient Microsecond Software Timer Support For Network Processing Mohit Aron and Peter Druschel Rice University Presented By Oindrila.
Lecture 9: Time and clocks (Chap 11) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Time This powerpoint presentation has been adapted from: 1) sApr20.ppt.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Time Synchronization Protocols in Wireless Sensor Networks.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Time and global states Chapter 11. Outline Introduction Clocks, events and process states Synchronizing physical clocks Logical time and logical clocks.
6 SYNCHRONIZATION. introduction processes synchronize –exclusive access. –agree on the ordering of events much more difficult compared to synchronization.
Computer Network Design EEL 6785 Dr. Janusz Zalewski University of Central Florida.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
Time Sources and Timing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Distributed Systems Lecture 5 Time and synchronization 1.
Soft Timers : Efficient Microsecond Software Timer Support for Network Processing - Mohit Aron & Peter Druschel CS533 Winter 2007.
Distributed Web Systems Time and Global State Lecturer Department University.
Timers and Time Management Ok-Kyun Ha
Distributed Systems CS
Mohit Aron Peter Druschel Presenter: Christopher Head
Proof of liveness: an example
Synchronizing Processes
Time Sources and Timing
Presented by Kristen Carlson Accardi
Distributed Computing
Time and Clock Primary standard = rotation of earth
CSE 486/586 Distributed Systems Logical Time
Lecture 5 Time and synchronization
CSE 486/586 Distributed Systems Time and Synchronization
Time Sources and Timing
CSE 486/586 Distributed Systems Logical Time
Net 435: Wireless sensor network (WSN)
Dept. of Computer Science
Time and Clock.
Logical time (Lamport)
COT 5611 Operating Systems Design Principles Spring 2012
Time and Clock.
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Distributed Systems CS
Wireless Embedded Systems
Time Sources and Timing
CDK: Sections 11.1 – 11.4 TVS: Sections 6.1 – 6.2
Supporting Time-Sensitive Applications on a Commodity OS
Logical time (Lamport)
Logical time (Lamport)
CSE 486/586 Distributed Systems Time and Synchronization
Logical time (Lamport)
COT 5611 Operating Systems Design Principles Spring 2014
Last Class: Naming Name distribution: use hierarchies DNS
Outline Theoretical Foundations
Presentation transcript:

Outline for Today Objectives: –Time and Timers Administrative details: –About the final…

Uses of Time Coordinating events –Synchronized clocks Measurements – durations of activities –Stability – ability to maintain constant frequency Environmental factors (temperature) or age Synchronization protocols that adjust clock Driving periodic events –Granularity (frequency) Scheduling dynamic events at a particular time in the future. –Accuracy –Relative or absolute time?

Time Definitions Clock stability – how well it maintains a constant frequency –Short term – temperature –Long term – aging of oscillator Clock accuracy – how well its frequency and time compare with standard

Time Definitions Offset – time difference between 2 clocks Skew – frequency difference between 2 clocks

Scheduling Future Events

Timer Basics (Linux) Real time clock (RTC) keeps track of time even when system is off – boot-time initialization System timer – provide periodic interrupts –Programmable interrupt timer running at tick rate of HZ frequency Time update (jiffies, wall clock time), do accounting (resource usage), dispatch events that are due (dynamic timers), rescheduling –Jiffies – number of ticks since reboot –Time of day xtime structure – contains seconds since Jan ; wall clock time based on that. Delaying execution by looping udelay(us) or sleeping schedule_timeout(s*HZ)

Dynamic Timers Created and destroyed dynamically Handler is run when tick count is >= expiration time. init_timer(&mytimer); mytimer.expires = jiffies + delay; mytimer.data = 0; //arg passed to handler mytimer.function =myhandler; add_timer(&mytimer); Can change mod_timer or remove del_timer_sync timers Timers are stored in buckets depending on how far into the future they should expire. Run asynchronously with respect to other code – protect shared data appropriately.

Soft Timers Aron & Druschel Goal: to provide usec granularity events with low overhead. –Do not want timer interrupts at that granularity Approach: To leverage trigger points when execution has already been interrupted – amortize context switch and cache pollution already incurred by other causes. –End of syscall processing, end of exception handler, end of executing interrupt handler, during CPU idle loop –Bounded overrun if a trigger point doesn’t happen – backup hardware interrupt set

Accuracy X = cycles/interrupt

Overhead Timer costs with synthetic event handler scheduled every 10usec Synthetic event handler touches 50 cache lines, 2 instr cache lines

Trigger Occurrence

Trigger Sources

Impact of Trigger Sources (ST-Apache)

Target Applications Rate-based clocking in the networking system –Schedule transmissions according to desired rate –If achieved rate falls below target, schedule to allow maximal allowable burst Polling network interfaces

Clock Synchronization

Causality and Logical Time Communication patterns establish a happened-before order on events, which tells us when ordering might matter. Event e 1 happened-before e 2 iff e 1 could possibly have affected the generation of e 2 : we say that e 1 < e 2. –e 1 < e 2 iff e 1 was “known” when e 2 occurred. –Events e 1 and e 2 are potentially causally related.

Causality: Example A B C A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 A1 < B2 < C2 B3 < A3 C2 < A4

Lamport’s Logical Clocks Logical clock LC induces a partial order that respects potential causality. Clock condition: e 1 < e 2 implies that LC(e 1 ) < LC(e 2 ) 1. Each site maintains a monotonically increasing clock value LC. 2. Globally visible events (e.g., updates) are timestamped with the current LC value at the generating site. Increment local LC on each new event: LC = LC Piggyback current clock value on all messages. Receiver resets local LC: if LC s > LC r then LC r = LC s + 1

Logical Clocks: Example A B C C5: LC update advances receiver’s clock if it is “running slow” relative to sender. A6-A10: receiver’s clock is unaffected because it is “running fast” relative to sender.

Naive Clock Synchronization request reply(timestamp) timestamp=localclock localclock = timestamp+rtt/2

How NTP works Multiple synchronization peers provide redundancy and diversity Clock filters select best from a window of eight clock offset samples Intersection and clustering algorithms pick best subset of servers believed to be accurate and fault-free Combining algorithm computes weighted average of offsets for best accuracy Phase/frequency-lock feedback loop disciplines local clock time and frequency to maximize accuracy and stability NTP Messages Peer 1 Peer 2 Filter 1 Peer 3 Filter 2 Filter 3 Intersection and Clustering Algorithms Combining Algorithm Loop Filter VFO Timestamps P/F-Lock Loop © Mills

Reference Broadcast Time Synchronization Elston, Girod, Estrin Goal: precise (1 us) relative time scale among wireless sensor nodes. Exploits (requires) broadcast medium Synchronizes among common receivers of the same beacon –I got it at time t 1 on my clock; you got it at time t 2 on your clock -> phase offset between clock values for this individual pulse is Offset[i,j] = t j -t i Must also deal with clock skew – clocks drift apart by ticking at slightly different rates

Critical Path Nondeterminism RBS removes many causes of nondeterminism from critical path

Multiple Broadcasts Why Pairwise error: 2 receiver (bottom line); 20 receiver (top line)

Fixing Clock Skew Perform least- squares linear regression – best fit line over time; recover frequency and phase of local clock wrt remote one from slope and intercept Also an effective post-facto synchronization scheme – extrapolate backward Evaluation comparing RBS to NTP: 8 times better wrt average error (light load)

Multi-Hop Intersecting receivers can relate clocks from both A and B E i (R j ) means time of event i according to j’s clock. 1. Receivers R1 and R7 observe events at times E 1 (R 1 ) and E 7 (R 7 ), respectively. 2. R4 uses A’s reference broadcasts to establish the best-fit line needed for converting clock values from R1 to R4. This line is used to convert E 1 (R 1 ) to E 1 (R 4 ). 3. R4 similarly uses B’s broadcasts to convert E 1 (R 4 ) to E 1 (R 7 ). 4. The time elapsed between the events is computed as E 1 (R 7 ) – E 7 (R 7 )