01-05-2013 09:58 AM - edited 03-07-2019 10:55 AM
I didn't understand the purpose of NTP peer, can someone please explain me what is NTP peer where we use it?
Solved! Go to Solution.
01-06-2013 05:22 PM
I would like to suggest a slightly different way of looking at this question.
I would start by reviewing some basic concepts:
- ntp server is based on a client to server relationship.
- ntp peer is based on a peer to peer relationship.
In configuring ntp server the client will always ask for time from the server and the server will never ask for time from the client.
In configuring ntp peer both peers may attempt to learn time from the other and each peer may offer its time to the other.
So if you are configuring ntp on a router (or switch) I would suggest that these are some questions that will guide you to the correct relationship:
- is the other device always going to be authoritative for ntp? If so then the appropriate relationship is client to server. Your router (or switch) will always ask for time from the server but will never offer time to the server.
- is the other device sometimes authoritative and sometimes not authoritative? If so then the appropriate relationship is peer to peer.
Let me suggest an example which may clarify the functions.
- let us consider router A and router B.
- let us assume that router A will learn time from Internet server 1.
- let us assume that router B will learn time from Internet server 2.
Then the appropriate configuration of router A has server 1 as ntp server and has router B as ntp peer.
Also router B has server 2 as ntp server and has router A as ntp peer.
The result is this:
- as long as router A is in sync with server 1 it will not need to ask router B for time. But if for some reason it loses its sync with server 1 then router A will attempt to learn time from router B. And as long as router B is in sync with its server 2 then it will send its time to router A.
as long as router B is in sync with server 2 it will not need to ask router A for time. But if for some reason it loses its sync with server 2 then router B will attempt to learn time from router A. And as long as router A is in sync with its server 1 then it will send its time to router B.
HTH
Rick
01-05-2013 10:09 AM
It is to sync the clock from one server to another.
It basically provide redundancy in case one server fails.
The following example shows how to configure a router to allow its software clock to be synchronized with the clock of the peer (or vice versa) at IP address 192.168.22.33 using NTP version 2. The source IP address is the address of Ethernet 0.
Router(config)# ntp peer 192.168.22.33 version 2 source ethernet 0
more info here:http://www.cisco.com/en/US/docs/ios/12_2/configfun/command/reference/frf012.html#wp1123701
HTH
01-05-2013 12:48 PM
Thanks Reza for looking into it. Lets say we configure NTP between the two router which are having different time, lets say one router have the time 9AM and other is on 9.30am. Now my question is how they will syc the time?
An also do we make our NTP server as peer or the routers taking time from ntp server?
01-05-2013 02:15 PM
The router that is getting the time from the NTP server, is the preferred or the primary server. You than peer this router to another router for backup. So when the primary gets the correct time, it will sync that to the backup.
and If you have you own GPS, then the server gets the correct time from that and will distribute it to the rest of the network.
HTH
01-06-2013 01:01 AM
How the router will know that the other router is connected to a NTP server?
01-06-2013 02:22 AM
Actually that config is placed on the router......so that it will know that its NTP server is that one....
ntp server 192.168.1.X
ntp server 192.168.1.Y
Above command defines that its NTP servers are 192.168.1.X and 192.168.1.Y
01-06-2013 02:38 AM
How the router will know that the other router is connected to a NTP server?
Use the command "sh ntp associate". Look under "stratum". The lower the number, the better the "trustworthyness". Stratum number is from 1 to 16 with 16 being a "dead" or "not trusted" time source.
Look to the left hand of the table. See the symbol for "*", "~" and "."?
01-06-2013 05:22 PM
I would like to suggest a slightly different way of looking at this question.
I would start by reviewing some basic concepts:
- ntp server is based on a client to server relationship.
- ntp peer is based on a peer to peer relationship.
In configuring ntp server the client will always ask for time from the server and the server will never ask for time from the client.
In configuring ntp peer both peers may attempt to learn time from the other and each peer may offer its time to the other.
So if you are configuring ntp on a router (or switch) I would suggest that these are some questions that will guide you to the correct relationship:
- is the other device always going to be authoritative for ntp? If so then the appropriate relationship is client to server. Your router (or switch) will always ask for time from the server but will never offer time to the server.
- is the other device sometimes authoritative and sometimes not authoritative? If so then the appropriate relationship is peer to peer.
Let me suggest an example which may clarify the functions.
- let us consider router A and router B.
- let us assume that router A will learn time from Internet server 1.
- let us assume that router B will learn time from Internet server 2.
Then the appropriate configuration of router A has server 1 as ntp server and has router B as ntp peer.
Also router B has server 2 as ntp server and has router A as ntp peer.
The result is this:
- as long as router A is in sync with server 1 it will not need to ask router B for time. But if for some reason it loses its sync with server 1 then router A will attempt to learn time from router B. And as long as router B is in sync with its server 2 then it will send its time to router A.
as long as router B is in sync with server 2 it will not need to ask router A for time. But if for some reason it loses its sync with server 2 then router B will attempt to learn time from router A. And as long as router A is in sync with its server 1 then it will send its time to router B.
HTH
Rick
01-06-2013 05:26 PM
Thanks Rick.
01-06-2013 05:29 PM
I am glad that my explanation was helpful.
HTH
Rick
01-06-2013 11:05 PM
Thanks a lot Richard.
01-07-2013 03:08 AM
Disclaimer
The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
Liability Disclaimer
In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
Posting
- is the other device sometimes authoritative and sometimes not authoritative? If so then the appropriate relationship is peer to peer.Let me suggest an example which may clarify the functions.
- let us consider router A and router B.
- let us assume that router A will learn time from Internet server 1.
- let us assume that router B will learn time from Internet server 2.
Then the appropriate configuration of router A has server 1 as ntp server and has router B as ntp peer.
Also router B has server 2 as ntp server and has router A as ntp peer.
The result is this:
- as long as router A is in sync with server 1 it will not need to ask router B for time. But if for some reason it loses its sync with server 1 then router A will attempt to learn time from router B. And as long as router B is in sync with its server 2 then it will send its time to router A.
as long as router B is in sync with server 2 it will not need to ask router A for time. But if for some reason it loses its sync with server 2 then router B will attempt to learn time from router A. And as long as router A is in sync with its server 1 then it will send its time to router B.
I'm unsure it's required by NTP, don't believe it is, but if and when you define NTP peers I would suggest both peers should be at the same NTP stratum and they should be "close" (LAN latency w/o traffic congestion) to each other.
Reason I'm suggesting this, NTP peers should have the same time "accuracy". In what Rick described, if for example router A has lost sync with its upstream NTP server, very little additional time inaccuracy would be introduced as it acquires its time from router B and it passes its time to its downstream clients.
Also, again I'm unsure, but each router, A and B, now has two time sources which NTP could use for a "sanity" check. (Logically same "sanity" check could be accomplished by having each router, A and B, be NTP clients of both Internet servers 1 and 2.)
If both routers were clients of both Internet NTP servers, it may appear there's little advantage of making them peers of each other. But another advantage of making them peers is so routers A and B both don't have to query Internet NTP servers 1 and 2, which reduces the NTP processing load on both those NTP servers.
04-02-2020 12:58 AM
Great notes sir !
Sir can you please share the link to study on NTP all terms.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide