NTP:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

On CentOS : 6.8  :  cat /etc/*elease 


cat /etc/*elease 

CentOS release 6.8 (Final) 

CentOS release 6.8 (Final) 

CentOS release 6.8 (Final) 

 

Restarting NTP service  

[root@vodb1-am ~]# sudo /etc/init.d/ntpd restart 

Shutting down ntpd:                                        [  OK  ] 

Starting ntpd:                                             [  OK  ] 

[root@vodb1-am ~]# 



+++++++++++++++++++++++


https://www.youtube.com/watch?v=oCtkwEjhyD4


+++++++++++++++++++++++


NTP : Network Time Protocol : It has a very important job of synchronizing clocks over the networks 

In a network with a time difference of even few minutes can cause problems. 


Every device on a network will have an internal clock . These internal clock with track both the time and the date . It is important to keep accurate clocks . Otherwise you may run into issue such as co-relating logs , SSL certificates , software and the list goes on. 


Lets take these two routers for example 




If something happens to the link connecting them , we may want to look into the logs. The two logs show that the line went down on the 13th of sep @8.04 


If we look our ones logs . It shows that the link went down on the 1st of March .@ 12:25  .

The link went down at the same time but since the internal clocks aren't synced . It will be very difficult to co-relate these logs.


When our networks grow keeping on top of the date and time for every device becomes almost impossible.  This is where NTP comes in . All of the devices wil sync there clocks with an NTP Server which would have an accurate time. So now we know the importance of NTP and what it does. 


Lets look at how it works.


NTP is a hierarchy system at the very top we have the BIG BOYS . We have the MAC daddies .These are highly accurate time keeping devices such as atomic clocks , GPS or Radio clocks .They are known as reference clocks -- They have a stratum of 0 . Meaning they the most accurate. 


NTP uses stratum values to identify the accuracy of the clock .




Stratum values range between 0-15 with 0 being the most accurate and 15 being the least. 

Anything above 15 accuracy is not trustworthy .


Stratum 0 clock does not connect over the network they are directly connected to Time service . They then sync the time and date to the reference clock these are known as primary time servers 

The NTP stratum works is by adding a 1 to the stratum value at each layer . So these primary time servers will have a stratum value of 1 . As we go further in the stratum hierarchy stratum values increase . This is because the reference clock is further and further away . -- Meaning the time is less accurate. 




NTP uses UDP Port number 123 


So that is nice and easy to remember . . Lets looks at some real life setup 


First we need a time source for smaller network that is likely going to be NTP Internet server  . For larger and security cautious environments you may have your own internal internet GPS clock. 


This is an internet GPS clock in our example 




pool.ntp.org is a popular one. 

When connecting to an Internet NTP server Most of the time it will be a stratum 1 , 2 or 3 server.  You should then sync an internal device to that NTP server - This could be  router , firewall or a server. The choice is upto you. 

I will be using this router 




once the router is synced we can provide the time for the rest of the network. This makes our router a Stratum 3 device. This is because in this case our internet NTP server is a stratum 2.


















Comments

Popular posts from this blog

Network-Interface

NetMask