TSC-I2: A Lightweight Implementation for Precision-Augmented Timekeeping

October 1st, 2005

Categories: Networking

Network application open sourcing
Network application open sourcing

Authors

Luo, X., Boote, J.

About

The quality of timekeeping is critical for many network protocols and measurement tools. Software packages, such as UDT (UDP-based Data Transfer), ThruLay (Throughput and Delay) and OWAMP (Oneway Ping), make control decisions and network statistics by checking the timestamps on the sent / received packets, which are normally labeled according to the system clock. Although when synchronized with NTP (Network Time Protocol), system clock could achieve satisfying accuracy, its precision is still a problem at microsecond level.

For example, most Linux kernels update their system time counters at 10-millisecond interval, and get the time in-between by interpolating TSC (CPU frequency counter) register. As interpolation parameters are obtained at start-up and TSC register subject to frequency wander, the interpolated time’s precision is questionable. TSC-I2 (TSC-Internet2) is devised to address the precision problem mentioned above.

The basic idea is to make TSC rate calibration a continuous process, thus the accuracy of interpolation parameters could be ensured, which in turn results in satisfying clock precision.

TSC-I2 maintains a soft clock of its own, compares this clock to system clock periodically. During each comparison, it synchronizes itself with the system clock, and adjusts the interpolation rate based on the offset and rate errors regarding to system clock. Whenever the accuracy of the soft clock is ensured, TSC-I2 uses this clock to report time to the library user; otherwise, the system clock value is reported.

The advantage of this design is that system clock is enhanced rather than substituted.

Resources

PDF

Citation

Luo, X., Boote, J., TSC-I2: A Lightweight Implementation for Precision-Augmented Timekeeping, Dr. Dobb’s Journal, October 2005 Issue, October 1st, 2005.