#2870 new enhancement

Select and port NTP client (ntpd)

Reported by: Sebastian Huber Owned by:
Priority: normal Milestone: Indefinite
Component: unspecified Version:
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

RTEMS lacks support for time synchronization via NTP. For the kernel space part see #2348 and #2349.

There are several NTP clients available.

Candidates for RTEMS:

  1. FreeBSD uses the NTP reference implementation in its base system. This could be used via libbsd.
  1. NTPsec
  1. OpenNTPD: Seems to be less accurate compared to the reference implementation.
  1. chrony: GPLv2
  1. SNTP?
  1. Anything else?

Change History (7)

comment:1 Changed on Jan 18, 2017 at 2:08:37 PM by Joel Sherrill

Bad timing on opening this discussion since Chris is on holiday for a few weeks. :(

There is an RSB package for Classic NTP which is not on your list. It has worked in the past but AFAIK the RSB built version has not been tested. Is this the "reference implementation" that is your #1?

I would prefer not to use NTPsec. They did some things right but moved away from threads to libevent. I also don't think they understand or intend to support embedded targets.

Who uses OpenNTPD? The accuracy sounds bad.

chrony is out due to gplv2.

I don't know anything about SNTP.

We could change our initialization to systemd and use that. :) LOL

comment:2 Changed on Jan 18, 2017 at 3:01:27 PM by Sebastian Huber

How does Classic NTP work without adjtimex() or ntp_adjtime() system calls?

The reference implementation is the one from http://www.ntp.org which should be https://svnweb.freebsd.org/base/head/contrib/ntp/.

comment:3 in reply to:  2 ; Changed on Jan 18, 2017 at 3:19:21 PM by Joel Sherrill

Replying to sebastian.huber:

How does Classic NTP work without adjtimex() or ntp_adjtime() system calls?

In the dark ages of the last century when I ported it, it used adjtime. One of the things Harlan wanted to do was improve the interface to RTEMS. But we also needed work. With the many changes to RTEMS, it may be easier to do than when we discussed this.

The reference implementation is the one from http://www.ntp.org which should be https://svnweb.freebsd.org/base/head/contrib/ntp/.

This is what Chris and I refer to as NTP Classic. It was used as the starting point for NTPsec. IMO NTPsec started out in the right direction by updating to C99 and POSIX 2001. They dropped support for any target not available/supported for over a certain length of time. That significantly reduced the code base without altering the design of the reference implementation (e.g. NTP Classic). Then they decided to start making technical changes and switched from the multi-threaded model in NTP Classic to libevent. Email Chris and I for more details.

comment:4 Changed on Jan 18, 2017 at 4:38:41 PM by punitvara

I have interfaced this
http://doolittle.icarus.com/ntpclient/ntpclient_2015_365.tar.gz
last year in one of the project in my previous company for embedded project. I suggest to look at this code if we can integrate this to RTEMS.

comment:5 Changed on Jan 19, 2017 at 6:13:46 AM by Sebastian Huber

Since we use the FreeBSD timecounters now for timekeeping we can use the ntp_adjtime() support from FreeBSD, see #2348.

comment:6 in reply to:  3 Changed on Jan 19, 2017 at 6:19:35 AM by Sebastian Huber

Replying to joel.sherrill:

Replying to sebastian.huber:

The reference implementation is the one from http://www.ntp.org which should be https://svnweb.freebsd.org/base/head/contrib/ntp/.

This is what Chris and I refer to as NTP Classic. It was used as the starting point for NTPsec. IMO NTPsec started out in the right direction by updating to C99 and POSIX 2001. They dropped support for any target not available/supported for over a certain length of time. That significantly reduced the code base without altering the design of the reference implementation (e.g. NTP Classic). Then they decided to start making technical changes and switched from the multi-threaded model in NTP Classic to libevent. Email Chris and I for more details.

It seems the SNTP client of NTP Classic uses the libevent too https://svnweb.freebsd.org/base/head/contrib/ntp/sntp/libevent/.

comment:7 Changed on Aug 14, 2017 at 12:14:33 AM by Chris Johns

Milestone: 5.0Indefinite
Version: 4.11
Note: See TracTickets for help on using tickets.