# Local ntp-server's strata too high (does not synch?)

## Thiemo

Hi,

I am trying to set up a ntpd server for my lan. However, I cannot make the clients use it. I found that the strata of my ntp server is too high.

```
ntpdate -vd ntp.thiam.ch

14 Aug 23:10:45 ntpdate[17881]: ntpdate 4.1.2@1.892 Tue Aug 12 00:54:43 CEST 2003 (1)

transmit(192.168.0.253)

receive(192.168.0.253)

transmit(192.168.0.253)

receive(192.168.0.253)

transmit(192.168.0.253)

receive(192.168.0.253)

transmit(192.168.0.253)

receive(192.168.0.253)

transmit(192.168.0.253)

192.168.0.253: Server dropped: strata too high

server 192.168.0.253, port 123

stratum 16, precision -16, leap 11, trust 000

refid [0.0.0.0], delay 0.02573, dispersion 0.00000

transmitted 4, in filter 4

reference time:    00000000.00000000  Thu, Feb  7 2036  7:28:16.000

originate timestamp: c2e67955.75622813  Thu, Aug 14 2003 23:10:45.458

transmit timestamp:  c2e67955.b55f56a7  Thu, Aug 14 2003 23:10:45.708

filter delay:  0.02599  0.02574  0.02573  0.02573

         0.00000  0.00000  0.00000  0.00000

filter offset: -0.24993 -0.25002 -0.25002 -0.25002

         0.000000 0.000000 0.000000 0.000000

delay 0.02573, dispersion 0.00000

offset -0.250023

14 Aug 23:10:45 ntpdate[17881]: no server suitable for synchronization found
```

I read at http://www.redhat.com/archives/rhl-beta-list/2003-August/msg00027.html

that "starta too high" is because my server does not get synched. So I checked the log file after a restart and apparingly it does not synch.

```
nyffeltrach root # /etc/init.d/ntpd restart && date && sleep 5 && tail -n 30 /var/log/ntpd.log

 * Stopping ntpd...                                                                                            [ ok ]

 * Initializing clock via ntpdate...                                                                           [ ok ]

 * Starting ntpd...                                                                                            [ ok ]

Don Aug 14 23:21:33 CEST 2003

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:11 ntpd[12293]: server returns a permission denied error

14 Aug 23:20:36 ntpd[12288]: ntpd exiting on signal 15

14 Aug 23:20:38 ntpd[12343]: frequency initialized 0.000 from /var/lib/misc/ntp.drift

14 Aug 23:20:38 ntpd[12348]: signal_no_reset: signal 17 had flags 4000000

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: server returns a permission denied error

14 Aug 23:20:40 ntpd[12348]: signal_no_reset: signal 14 had flags 4000000

14 Aug 23:20:41 ntpd[12293]: parent died before we finished, exiting

14 Aug 23:21:32 ntpd[12343]: ntpd exiting on signal 15

14 Aug 23:21:33 ntpd[12397]: frequency initialized 0.000 from /var/lib/misc/ntp.drift

14 Aug 23:21:33 ntpd[12402]: signal_no_reset: signal 17 had flags 4000000

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: server returns a permission denied error

14 Aug 23:21:36 ntpd[12402]: signal_no_reset: signal 14 had flags 4000000

nyffeltrach root #
```

I put all my servers defined in /etc/ntp.conf

```
erver ntp1.tuxfamily.net               # 80.67.177.2

server ntp.univ-lyon1.fr                # 134.214.100.6

server ntp2.belbone.be                  # 195.13.1.153

server ntp.karpo.cz                     # 217.11.227.68

# Unknown type

server time.euro.apple.com              # 194.151.19.93

server ntp.unizar.es                    # 155.210.1.2

server hora.usc.es                      # 193.144.75.20

restrict 192.168.0.0 mask 255.255.255.0 notrust nomodify notrap

restrict default notrust nomodify

```

 into /etc/conf.d/ntp NTPDATE_OPTS

```
NTPDATE_WARN="y"

NTPDATE_CMD="ntpdate"

NTPDATE_OPTS="-b time.euro.apple.com"

```

 but it was fruitless. That ntp does not work with these servers is very strange, for me, as

```
nyffeltrach misc # ntpdate -vd time.euro.apple.com

14 Aug 23:42:09 ntpdate[12449]: ntpdate 4.1.1b@1.829 Sat Apr  5 23:33:31 CEST 2003 (1)

transmit(17.72.133.42)

receive(17.72.133.42)

transmit(17.72.133.42)

receive(17.72.133.42)

transmit(17.72.133.42)

receive(17.72.133.42)

transmit(17.72.133.42)

receive(17.72.133.42)

transmit(17.72.133.42)

server 17.72.133.42, port 123

stratum 2, precision -17, leap 00, trust 000

refid [17.72.133.55], delay 0.17586, dispersion 0.00084

transmitted 4, in filter 4

reference time:    c2e68074.635a426b  Thu, Aug 14 2003 23:41:08.388

originate timestamp: c2e680b1.dc1ffb48  Thu, Aug 14 2003 23:42:09.859

transmit timestamp:  c2e680b1.a8ae1049  Thu, Aug 14 2003 23:42:09.658

filter delay:  0.17586  0.18105  0.17621  0.17940

         0.00000  0.00000  0.00000  0.00000

filter offset: 0.124330 0.123505 0.122997 0.124026

         0.000000 0.000000 0.000000 0.000000

delay 0.17586, dispersion 0.00084

offset 0.124330

14 Aug 23:42:09 ntpdate[12449]: adjust time server 17.72.133.42 offset 0.124330 sec

```

seems to work perfectly well.

Does somebody know how to lower my strata, make my ntp server synch?

Cheers,

Thiemo

----------

## lami

After some searching I discovered this:

Your local ntp server needs to be synchronized with some other to lower it's stratum. So make sure it can connect to parent NTP server. You can use ntpq command to connect to local ntp server. Then use pe command to view status:

```
diana root # ntpq

ntpq> pe

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

 adm.globe.cz    stratum.eunet.c  2 u   41   64    7    1.263   15.859  23.787

 mail.contactel. ntp0-rz.rrze.un  2 u   45   64    7    3.961   16.699  24.648

```

There should be something other than zero in reach column and probably some non-zero values in delay, offset and jitter (like in code above).

When you can connect, you have to wait a while, until ntpd calibrates your clock - it needs to know difference over time, so it can adjust it continuously. It takes about 15 minutes to sync. Your stratum value will be lower after some time. You can check your current stratum value using rv command inside ntpq:

```
ntpq> rv

status=c011 sync_alarm, sync_unspec, 1 event, event_restart,

version="ntpd 4.1.1b@1.829 Thu Jul 31 14:38:47 CEST 2003 (1)",

processor="i686", system="Linux2.4.20-gentoo-r5", leap=11, stratum=16,

precision=-18, rootdelay=0.000, rootdispersion=2.925, peer=0,

refid=0.0.0.0, reftime=00000000.00000000  Thu, Feb  7 2036  7:28:16.000,

poll=4, clock=c3105c69.8d1f2dc2  Mon, Sep 15 2003 17:42:33.551, state=1,

offset=0.000, frequency=0.000, jitter=0.004, stability=0.000

ntpq> rv

status=0644 leap_none, sync_ntp, 4 events, event_peer/strat_chg,

version="ntpd 4.1.1b@1.829 Thu Jul 31 14:38:47 CEST 2003 (1)",

processor="i686", system="Linux2.4.20-gentoo-r5", leap=00, stratum=3,

precision=-18, rootdelay=15.984, rootdispersion=30.309, peer=41332,

refid=adm.globe.cz,

reftime=c3105e36.9a7e5215  Mon, Sep 15 2003 17:50:14.603, poll=7,

clock=c3105ea8.266bb55a  Mon, Sep 15 2003 17:52:08.150, state=4,

offset=-5.197, frequency=-35.498, jitter=9.186, stability=5.073

```

First report was generated shortly after restarting ntpd, you can see stratum=16 (look at the end of 3rd line). Second one is after 10 minutes. Stratum is 3 now. Now your clients can sync it's clock using your server:

```
root@asuka:~# ntpdate -vd diana

15 Sep 17:52:43 ntpdate[28987]: ntpdate 4.1.1a@1.791 Wed May 29 19:52:32 PDT 2002 (1)

transmit(10.0.0.2)

receive(10.0.0.2)

transmit(10.0.0.2)

receive(10.0.0.2)

transmit(10.0.0.2)

receive(10.0.0.2)

transmit(10.0.0.2)

receive(10.0.0.2)

transmit(10.0.0.2)

server 10.0.0.2, port 123

stratum 3, precision -18, leap 00, trust 000

refid [81.95.96.3], delay 0.02580, dispersion 0.00000

transmitted 4, in filter 4

reference time:    c3105eb7.9954da4c  Mon, Sep 15 2003 17:52:23.598

originate timestamp: c3105ecb.a6ef1bac  Mon, Sep 15 2003 17:52:43.652

transmit timestamp:  c3105ecb.8a4b33da  Mon, Sep 15 2003 17:52:43.540

filter delay:  0.02602  0.02586  0.02582  0.02580 

         0.00000  0.00000  0.00000  0.00000 

filter offset: 0.111748 0.111769 0.111761 0.111755

         0.000000 0.000000 0.000000 0.000000

delay 0.02580, dispersion 0.00000

offset 0.111755

15 Sep 17:52:43 ntpdate[28987]: adjust time server 10.0.0.2 offset 0.111755 sec
```

I guess your stratum will be one less than stratum of your "parent" ntp server, so it will be 3 in most cases.

----------

## lami

I missed part of your post, so most of my post was useless. You have to allow access from other servers. I am not sure how exactly say: "these server are my parent, these are client and rest go away", but this is my working configuration:

```
server ntp.globe.cz

server ntp1.contactel.cz

logfile         /var/log/ntpd.log

driftfile       /var/lib/misc/ntp.drift

restrict default nomodify

restrict ntp.globe.cz

restrict ntp1.contactel.cz

restrict 10.0.0.0 mask 255.255.255.0

restrict 127.0.0.1
```

----------

## Thiemo

Briallant!

Thanks lami. You helped me a lot. Both of your postings were necessairy.  :Wink: 

I actually almost had given up.

Cheers

Thiemo

----------

