GSoC Project Idea: NTF: General Timestamp Format and API

This project will build on the good results of GSoC2013NewTimestampAndAPI .


Current timestamp technology offers the system time. Harlan thinks that we'd be much better served with a new timstamp structure that contains:

  • The current system time
  • The believed offset to correct time
  • The maximum and expected error in the timestamp
  • The timescale
  • A "Clock ID"
  • A "clock discontinuity counter"
  • Various flag bits, and a timestamp version/revision value

This new mechanism would be an alternative to the existing timestamp methods.

Since some applications cannot tolerate backwards time-steps, if a backward time adjustment is needed one potential solution is to apply this correction to the offset field, having it advance at the rate of one second per second until the correction is fully applied, and have the system time field advance very slowly.

The expected error bounds for the timestamp are reset to their minimum amounts when a "trusted" time synch happens, and this value otherwise increases at the CLOCK_PHI rate described in the NTP book and documentation.

While we could use a 32-bit field for the seconds field and a 32-bit field for the subseconds, there is something to be said for using more than 32-bits for at least the seconds portion. While a 32-bit fraction will give us sub-nanosecond precision, a 32-bit integer portion will only give us a 68 year timeframe.

The timescale field will be interesting. It would be good to handle (or at least be aware of) the following cases:
  • UTC
  • GPS
  • IERS-A
  • Martian Standard Time

We should have a portable library that can perform the following operations on timestamps:
  • arithmetic
  • comparison
  • conversion

Work To Be Done

  • Understand what was done with the previous effort.
  • Update the current timestamp structure to what we've learned over the past year.
  • Identify and gently document any unimplemented capabilities of the previous effort.
  • some of the following:
    • Implement any remaining unfinished capabilities, including a test framework.
    • Implement the new timekeeping structure in a Linux kernel.
    • Implement the new timekeeping structure in a FreeBSD kernel.

Mentors: HarlanStenn and others.
Topic revision: r6 - 21 Feb 2014, HarlanStenn

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Network Time Foundation Community Wiki? Send feedback