Previous section   Next section

Recipe 14.16 Checking the NTP Status

14.16.1 Problem

You want to verify the status of NTP on your router to make sure it's running properly.

14.16.2 Solution

Use the NTP and clock show commands to verify the status of NTP on your router. The best place to start is the show clock detail command, which provides information on the current time, time source, and time zone configuration:

Router>show clock detail 
14:05:04.299 EST Mon Mar 10 2003
Time source is user configuration
Summer time starts 02:00:00 EST Sun Apr 6 2003
Summer time ends 02:00:00 EDT Sun Oct 26 2003
Router>

To display the current NTP status of the local router, the command is:

Router>show ntp status

The command to display the current NTP associations is:

Router>show ntp associations 

You can display detailed information about the current NTP associations with the following command:

Router>show ntp associations detail 

14.16.3 Discussion

You can view the current clock status using the show clock detail command:

Router>show clock detail 
.23:13:41.415 EST Sun Mar 16 2003
Time source is NTP
Summer time starts 02:00:00 EST Sun Apr 6 2003
Summer time ends 02:00:00 EDT Sun Oct 26 2003
Router>

In this example, the router's current date and time are correctly set, but notice the period in front of the time (some routers display an asterisk instead of a period). This indicates that NTP is unsynchronized. The router will put this indicator in the output of show commands and in log messages. This allows you to spot problems with NTP even when you are not specifically looking for timing issues.

This command also provides valuable information on time zone and Daylight Saving Time. The router in the previous example is set to Eastern Standard Time (EST) and observes Daylight Saving Time.

To display detailed NTP status information, use the following show command:

Router>show ntp status
Clock is synchronized, stratum 4, reference is 172.16.2.1
nominal freq is 250.0000 Hz, actual freq is 249.9976 Hz, precision is 2**18
reference time is C03AA3D1.64A71D43 (23:21:37.393 EST Wed Mar 13 2003)
clock offset is -0.6743 msec, root delay is 99.95 msec
root dispersion is 1940.67 msec, peer dispersion is 1876.65 msec
Router>

In this example, the router is synchronized to NTP server 172.16.2.1 and is acting as a Stratum 4 NTP server. This means that this router is four NTP "hops" away from the authoritative clock and that it is using the server 172.16.2.1 as its master time source. Any clock status other than "synchronized" indicates problems.

To display the status of all NTP associations, use the following command:

Router>show ntp associations 
      address         ref clock     st  when  poll reach  delay  offset    disp
+~172.25.1.1       192.5.41.40       2   148  1024  377    30.0   33.66     8.0
*~172.25.1.3       192.5.41.40       2    42  1024  377    31.3  -69.53    10.8
+~172.25.1.5       172.25.1.3        3   780  1024  377    31.9  -107.7    26.1
* master (synced), # master (unsynced), + selected, - candidate, ~ configured
Router>

This command gives a table of outbound NTP associations and their current status, but it does not display the current inbound NTP associations that are receiving time from this router. It shows only those NTP associations that have been explicitly configured, as well as any broadcast and multicast servers that have been discovered.

There is a lot of useful information in this example. The most important is the NTP synchronization status for each destination. The special characters on the far left indicate the current status of the NTP associations. Table 14-2 shows what these symbols mean.

Table 14-2. NTP peer status codes

Character

Description

*

Synchronized to master

#

Close to synchronization

+

Selected for possible synchronization

-

Candidate for synchronization

~

Statically configured

The previous example displays three synchronized NTP associations, with one of them (172.25.1.3) acting as master. The table also shows the reference clock for each neighbor, the NTP server they are synchronized to, and the current stratum number of each. Finally, the table displays polling information, availability statistics, and clock offset timing. You can view detailed NTP association information by adding the detail keyword:

Router>show ntp associations detail 
172.25.1.1 configured, selected, sane, valid, stratum 2
ref ID 192.5.41.40, time C034F56D.49F8D2E5 (20:56:13.288 UTC Sat Mar 9 2003)
our mode client, peer mode server, our poll intvl 1024, peer poll intvl 1024
root delay 113.69 msec, root disp 67.46, reach 377, sync dist 148.895
delay 29.95 msec, offset 33.6585 msec, dispersion 8.00
precision 2**20, version 3
org time C034F86F.1132617C (21:09:03.067 UTC Sat Mar 9 2003)
rcv time C034F86F.0C6A77E0 (21:09:03.048 UTC Sat Mar 9 2003)
xmt time C034F86F.04B86272 (21:09:03.018 UTC Sat Mar 9 2003)
filtdelay =    29.95   29.77    4.24    5.19    5.20    5.08    5.22    5.26
filtoffset =   33.66   35.53   49.12   46.62   46.97   47.24   47.56   45.92
filterror =     0.02   15.64   31.27   46.91   62.53   78.16   93.78  109.41
   
172.25.1.3 configured, our_master, sane, valid, stratum 2
ref ID 192.5.41.40, time C034F647.75CB252C (20:59:51.460 UTC Sat Mar 9 2003)
our mode client, peer mode server, our poll intvl 1024, peer poll intvl 1024
root delay 135.13 msec, root disp 51.15, reach 377, sync dist 145.172
delay 31.30 msec, offset -69.5341 msec, dispersion 10.82
precision 2**20, version 3
org time C034F8D8.F76E503F (21:10:48.966 UTC Sat Mar 9 2003)
rcv time C034F8D9.0D3CCF79 (21:10:49.051 UTC Sat Mar 9 2003)
xmt time C034F8D9.0531A98E (21:10:49.020 UTC Sat Mar 9 2003)
filtdelay =    31.30   29.75    6.39    5.40    5.34    5.37    5.33    5.34
filtoffset =  -69.53  -66.27  -51.98  -50.29  -50.13  -49.93  -46.16  -43.89
filterror =     0.02   15.64   31.27   46.91   62.53   78.16   93.78  109.41
Router>

This command displays much of the same information, but in greater detail. It also includes several pieces of timer information. The first line of each association is of particular interest. For example, server 172.25.1.3 is currently acting as this router's master, meaning that we are synchronized to it, and that it is acting as a Stratum 2 server with a valid and sane time.


  Previous section   Next section
Top