Pages

Wednesday, January 12, 2011

NTP (Network Timing Protocol)

NTP (Network Timing Protocol)

NTP allows time synchronization in to the source clock. NTP uses UDP port 123 to communicate. There are 3 modes of operation.
- Client
- Server
- Symmetric active mode (peer)

We can statically configure server address or let it discover by itself using broadcast command. In this example below, I will show the configuration of statically address configuration.

Example 
  - Network 192.168.1.1 between R1 and R2
  - Authentication ntp


R1
ntp authentication-key 1 md5 121711075F00091D 7
ntp authenticate
ntp master
!

R2
ntp authentication-key 1 md5 1419061B410F2F32 7
ntp authenticate
ntp trusted-key 1
//Client
ntp server 192.168.1.1 key 1   
//Peer 
ntp peer 192.168.1.1 key 1


Verify configuration 

debug ntp packet
debug ntp authentication
debug ntp event

Mar  1 00:44:37.109:  Authentication key 1
Mar  1 00:44:37.113: NTP: 192.168.1.1 synced to new peer
Mar  1 00:44:37.113: NTP: sync change
Mar  1 00:44:37.113: NTP: peer stratum change
Mar  1 00:44:37.113: NTP: 192.168.1.1 reachable

Check the synchronization between routers

R2#show ntp associations

      address         ref clock     st  when  poll reach  delay  offset    disp
*~192.168.1.1      127.127.7.1       8    30    64   17    59.7  -51.09  1939.3
 * master (synced), # master (unsynced), + selected, - candidate, ~ configured
R2#

R2#sh ntp status
Clock is synchronized, stratum 9, reference is 192.168.1.1
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**18
reference time is C0294E35.201800AA (00:47:49.125 UTC Fri Mar 1 2002)
clock offset is -51.0852 msec, root delay is 59.68 msec
root dispersion is 1990.42 msec, peer dispersion is 1939.30 msec
R2#


No comments:

Post a Comment