[ntp:questions] what is refid in ntpq -pn [sorta OT: field sizes]

Brian Inglis Brian.Inglis at SystematicSw.ab.ca
Mon May 8 04:50:41 UTC 2017


On 2017-05-07 17:22, Richard Thomas wrote:
> On May 6, 2017, at 2:39 PM, David Woolley wrote:
>> On 06/05/17 22:24, Hans Mayer wrote:
>>> I always thought "refid" for command "ntpq -pn" shows the next
>>> upstream server for the remote server listed below "remote". But
>>> now I have my concerns.
>> Officially, it is an opaque 32 bit identifier for the selected
>> upstream peer of the peer. You are not supposed to assume it has
>> any more meaning, even though, on pure IPv4 systems, it is derived
>> in the way you describe.
>> Note that the selected peer is not the only source of time; it is
>> just the one used for the quality parameters.

You should see a hash value for all addresses from ntpq -c apeers 
which shrinks the reference id from 15 to 8 chars to make room for 
the association id.

> While we’re on the topic of the ’ntpq -p’ display, the days of 80x24
> screens are long since gone. How much work would it be to increase
> the size of the first column of the output so that it had enough
> space for a full IPv6 address?

Have you tried e.g.

	ntpq -wp

For *peers output, -w outputs the full DNS name of the source  and 
wraps to and indents the rest of the output on the next line if the 
full DNS name exceeds 15 chars; this also displays correctly if you 
specify more than one host to which you have access after the command:

	ntpq -wp localhost remotehost

the output for each host is preceded by the host name padded to the 
length of the longest host name, and a space, with no wrapping except 
after long full DNS names e.g.

$ ntpq -wp w10 rpi
server      remote           refid      st t when poll reach   delay   offset  jitter
=====================================================================================
W10    oGPS_NMEA(2)     .GPS.            0 l    8   16  377    0.000    0.036   0.007
W10    +RPi             .GPS.            1 s    7   16  377    0.570   -0.043   0.067
W10    +utcnist2.colorado.edu
                        .NIST.           1 u   58   64  377   65.617    1.934   2.611
W10    +nisttime.edzone.net
                        .ACTS.           1 u   29   64  377   50.604    0.737   2.627
W10    -montpelier.ilan.caltech.edu
                        .GPS.            1 u   36   64  377   71.282    9.640   0.740
W10    -tick.ucla.edu   .GPS.            1 u   18   64  377   70.937    9.713   0.497
W10    -tick.usnogps.navy.mil
                        .PTP.            1 u   51   64  377  130.779   -1.981   2.250
W10    -ns2.cs.cpsc.ucalgary.ca
                        136.159.2.249    2 u   46   64  377   11.856    2.459   0.956
W10    -SUE.CC.UREGINA.CA
                        142.3.100.2      2 u   50   64  377   30.368   -2.246   2.860
server      remote           refid      st t when poll reach   delay   offset  jitter
=====================================================================================
RPi    oGPS_NMEA(0)     .GPS.            0 l    8   16  377    0.000    0.000   0.002
RPi    +W10             .GPS.            1 s   15   16  376    0.685    0.078   0.044
RPi    +utcnist2.colorado.edu
                        .NIST.           1 u   20   64  377   65.539    2.283   4.818
RPi    +nisttime.edzone.net
                        .ACTS.           1 u   40   64  377   47.830    2.118   0.555
RPi    -montpelier.ilan.caltech.edu
                        .GPS.            1 u   19   64  377   71.554    9.114   0.951
RPi    -tick.ucla.edu   .GPS.            1 u   15   64  377   70.967    9.301   1.268
RPi    -tock.usnogps.navy.mil
                        .PTP.            1 u   56   64  377  130.817   -2.019   5.395
RPi    -ns2.cs.cpsc.ucalgary.ca
                        136.159.2.249    2 u   32   64  377   11.931    2.887   0.468
RPi    -SUE.CC.UREGINA.CA
                        142.3.100.2      2 u    7   64  377   29.483   -2.648   0.595

[Sorry if my email client, yours, or the list, wraps the output]

If you would like support for wider output without wrapping, 
please submit an ntpq enhancement request for e.g. -W /n/ to 
bugzilla, and optionally include a patch against the current 
ntpq stable source ;^> 

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada


More information about the questions mailing list