ArticleslgStudy

mathematics

Clock drift

Clock drift is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Clock drift rather than just read about it. In short: In engineering and computing, clock drift refers to several related phenomena where a clock does not run at exactly the same rate as a reference clock. That is, after some time the clock "drifts apart" or gradually desynchronizes from the other clock.

Key takeaways

  • Clock drift belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Clock drift to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Clock drift from memory before moving on to harder problems.

Reference excerpt

In engineering and computing, clock drift refers to several related phenomena where a clock does not run at exactly the same rate as a reference clock. That is, after some time the clock "drifts apart" or gradually desynchronizes from the other clock. All clocks are subject to drift, causing eventual divergence unless resynchronized. In particular, the drift of crystal-based clocks used in computers requires some synchronization mechanism for any high-speed communication. Clock drift is most commonly expressed in parts-per million (ppm), in which each unit equates to 86.4 milliseconds of drift per day. Common market watches usually range from ± 1 to ± 100 ppm. More advanced clocks may even use parts-per billion, and the most accurate atomic clocks have reached an accuracy that is expressed in parts-per sextillion. Computer clock drift can be utilized to build random number generators. These can however be exploited by timing attacks.

In non-atomic clocks

Everyday clocks such as wristwatches have finite precision. Eventually they require correction to remain accurate. The rate of drift depends on the clock's quality, sometimes the stability of the power source, the ambient temperature, and other subtle environmental variables. Thus the same clock can have different drift rates at different occasions. More advanced clocks and old mechanical clocks often have some kind of speed trimmer where one can adjust the speed of the clock and thus correct for clock drift. For instance, in pendulum clocks the clock drift can be manipulated by slightly changing the length of the pendulum. A quartz oscillator is less subject to drift due to manufacturing variances than the pendulum in a mechanical clock. Hence most everyday quartz clocks do not have an adjustable drift correction.

Atomic clocks Atomic clocks are very precise and have nearly no clock drift. Even the Earth's rotation rate has more drift and variation in drift than an atomic clock due to tidal acceleration and other effects. The principle behind the atomic clock has enabled scientists to redefine the SI unit second in terms of exactly 9192631770 oscillations of the caesium-133 atom. The precision of these oscillations allows atomic clocks to drift roughly only one second in a hundred million years; as of 2015, the most accurate atomic clock loses one second every 15 billion years. The International Atomic Time (TAI) time standard and its derivatives, such as the Coordinated Universal Time (UTC), are based on weighted averages of atomic clocks worldwide.

Relativity

As Einstein predicted, relativistic effects can also cause clock drift due to time dilation. This is because there is no absolute time; time is instead relative to the observer. Special relativity describes how two clocks held by observers in different inertial frames (i.e. moving with respect to each other but not accelerating or decelerating) will each appear to either observer to tick at different rates. In addition to this, general relativity gives us gravitational time dilation. Briefly, a clock in a stronger gravitational field (e.g. closer to a planet) will appear to tick more slowly. People holding these clocks (i.e. those inside and outside the stronger field) would all agree on which clocks appear to be going faster. It is time itself rather than the function of the clock which is affected. Both effects have been experimentally observed. Time dilation is of practical importance. For instance, the clocks in GPS satellites experience this effect due to the reduced gravity they experience (making their clocks appear to run more quickly than those on Earth) and must therefore incorporate relativistically corrected calculations when reporting locations to users. If general relativity were not accounted for, a navigational fix based on the GPS satellites would be false after only 2 minutes, and errors in global positions would continue to accumulate at a rate of about 10 kilometers each day.

Random number generators

Computer programs often need high quality random numbers, especially for cryptography. There are several similar ways clock drift can be used to build random number generators (RNGs). One way to build a hardware random number generator is to use two independent clock crystals, one that for instance ticks 100 times per second and one that ticks 1 million times per second. On average the faster crystal will then tick 10,000 times for each time the slower one ticks. But since clock crystals are not precise, the exact number of ticks will vary. That variation can be used to create random bits. For instance, if the number of fast ticks is even, a 0 is chosen, and if the number of ticks is odd, a 1 is chosen. Thus such a 100/1000000 RNG circuit can produce 100 somewhat random bits per second. Typically such a system is biased—it might for instance produce more zeros than ones—and so hundreds of somewhat-random bits are "whitened" to produce a few unbiased bits. There is also a similar way to build a kind of "software random number generator". This involves comparing the timer tick of the operating system (the tick that usually is 100–1000 times per second) and the speed of the CPU. If the OS timer and the CPU run on two independent clock crystals the situation is ideal and more or less the same as the previous example. But even if they both use the same clock crystal the process/program that does the clock drift measurement is "disturbed" by many more or less unpredictable events in the CPU such as interrupts and other processes and programs that run at the same time. Thus the measurement will still produce fairly good random numbers. Most hardware random number generators such as the ones described above are fairly slow. Therefore, most programs only use them to create a good seed that they then feed to a pseudorandom number generator or a cryptographically secure pseudorandom number generator to produce many random numbers fast.

Timing attack In 2006, a side channel attack was published that exploited clock skew based on CPU heating. The attacker causes heavy CPU load on a pseudonymous server (Tor hidden service), causing CPU heating. CPU heating is correlated with clock skew, which can be detected by observing timestamps (under the server's real identity).

See also Bit slip Clock skew Effects of relativity on GPS Injection locking Segal's law

References

Worked examples

Example 1 — a first encounter with Clock drift

Start with the simplest possible case. Write down what Clock drift claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Clock drift before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Clock drift ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Clock drift

In research
Clock drift appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Clock drift in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Clock drift is common in secondary-school and first-year university syllabi. It links to neighbouring topics Clocks, Cryptographic attacks, Global Positioning System, so understanding it makes those chapters shorter.
In everyday life
Look for Clock drift outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Clock drift” →

How to study Clock drift in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Clock drift means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Clock drift out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Clock drift in simple terms?

In engineering and computing, clock drift refers to several related phenomena where a clock does not run at exactly the same rate as a reference clock. That is, after some time the clock "drifts apart" or gradually desynchronizes from the other clock.

Why does Clock drift matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Clock drift?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Clock drift.

Tags

  • Clocks
  • Cryptographic attacks
  • Global Positioning System
  • Random number generation

Keep exploring