NTP 101
Software Clock
Each router has a software clock that is set at initialization according to the hardware clock. The software clock can be updated manually, or automatically using NTP, SNTP or VINES Time Service.
The software clock provides the time for time-based ACLs, logging ande debugging messages, and other router features. The software clock is kept in UTC (GMT) and a timezone can be configured for a more accurate display, as well as the daylight saving time.
To check the clock, use:
NTP
NTP is a protocol that runs on UDP 123 and offers time accuracy of a milisecond. Stratum represent the number of hops away a machine is from an authoritative time source.
A Stratum 1 clock is a radio clock or an atomic clock or a GPS clock
A Stratum 2 clock receives clock information from a Stratum 1 clock
A Stratum 3 clock receives clock information from a Stratum 2 clock and so on..
NTP makes estimations taking into account Network delay, Dispersion of time packet exchanges(measures max clock error between the 2 hosts) and clock offset (the correction that is applied to the client clock to synchronize it)
To set a routers as an NTP authoritative source, use:
NTPv3 and NTPv4
NTPv4 is an extension of NTPv3 and provides some additional capabilities:
NTPv4 supports IPv6
NTPv4 supports public key cryptography and X.509 certificates
NTPv4 can use a hierarchy of servers to achive the best time accuracy
NTPv4 uses multicast messages instead of broadcase messages
NTP can work in 2 modes:
Poll-Based NTP Association
In this mode, we have 2 methods of association: Client mode and Symmetric Active Mode. In client mode, the client polls the server for time information, while in symmetric active mode, a device can poll for time information, but can also respond to NTP polls.
In Client mode, the client will synchronize with a server
The Symmetric Active mode is used when multiple hosts are part of a redundant group of NTP servers.
Broadcast-Based NTP Association
In this mode, the hosts listen to NTP broadcasts from the server. This is a less accurate method and it is recommended in environments with more than 20 clients.
NTP Access Group
When a host receives KoD packets, they indicate that the NTP server dropped their packets. They should take appropriate measures, like running sanity checks or rate limiting their NTP outgoing packets.
If the source IP address matches the ACL for more than one type, the first type is granted. They are scanned in the following order:
peer – Allows time requests and NTP control queries and allows the system to synchronize itself to a system whose address passes the access list criteria
serve – Allows time requests and NTP control queries, but does not allow the system to synchronize itself to a system whose address passes the access list criteria
serve-only – Allows only time requests from a system whose address passes the access list criteria
query-only – Allows only NTP control queries from a system whose address passes the access list criteria
Authentication
NTP provides MD5 authentication, but it is used to authenticate the NTP Server on the NTP Clients. To enable authentication, follow these steps:
NTP Access Restrictions
You can apply an ACL to the NTP configuration as such:
peer - Time synchronization requests and control queries are allowed. The deviec is allowed to synchronyze to remote systems that pass the ACL
serve - Time synchronization requests and control queries are allowed. The device is not allowed to synchronize itslef to remote systems even if they pass the ACL
serve-only: Time synchronziation requests only are allowed
query-only: Time synchronuzation control queries only are allowed
You can use multiple options on each router to better control who is allowed to synchronize and with whom.
Hardware Clock
By default, the time maintained on the software clock is not considered to be reliable and will not be synchronized with NTP or VINES time service. To set the hardware clock as a valid time source, use this command:
Last updated