GSoC/GCI Archive
Google Summer of Code 2013 Network Time Foundation

Gsoc 2013 Proposal : System clock startup analysis

by Rahul Katare for Network Time Foundation

Ntpd program is an operating system daemon which sets and maintains system time of the day in synchronism with internet standard time servers. It operates by exchanging one or more messages with one or more configured servers at designated poll intervals. Ntpd currently applies small corrections (-500, 0 or 500 ppm discrete corrections) to the system time every second. If ntpd uses adjtime(), it updates the system clock every second. But some clock implementations do not provide small update to system clock. So there is a clock model which provides a kernel discipline called ntp_adjtime() which is used by Ntpd to adjust several parameters of the clock. References : http://www.ntp.org/ntpfaq/NTP-s-algo.htm and http://www.ntp.org/ntpfaq/NTP-s-algo-kernel.htm. There are two aspects to time corrections, applying an offset and adjusting the clock-frequency. The idea here is to perform a startup analysis of the time offset and the frequency correction that needs to be applied. The objective is to, first collect the data from N servers, using that calculate the offset and frequency adjustment that needs to be done.