f



proprietary hardware clock as NTP reference source

Hello list,

I have a set of proprietary hardware timing cards (Symmetricom
bc635PCIe) which synchronize their clocks using a dedicated
interconnect.  As you might imagine the timing card conditioned time
drifts from that of the hosts they're installed in.

What I'd like to do is make the "master" timing card's time into a NTP
reference clock then use NTP to distribute that time to the other
hosts in the (private) network.

I've looked at Orphan mode and undisciplined local clocks but they
only refer to the host's software clock if I'm not mistaken.  I've
also searched through the archive but I'm afraid I lack the
appropriate terminology to get meaningful results.

Can someone point me toward (some google words maybe) creating an
arbitrary NTP reference source (under Linux)?  I think I'm just
missing something very basic.

I've been looking at the LinuxPPS project as these cards output a PPS
that I might use to condition the host clock using Linux PPS but I
don't have a 8250 serial port on these new fangled PCs.

TIA!
Andy
0
apobrien
6/11/2010 9:26:13 PM
comp.protocols.time.ntp 4895 articles. 2 followers. Post Follow

6 Replies
1088 Views

Similar Articles

[PageSpeed] 45

In article <40aa2d27-9826-4948-a405-e5b311358eba@z8g2000yqz.googlegroups.com>,
 apobrien <apobrienster@gmail.com> writes:
>Hello list,
>
>I have a set of proprietary hardware timing cards (Symmetricom
>bc635PCIe) which synchronize their clocks using a dedicated
>interconnect.  As you might imagine the timing card conditioned time
>drifts from that of the hosts they're installed in.
>
>What I'd like to do is make the "master" timing card's time into a NTP
>reference clock then use NTP to distribute that time to the other
>hosts in the (private) network.
>
>I've looked at Orphan mode and undisciplined local clocks but they
>only refer to the host's software clock if I'm not mistaken.  I've
>also searched through the archive but I'm afraid I lack the
>appropriate terminology to get meaningful results.
>
>Can someone point me toward (some google words maybe) creating an
>arbitrary NTP reference source (under Linux)?  I think I'm just
>missing something very basic.
>
>I've been looking at the LinuxPPS project as these cards output a PPS
>that I might use to condition the host clock using Linux PPS but I
>don't have a 8250 serial port on these new fangled PCs.
>
>TIA!
>Andy

I think you have two choices.

One is to write a stand alone program that talks to your hardware
and puts the info into shared memory where the shared-memory driver
(driver 28) can get it.  gpsd works this way.

The other is to write your own refclock-driver.  The usual
approach is to find a driver that is as close as you can get
and modify it.  If your changes are small and don't break the
old moce, you may be able to convince the ntp project to merge
them into the main source package.

It may be tricky to get started this way.  The best documentation
is to read the code.  There is some overview here, but it
probably won't help much until you look at the code:
  http://www.cis.udel.edu/~mills/ntp/html/howto.html

-- 
These are my opinions, not necessarily my employer's.  I hate spam.

0
hal
6/12/2010 1:30:12 AM
On 2010-06-11, apobrien <apobrienster@gmail.com> wrote:
> Hello list,
>
> I have a set of proprietary hardware timing cards (Symmetricom
> bc635PCIe) which synchronize their clocks using a dedicated
> interconnect.  As you might imagine the timing card conditioned time
> drifts from that of the hosts they're installed in.
>
> What I'd like to do is make the "master" timing card's time into a NTP
> reference clock then use NTP to distribute that time to the other
> hosts in the (private) network.
>
> I've looked at Orphan mode and undisciplined local clocks but they
> only refer to the host's software clock if I'm not mistaken.  I've
> also searched through the archive but I'm afraid I lack the
> appropriate terminology to get meaningful results.
>
> Can someone point me toward (some google words maybe) creating an
> arbitrary NTP reference source (under Linux)?  I think I'm just
> missing something very basic.
>
> I've been looking at the LinuxPPS project as these cards output a PPS
> that I might use to condition the host clock using Linux PPS but I
> don't have a 8250 serial port on these new fangled PCs.

Use shmpps. It uses the shm driver to input the PPS to ntp. It requires
that you have some other source to derive the seconds from (I, PPS can
allow ntp to condition to the exact second, but has no idea which second
it is conditioning to) That serial port is used to input the PPS and the
seconds. How would you input the PPS in your case?
>
> TIA!
> Andy
0
unruh
6/12/2010 2:46:15 AM
On Fri, Jun 11, 2010 at 02:26:13PM -0700, apobrien wrote:
> Hello list,
> 
> I have a set of proprietary hardware timing cards (Symmetricom
> bc635PCIe) which synchronize their clocks using a dedicated
> interconnect.  As you might imagine the timing card conditioned time
> drifts from that of the hosts they're installed in.
> 
> What I'd like to do is make the "master" timing card's time into a NTP
> reference clock then use NTP to distribute that time to the other
> hosts in the (private) network.
> 
> I've looked at Orphan mode and undisciplined local clocks but they
> only refer to the host's software clock if I'm not mistaken.  I've
> also searched through the archive but I'm afraid I lack the
> appropriate terminology to get meaningful results.
> 
> Can someone point me toward (some google words maybe) creating an
> arbitrary NTP reference source (under Linux)?  I think I'm just
> missing something very basic.
> 
> I've been looking at the LinuxPPS project as these cards output a PPS
> that I might use to condition the host clock using Linux PPS but I
> don't have a 8250 serial port on these new fangled PCs.
> 
> TIA!
> Andy
> 
> _______________________________________________
> questions mailing list
> questions@lists.ntp.org
> http://lists.ntp.org/listinfo/questions
Symmetricomm has a kernel mode driver for the bc635/7 cards, for Linux. 
If you have a copy you can use ntp reference clock 22 (bancomm) to 
feed the time to NTP

refclock 127.127.16.u mode 2 
	in the config file, where u is whatever unit your card presents as. 

The Symmetricom driver is proprietary, they charge for it, btw. 
0
Rob
6/13/2010 4:21:58 AM
On Sun, Jun 13, 2010 at 04:21:58AM +0000, Rob Neal wrote:
> On Fri, Jun 11, 2010 at 02:26:13PM -0700, apobrien wrote:
> > Hello list,
> > 
> > I have a set of proprietary hardware timing cards (Symmetricom
> > bc635PCIe) which synchronize their clocks using a dedicated
> > interconnect.  As you might imagine the timing card conditioned time
> > drifts from that of the hosts they're installed in.
> > 
> > What I'd like to do is make the "master" timing card's time into a NTP
> > reference clock then use NTP to distribute that time to the other
> > hosts in the (private) network.
> > 
> > I've looked at Orphan mode and undisciplined local clocks but they
> > only refer to the host's software clock if I'm not mistaken.  I've
> > also searched through the archive but I'm afraid I lack the
> > appropriate terminology to get meaningful results.
> > 
> > Can someone point me toward (some google words maybe) creating an
> > arbitrary NTP reference source (under Linux)?  I think I'm just
> > missing something very basic.
> > 
> > I've been looking at the LinuxPPS project as these cards output a PPS
> > that I might use to condition the host clock using Linux PPS but I
> > don't have a 8250 serial port on these new fangled PCs.
> > 
> > TIA!
> > Andy
> > 
> > _______________________________________________
> > questions mailing list
> > questions@lists.ntp.org
> > http://lists.ntp.org/listinfo/questions
> Symmetricomm has a kernel mode driver for the bc635/7 cards, for Linux. 
> If you have a copy you can use ntp reference clock 22 (bancomm) to 
> feed the time to NTP
> 
> refclock 127.127.16.u mode 2 
> 	in the config file, where u is whatever unit your card presents as. 
> 
> The Symmetricom driver is proprietary, they charge for it, btw. 
> 
> _______________________________________________
> questions mailing list
> questions@lists.ntp.org
> http://lists.ntp.org/listinfo/questions

ur, refclock 16 is bancomm, not 22, sorry. 22 is the ATOM driver. Sorry
for the confusion. 
0
Rob
6/13/2010 6:35:37 PM
On Jun 13, 12:21=A0am, Rob Neal <hun...@comcast.net> wrote:
> On Fri, Jun 11, 2010 at 02:26:13PM -0700, apobrien wrote:
> > Hello list,
>
> > I have a set of proprietary hardware timing cards (Symmetricom
> > bc635PCIe) which synchronize their clocks using a dedicated
> > interconnect. =A0As you might imagine the timing card conditioned time
> > drifts from that of the hosts they're installed in.
>
> > What I'd like to do is make the "master" timing card's time into a NTP
> > reference clock then use NTP to distribute that time to the other
> > hosts in the (private) network.
>
> > I've looked at Orphan mode and undisciplined local clocks but they
> > only refer to the host's software clock if I'm not mistaken. =A0I've
> > also searched through the archive but I'm afraid I lack the
> > appropriate terminology to get meaningful results.
>
> > Can someone point me toward (some google words maybe) creating an
> > arbitrary NTP reference source (under Linux)? =A0I think I'm just
> > missing something very basic.
>
> > I've been looking at the LinuxPPS project as these cards output a PPS
> > that I might use to condition the host clock using Linux PPS but I
> > don't have a 8250 serial port on these new fangled PCs.
>
> > TIA!
> > Andy
>
> > _______________________________________________
> > questions mailing list
> > questi...@lists.ntp.org
> >http://lists.ntp.org/listinfo/questions
>
> Symmetricomm has a kernel mode driver for the bc635/7 cards, for Linux.
> If you have a copy you can use ntp reference clock 22 (bancomm) to
> feed the time to NTP
>
> refclock 127.127.16.u mode 2
> =A0 =A0 =A0 =A0 in the config file, where u is whatever unit your card pr=
esents as.
>
> The Symmetricom driver is proprietary, they charge for it, btw.

Thanks Rob, both for updating the driver and for alerting me to its
existence.  It's exactly what I was looking for.

For those interested, here are the steps I followed to get it working
using Symmetricom's newer Linux software development kit (SDK).  These
instructions reference ntp-4.2.6p2-RC6.

1) install the SDK by following their documentation.  Copy the shared
library file, libbcsdk.so, to a standard directory (I used /usr/lib/
libbcsdk.so)

2) link the default SDK device file to the file expected by the
Bancomm reference clock driver: ln -s /dev/windrvr6 /dev/btfp0

3) untar the ntp source and modify ntpd/Makefile.am line 91 from

  ntpd_LDADD =3D $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm
@LCRYPTO@ @LSCF@
    to
  ntpd_LDADD =3D $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm -
lbcsdk @LCRYPTO@ @LSCF@

4) configure the source with the --enable-BANCOMM option.  I used ./
configure --enable-BANCOMM --enable-clockctl

5) make, make install.  If it doesn't compile complaining about
MOD_NANO, add the line
   #define MOD_NANO ADJ_NANO somewhere in ntpd/ntp_loopfilter.c

6) edit ntp.conf as Rob suggests:  I'm using
  server 127.127.16.0 prefer mode 2 burst minpoll 4

After only a few minutes of operation the timing card and system clock
average only 2 microseconds disagreement with a [-0.000046, 0.000137]
range over 1,500,000 samples taken over a ~5 second interval!

Thanks Rob!
0
apobrien
6/17/2010 3:59:56 PM
Andy-

Thanks for the great instructions. I had some trouble and thought I
would share my solution for others. I followed your instructions to
the letter except I used the final release of 4.2.6p2 and did not need
to do step 5.

Nonetheless I could not get ntpd to start if I had the server options
you suggest (prefer mode 2...). I could start the server without any
options, but then you don't sync. You see these error messages in the
kernel log:

vme_start: RUNLOCK failed Inappropriate ioctl for device
vme_start: WCR0 failed Inappropriate ioctl for device

Turns out that, even though I modified Makefile.am as you suggested,
the changes were not ending up being reflected in the Makefile itself.
So I hacked the Makefile to add the linking to lbcsdk and it worked.
NTPD was not being linked against the shared library and thus the
implicit definition of ioctl (you'll notice compiler warnings about
the implicit definition for refclock_bancomm.c) was never explicitly
linked.

Now things look great. Thought I would share if others have the same
problem. There's probably a cleaner way of doing this, but it works.

Tom

On Jun 17, 8:59=A0am, apobrien <apobriens...@gmail.com> wrote:
> On Jun 13, 12:21=A0am, Rob Neal <hun...@comcast.net> wrote:
>
> > On Fri, Jun 11, 2010 at 02:26:13PM -0700, apobrien wrote:
> > > Hello list,
>
> > > I have a set of proprietary hardware timing cards (Symmetricom
> > > bc635PCIe) which synchronize their clocks using a dedicated
> > > interconnect. =A0As you might imagine the timing card conditioned tim=
e
> > > drifts from that of the hosts they're installed in.
>
> > > What I'd like to do is make the "master" timing card's time into a NT=
P
> > > reference clock then use NTP to distribute that time to the other
> > > hosts in the (private) network.
>
> > > I've looked at Orphan mode and undisciplined local clocks but they
> > > only refer to the host's software clock if I'm not mistaken. =A0I've
> > > also searched through the archive but I'm afraid I lack the
> > > appropriate terminology to get meaningful results.
>
> > > Can someone point me toward (some google words maybe) creating an
> > > arbitrary NTP reference source (under Linux)? =A0I think I'm just
> > > missing something very basic.
>
> > > I've been looking at the LinuxPPS project as these cards output a PPS
> > > that I might use to condition the host clock using Linux PPS but I
> > > don't have a 8250 serial port on these new fangled PCs.
>
> > > TIA!
> > > Andy
>
> > > _______________________________________________
> > > questions mailing list
> > > questi...@lists.ntp.org
> > >http://lists.ntp.org/listinfo/questions
>
> > Symmetricomm has a kernel mode driver for the bc635/7 cards, for Linux.
> > If you have a copy you can use ntp reference clock 22 (bancomm) to
> > feed the time to NTP
>
> > refclock 127.127.16.u mode 2
> > =A0 =A0 =A0 =A0 in the config file, where u is whatever unit your card =
presents as.
>
> > The Symmetricom driver is proprietary, they charge for it, btw.
>
> Thanks Rob, both for updating the driver and for alerting me to its
> existence. =A0It's exactly what I was looking for.
>
> For those interested, here are the steps I followed to get it working
> using Symmetricom's newer Linux software development kit (SDK). =A0These
> instructions reference ntp-4.2.6p2-RC6.
>
> 1) install the SDK by following their documentation. =A0Copy the shared
> library file, libbcsdk.so, to a standard directory (I used /usr/lib/
> libbcsdk.so)
>
> 2) link the default SDK device file to the file expected by the
> Bancomm reference clock driver: ln -s /dev/windrvr6 /dev/btfp0
>
> 3) untar the ntp source and modify ntpd/Makefile.am line 91 from
>
> =A0 ntpd_LDADD =3D $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm
> @LCRYPTO@ @LSCF@
> =A0 =A0 to
> =A0 ntpd_LDADD =3D $(LDADD) $(LIBOPTS_LDADD) ../libntp/libntp.a -lm -
> lbcsdk @LCRYPTO@ @LSCF@
>
> 4) configure the source with the --enable-BANCOMM option. =A0I used ./
> configure --enable-BANCOMM --enable-clockctl
>
> 5) make, make install. =A0If it doesn't compile complaining about
> MOD_NANO, add the line
> =A0 =A0#define MOD_NANO ADJ_NANO somewhere in ntpd/ntp_loopfilter.c
>
> 6) edit ntp.conf as Rob suggests: =A0I'm using
> =A0 server 127.127.16.0 prefer mode 2 burst minpoll 4
>
> After only a few minutes of operation the timing card and system clock
> average only 2 microseconds disagreement with a [-0.000046, 0.000137]
> range over 1,500,000 samples taken over a ~5 second interval!
>
> Thanks Rob!

0
Tom
7/19/2010 11:42:01 PM
Reply: