nothing is impossible!!!!

nothing is impossible!!!!

Wednesday, February 18, 2009

All about : NTP

I had this plan long back that i will keep my own configurations and documents ready for others to use it. My memory is very short, so i forget things very often. One day i came across this blogger and found best way to keep everything at one place and need not to carry single paper anywhere.

Planning to start All about sessions on all servers, topics etc. Anything which is interesting and information about it is scattered everywhere. hope will be able to do that.

NTP (Network Time Protocol)
What is it ?
Used to synchronize the clocks of computers to some time reference.

NTP uses UDP/IP packets for data transfer because of the fast connection setup and response times.

Port number for the NTP (that ntpd and ntpdate listen and talk to) is 123.

how many ntp servers available in Internet?
According to there are 175,000 ntp servers are available in the Internet. Among these there were over 300 valid stratum-1 servers. In addition there were over 20,000 servers at stratum 2, and over 80,000 servers at stratum 3.

ntp commands
ntpd - A daemon process that is both, client and server.
ntpdate - A utility to set the time once, similar to the popular rdate command.
ntpq, ntpdc - Monitoring and control programs that communicate via UDP with ntpd.
ntptrace - A utility to back-trace the current system time, starting from the local server.

time references
- A reference clock is some device or machinery that spits out the current time.
- A reference clock will provide the current time, that's for sure.
- NTP will compute some additional statistical values like offset (or phase), jitter (or dispersion), frequency error, and stability.

There are serveral ways how a NTP client will know about NTP servers to use:
- Servers to be polled can be configured manually
- Servers can send the time directly to a peer
- Servers may send out the time using multicast or broadcast addresses

- ntpd's reaction will depend on the offset between the local clock and the reference time.
- For a tiny offset ntpd will adjust the local clock as usual; for small and larger offsets, ntpd will reject the reference time for a while.
- In the latter case the operation system's clock will continue with the last corrections effective while the new reference time is being rejected.
- After some time, small offsets (significantly less than a second) will be slewed (adjusted slowly), while larger offsets will cause the clock to be stepped (set anew).
- Huge offsets are rejected, and ntpd will terminate itself, believing something very strange must have happened.

stratum 1
A server operating at stratum 1 belongs to the class of best NTP servers available, because it has a reference clock attached to it.

Servers synchronized to a stratum 1 server will be stratum 2.

No comments: