DOC PREVIEW
CMU ISM 95702 - Time and Global States

This preview shows page 1-2-3-21-22-23-43-44-45 out of 45 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 45 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MISM 95-702 Distributed Systems 1 Distributed Systems Time and Global StatesMISM 95-702 Distributed Systems 2 Learning Goals • To understand: – The challenge of time in a distributed system – How to synchronize distributed clocks – How you can assess the state of a distributed systemExample • Browse to http://tinyurl.com/702clock – This is your local clock • Take out a piece of paper • Solve by hand: 643 * 192 – Timestamp each line after you complete it • E.g. MISM 95-702 Distributed Systems 3 Arithmetic Timestamp 643 92 192 96 1286 112 …Time in distributed systems • Who finished first? • How could decide computationally who finished first? • Can you use the timestamps? – Are they reliable? – Why or why not are they reliable? • How could you make the timestamps more reliable? • What other approach could you take? MISM 95-702 Distributed Systems 4MISM 95-702 Distributed Systems 5 Skew and drift • Why can’t we have a global clock in a distributed system? • Because clocks are imperfect: – Clock skew – different times • Two clocks will have two different times. – Clock drift – different speeds • Each clock varies in speedTime • What is a second? – 9,192,631,770 periods of transition between the two hyperfine levels of the ground state of Caesium-133 (Cs133) • Ordinary quartz crystal clocks – Drifts 1 second every 11 days • What can a computer do in a second? – Intel Core i7: ~100 Billion Instructions MISM 95-702 Distributed Systems 6MISM 95-702 Distributed Systems 7 Clocks • Cesium clocks – Expensive • GPS receiver – Less expensive – (GPS system has cesium clock(s))MISM 95-702 Distributed Systems 8 3 Days in the life of my Mac 3/20/13 11:55:00 PM ntpd[26] time reset -1.782968 s 3/21/13 12:47:41 PM ntpd[26] time reset -0.719539 s 3/21/13 4:30:51 PM ntpd[26] time reset +0.327154 s 3/21/13 7:55:42 PM ntpd[26] time reset -0.238545 s 3/21/13 10:29:06 PM ntpd[26] time reset +0.364890 s 3/22/13 11:28:51 AM ntpd[26] time reset -1.058507 s 3/22/13 3:09:51 PM ntpd[26] time reset +0.572059 s 3/22/13 9:33:25 PM ntpd[26] time reset -0.165838 s 3/22/13 10:19:11 PM ntpd[26] time reset +1.000670 s 3/23/13 7:50:47 AM ntpd[26] time reset -0.171427 s 3/23/13 10:10:30 AM ntpd[26] time reset +0.133970 s 3/23/13 11:55:39 AM ntpd[26] time reset -0.136061 s 3/23/13 12:37:57 PM ntpd[26] time reset -0.526902 s 3/23/13 1:09:51 PM ntpd[26] time reset +0.400528 sDemonstrate Internal Synchronization • Informally: – Internally synchronize your watches • Formally: – All clocks agree within some bound D. MISM 95-702 Distributed Systems 9Demonstrate External Synchronization • Informally: – Externally synchronize your watches • Formally: – Each clock Ci is accurate to UTC within some bound D – UTC is Coordinated Universal Time MISM 95-702 Distributed Systems 10MISM 95-702 Distributed Systems 11 Network Time Protocol Design Goals: • Sync with UTC over Internet • Provide reliability via redundancy • Scale to large number of clients and servers • Defend against Mallory Graphic source: http://en.wikipedia.org/wiki/Network_Time_ProtocolNTP Simulation • Work in pairs • Both students should have the clock demo page running – http://tinyurl.com/702clock • Use only ONE sheet • ONE student starts the process – fill in (a) and pass to student TWO • student TWO – fills in (b) upon arrival – then fills in (c) and passes form back to student ONE • student ONE – fills in (d) – calculates (e-i) – puts the value of (i) in their own clock demo (ONE only) • Both students – eyeball your clocks and see if they are nearly synchronized MISM 95-702 Distributed Systems 12MISM 95-702 Distributed Systems 13 a Sent time b Received time c Sent-back time d Returned-back time Calculation UDP Packet (reusable) eTotal round trip time (d-a) f Remote processing time (c-b) g Delay each way (e-f)/2 hOffset relative to remote (d-g) - c i Amount to adjust local clock -h a Sent time b Received time c Sent-back time d Returned-back time Calculation UDP Packet (reusable) eTotal round trip time (d-a) f Remote processing time (c-b) g Delay each way (e-f)/2 hOffset relative to remote (d-g) - c i Amount to adjust local clock -h a Sent time b Received time c Sent-back time d Returned-back time Calculation UDP Packet (reusable) eTotal round trip time (d-a) f Remote processing time (c-b) g Delay each way (e-f)/2 hOffset relative to remote (d-g) - c i Amount to adjust local clock -hMISM 95-702 Distributed Systems 14 Summarize • Summarize in your own words how NTP synchronization works • What is NTP synchronized time good enough for? – Median error is 2-5ms but has a long tail • Source: Chi-Yao Hong , Chia-Chi Lin , Matthew Caesar, Clockscalpel: understanding root causes of internet clock synchronization inaccuracy, Proceedings of the 12th international conference on Passive and active measurement, p.204-213, March 20-22, 2011, Atlanta, GA • What are its shortcomings?Google Time & Leap Smears • What was the problem? • Why is a second important to Google? • What stratum NTP servers do they have internally? • What is their solution? – What is a Leap Smear? – Is it an example of internal or external synchronization? MISM 95-702 Distributed Systems 15Distributed Systems Histories • Mind experiment – Take a set of index cards – List 20 things you did so far today • Ever since you woke up. – Be detailed – Be sure to include interactions with people in this class MISM 95-702 Distributed Systems 16Global State Terminology Define by example (using the cards you just made): • Process history • Global history • Happened-before relation • Cut • Consistent cut • Inconsistent cut • Linearization • I recommend you read Coulouris – And know definitions for final exam MISM


View Full Document

CMU ISM 95702 - Time and Global States

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

Axis

Axis

43 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download Time and Global States
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Time and Global States and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Time and Global States 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?