ntpclient
ntp 

所属分类:网络
开发工具:Unix_Linux
文件大小:83KB
下载次数:4
上传日期:2013-03-19 15:48:04
上 传 者daishifeng
说明:  ntp服务器开发实现,验证通过,不可多得的好资料
(ntp server development to achieve, and verification by a rare good)

文件列表:
ntpclient\.svn\entries (1755, 2012-04-17)
ntpclient\.svn\format (2, 2012-04-17)
ntpclient\.svn\text-base\adjtimex.1.svn-base (1624, 2012-04-17)
ntpclient\.svn\text-base\adjtimex.c.svn-base (4455, 2012-04-17)
ntpclient\.svn\text-base\andyw.patch.svn-base (9219, 2012-04-17)
ntpclient\.svn\text-base\envelope.svn-base (2355, 2012-04-17)
ntpclient\.svn\text-base\HOWTO.svn-base (8739, 2012-04-17)
ntpclient\.svn\text-base\linksys.patch.svn-base (2264, 2012-04-17)
ntpclient\.svn\text-base\log2date.pl.svn-base (320, 2012-04-17)
ntpclient\.svn\text-base\Makefile.svn-base (505, 2012-04-17)
ntpclient\.svn\text-base\ntpclient.c.svn-base (15997, 2012-04-17)
ntpclient\.svn\text-base\phaselock.c.svn-base (11159, 2012-04-17)
ntpclient\.svn\text-base\rate.awk.svn-base (666, 2012-04-17)
ntpclient\.svn\text-base\test.dat.svn-base (12762, 2012-04-17)
ntpclient\adjtimex.1 (1624, 2011-07-25)
ntpclient\adjtimex.c (4455, 2011-07-25)
ntpclient\andyw.patch (9219, 2011-07-25)
ntpclient\envelope (2355, 2011-07-25)
ntpclient\HOWTO (8739, 2011-07-25)
ntpclient\linksys.patch (2264, 2011-07-25)
ntpclient\log2date.pl (320, 2011-07-25)
ntpclient\Makefile (505, 2011-07-25)
ntpclient\ntpclient (31441, 2012-10-24)
ntpclient\ntpclient.c (15997, 2011-07-25)
ntpclient\ntpclient.o (10432, 2012-10-24)
ntpclient\phaselock.c (11159, 2011-07-25)
ntpclient\phaselock.o (8320, 2012-10-24)
ntpclient\rate.awk (666, 2011-07-25)
ntpclient\test.dat (12762, 2011-07-25)
ntpclient\.svn\tmp\prop-base (0, 2013-03-07)
ntpclient\.svn\tmp\props (0, 2013-03-07)
ntpclient\.svn\tmp\text-base (0, 2013-03-07)
ntpclient\.svn\prop-base (0, 2013-03-07)
ntpclient\.svn\props (0, 2013-03-07)
ntpclient\.svn\text-base (0, 2013-03-19)
ntpclient\.svn\tmp (0, 2013-03-19)
ntpclient\.svn (0, 2013-03-19)
ntpclient (0, 2013-03-19)
... ...

ntpclient is an NTP (RFC-1305) client for unix-alike computers. Its functionality is a small subset of xntpd, but IMHO performs better (or at least has the potential to function better) within that limited scope. Since it is much smaller than xntpd, it is also more relevant for embedded computers. ntpclient is Copyright 1997, 1999, 2000, 2003 Larry Doolittle, and may be freely used and copied according to the terms of the GNU General Public License, version 2. If you want to distribute ntpclient under other terms, contact me. I might agree to some other arrangement, if you talk to me _before_ you start violating GPL terms. ntpclient home page: http://doolittle.faludi.com/ntpclient/ To build on Linux, type "make". Solaris and other Unix users will probably need to adjust the Makefile slightly. It's not complex. For changing the system clock frequency, only the Linux adjtimex(2) interface is implemented at this time. Non-Linux systems can only use ntpclient to measure time differences and set the system clock. Usage: ntpclient [options] options: -c count stop after count time measurements (default 0 means go forever) -d print diagnostics (feature can be disabled at compile time) -g goodness causes ntpclient to stop after getting a result more accurate than goodness (microseconds, default 0 means go forever) -h hostname (mandatory) NTP server host, against which to measure system time -i interval check time every interval seconds (default 600) -l attempt to lock local clock to server using adjtimex(2) -p port local NTP client UDP port (default 0 means "any available") -r replay analysis code based on stdin -s simple clock set (implies -c 1) Mortal users can use this program for monitoring, but not clock setting (with the -s or -l switches). The -l switch has only seen serious testing in a low latency (less than 2 ms) Ethernet environment, although I also use it successfully with a cable modem (latency about 15 ms). Users in other environments should study ntpclient's behavior, and be prepared to adjust internal tuning parameters. A long description of how and why to use ntpclient is in the HOWTO file. ntpclient always sends packets to the server's UDP port 123. The test.dat file has 200 lines of sample output. Its first few lines, with the output column headers that are shown when the -d option is chosen, are: day second elapsed stall skew dispersion freq 51785 00180.386 13***.0 40.3 953773.9 793.5 -1240000 51785 00780.382 1358.0 41.3 954329.0 915.5 -1240000 51785 01380.381 1439.0 56.0 954871.3 915.5 -1240000 day, second: time of measurement, UTC, relative to Unix epoch (Jan 1, 1970) elapsed: total time from query to response (microseconds) stall: time the server reports that it sat on the request (microseconds) skew: difference between local time and server time (microseconds) dispersion: reported by server, see RFC-1305 (microseconds) freq: local clock frequency adjustment (Linux only, ppm*65536) test.dat is suitable for piping into ntpclient -r. I have over 200000 samples (lines) archived for study, that I don't include here. They are generally spaced 10 minutes apart, representing over three years of data logging (from a variety of machines, and not continuous, unfortunately). As a special, added bonus, I also include my adjtimex(1) program. See its man page and the HOWTO file for more information. envelope is a perl script that I have used for my lock studies. It's kind of a hack and not worth documenting here. Changes since the widely distributed ntpclient_2000_345 version: -- new -g option (has had limited testing) -- changed max frequency adjustment from 91 ppm to 150 ppm -- fixed "inconsistent" bug in phaselock.c triggered by large freq errors -- new files: HOWTO, adjtimex.c, adjtimex.1, rate.awk, log2date.pl -- minor source code cleanups -- source is now as ***-bit clean as practical; tested on Alpha -- optional patches provided by Andy Warner, see andyw.patch -- optional patches provided by Linksys, see linksys.patch -- removed unexplained and unreasonable 15020 day offset in date column Bugs: -- Doesn't understand the LI (Leap second Indicator) field of an NTP packet -- Doesn't interact with adjtimex(2) status value - Larry Doolittle

近期下载者

相关文件


收藏者