Distributed Systems: Naming Continued Synchronization - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Distributed Systems: Naming Continued Synchronization

Description:

Real world facts that complicate GPS ... Let Cp(t) be the value of the clock on machine p when the UTC time is t. ... Clock servers are divided into stratums, ... – PowerPoint PPT presentation

Number of Views:93
Avg rating:3.0/5.0
Slides: 28
Provided by: Ken667
Category:

less

Transcript and Presenter's Notes

Title: Distributed Systems: Naming Continued Synchronization


1
Distributed SystemsNaming (Continued)Synchroniz
ation
  • CS 654Lecture 13October 30, 2006

2
Refresh Distributed Garbage Collection
  • The problem. How do you discover when no one
    needs a server object?
  • One solution Develop distributed versions of
    garbage collection algorithms.

3
Reference Listing
  • Distributed reference counting is tricky because
    of failures.
  • If you send an increment, how do you know it
    arrived?
  • What if the ack is lost?
  • If you can design it so that it doesnt matter
    how many times you send a message, then it is
    simpler.
  • This is called idempotency. An idempotent
    operation can be done many times without negative
    effect.
  • Are these idempotent?
  • Withdrawing 50 from your bank account.
  • Cancelling a credit card account.
  • Registering for a course.

4
Idempotent Reference Counting
  • How can we make reference counting idempotent?
  • What turns non-idempotent registration into
    idempotent registration?
  • Keep track of which proxies have been created in
    the skeleton.

5
Reference Listing
P1
Reference ListP1P2
P2
  • Keep a list of proxies in the skeleton.
  • Failures can be handled with heartbeats, etc.
  • Main issue is scaling, if millions of proxies.

6
Tracing in Groups
  • Garbage collect first within a group of
    distributed processes.
  • An object is not collected if
  • It has a reference from outside the group
  • It has a reference from the root set
  • This is conservative.
  • It is possible that a reference from outside the
    group is not reachable.

7
The Model
  • Proxies (stubs), skeletons, and objects.
  • Only one proxy per object per process.
  • A root set of references. The root set is not
    proxies.

Proxy
Skeleton
Object
8
Basic Steps
  • Find all skeletons in a group that are reachable
    from outside or from root set.
  • Mark them hard, others are soft.
  • Within a process, proxies that are reachable from
    hard are marked hard, reachable from soft are
    marked soft. Some are marked none.
  • Repeat the above until stable (no change).

9
  • Skeletons
  • Hard
  • Reachable from proxy outside of group
  • Reachable from root object inside of group
  • Soft
  • Reachable only from proxies inside of group
  • Proxies
  • Hard
  • Reachable from root set
  • Soft
  • Reachable from skeleton marked soft
  • None

10
Initial Marking of Skeletons
  • All proxies in group report to skeleton.
  • If ref count greater than number of proxies, then
    must be external refs.

11
Local Propagation
  • Propagate hard/soft marks locally.

12
Iterate Till Convergence
  • Final marking.
  • Anything not hard can be collected.

13
Synchronization
14
Clock Synchronization
  • Why is it important?
  • Embedded systems (Agilent)
  • Stimulus and response
  • Ordering debugging messages
  • Financial transactions
  • Collaborative sensing GPS

15
Clock Synchronization
  • Figure 6-1. When each machine has its own clock,
    an event that occurred after another event may
    nevertheless be assigned an earlier time.

16
Physical Clocks
  • A high-frequency oscillator, counter, and holding
    register
  • Counter decrements on each oscillation, generates
    a tick and is reset from the holding register
    when it goes to 0.
  • On a network, clocks will differ skew.
  • Two problems
  • How do we synchronize multiple clocks to the
    real time?
  • How do we synchronize with each other?

17
Measuring Time
  • How long is a second?
  • How long is a day?
  • One solar day is 86,400 solar seconds.
  • Some variation in the rotational speed of the
    earth mean solar second.

18
A Solar Day
  • Computation of the mean solar day.

19
Changes
  • Big problem the earths rotation is slowing.
  • Seconds are getting longer.
  • Is this acceptable for science and engineering?
  • Use physical clocks not tied to the Earth TAI.
  • Hmbut then there are more seconds in a day!
  • What are leap years for?
  • Leap seconds are periodically added.

20
Leap Seconds
  • TAI seconds are of constant length, unlike solar
    seconds. Leap seconds are introduced when
    necessary to keep in phase with the sun.
  • UTC is TAI with leap seconds.
  • Suppose we want to know how much time elapsed
    between two events. Which do we use?

21
GPS
  • 29 satellites, with atomic clocks, at 20,000 km.
  • Each satellite continuously broadcasts its
    position and time.

22
Triangulation
23
Complications
  • Real world facts that complicate GPS
  • It takes a while before data on a satellites
    position reaches the receiver.
  • The receivers clock is generally not in synch
    with that of a satellite.
  • Using four satellites, end up with a system of
    four equations in four unknowns.

24
With Four Satellites
  • Measured delay includes clock differences.
    Delta-r is the clock difference
  • Real distance

25
Notation and Terms
  • Assume a timer that causes an interrupt H times a
    second.
  • When it fires, adds 1 to a software clock, C.
  • Let Cp(t) be the value of the clock on machine p
    when the UTC time is t.
  • Cp(t) is the frequency, dC/dt.
  • Cp(t) 1 is the skew. Offset is Cp(t) t.
  • Clocks will drift. If we can bound the drift,
    then we have the maximum drift rate.
  • 1 rho

26
Clock Drift
  • The relation between clock time and UTC when
    clocks tick at different rates.

27
Network Time Protocol
  • Contact a time server to ask the time.
  • What is the major issue here?
  • Trick is to get a good estimate of the message
    delays.

28
Network Time Protocol
  • Getting the current time from a time server.

29
NTP Time Corrections
  • NTP is about making clocks correspond to the real
    time.
  • Clock servers are divided into stratums, starting
    with stratum-0 for the reference physical clock.
  • If a stratum-2 clock is running faster than a
    stratum-1 clock, the stratum-2 clock will adjust.
  • How should it adjust if it is running fast?
  • Time should never go backwards, but should just
    slow down.
Write a Comment
User Comments (0)
About PowerShow.com