Wednesday 4 March 2020

NETWORK TIME PROTOCOL (NTP)

Network Time Protocol (NTP) is a protocol which used to synchronize the clocks of network infrastructure devices like Servers , Routers , Switches , Firewalls etc over a network.


It allows network infrastructure device to keep its system time synchronized to an external accurate time source.

Uses UDP Protocol port 123

NTP



========================================================================
Need of NTP  - 
========================================================================

Time stamps are used every where.

Digital Certificates: Digital Certificates include a validity period. If your Cisco Router/Switch clock is not configured properly, Digital Certificates may not work properly.

Syslogs:- If in your network you are using Syslogs to track the logs of the network infrastructure devices then it becomes very crucial that
all the devices should be configured with same clock i.e date and time.Otherwise it will be very difficult to co-relate events happened on the devices.

Policy Implemention - Incertain cases if you need to implement certain policy or policies on network infrastructure devices based on time.

========================================================================
Explanation 
========================================================================

In NTP time is distributed from a authorize, reference, high precision time device.

This distribution is done in an hierarchical way.

There is something known as Stratum levels in NTP which defines the distance of the device from a high precision clock.

A Stratum -0 device is assumed to be the most accurate one ,

A Stratum -1 which are connected to High Precision time source and are the primary servers.

A Stratume -2 the secondary servers which are connected to Stratum -1 and so on .


    |==========|
    | Stratum 0  |  HIGH PRECISION TIME SOURCE
    |==========|     

            |
            |
            |

    |==========|
    | Stratum 1  |  NTP TIME SERVER ; TIME SOURCE - STRATUM 0
    |==========| 

            |
            |
            |

    |==========|
    | Stratum 2  |  NTP TIME SERVER ; TIME SOURCE - STRATUM 1
    |==========| 
            |
            |
            |

    |==========|
    | Stratum 3  |  NTP TIME SERVER ; TIME SOURCE - STRATUM 2
    |==========|

========================================================================
NTP CONFIGURATION ON ROUTERS
========================================================================
R1 (config) # ntp master 2

STRATUM 0 -> High Precision time source ( GPS OR RADIO CLOCK)

STRATUM 1 -> Some Server

So lets consider stratum level of the routers as 2 or 3 (Here we will consider as 2)

R2 (config) # ntp server 10.10.10.10  ------> IP address of R1

R3 (config) # ntp server 10.10.10.10

To verify the stauts

R2 # sh ntp status
R2 # sh ntp associations
R2 # sh clock

Troubleshooting command

R2 # debug ntp all

Note - debug output may result in the high cpu utilization of the device.

Thanks for Reading !!!!!!

                     

No comments:

Post a Comment