NTP (network time protocol) is a protocol which is used to synchronize time on computers, devices. In operating system like ubuntu we can use ntpq to synchronize the time. In this post we will understand in detailed output of ntpq command. NTP configuration is kept under file /etc/ntp.conf file. We will get below kind of output when we will run the command.
Explanation of output of ntpq command
refid – Where or what the remote peer or server is itself synchronised to.
stratum: the devices which are considered independent time sources are classified as stratum 0 sources; the servers directly connected to stratum 0 devices are classified as stratum 1 sources; servers connected to stratum 1 sources are then classified as stratum 2 sources and so on
t – Type (u: unicast or manycast client, b: broadcast or multicast client, l: local reference clock, s: symmetric peer, A: manycast server, B: broadcast server, M: multicast server
when: number of seconds passed since last response.
poll: poll interval. NTP Client sends NTP packets at intervals ranging from 8 s to 36 hr
reach: The reach peer variable is an 8-bit shift register displayed in octal format. When a valid packet is received, the rightmost bit is lit. When a packet is sent, the register is shifted left one bit with 0 replacing the rightmost bit. If the reach value is nonzero, the server is reachable; otherwise, it is unreachable.
delay: The round-trip delay to peer is reported in milliseconds.
offset: Offset is the time difference between the peers or between the server and client.
In the output of peer command you can see there are few characters the meaning of those characters is as follows:
* Synchronized to this peer
# Almost synchronized to this peer
+ Peer selected for possible synchronization
– Peer is a candidate for selection
~ Peer is statically configured
Hope you have now understood the output of ntpq command.