home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
nisttime.carsoncity.k12.mi.us
/
nisttime.carsoncity.k12.mi.us.tar
/
nisttime.carsoncity.k12.mi.us
/
pub
/
daytime
/
read.me
< prev
next >
Wrap
Text File
|
2001-02-23
|
10KB
|
171 lines
The files in this directory can be used to build programs that
will query the NIST time server using several different protocols,
including:
the tcp/ip "daytime" protocol, which connects to the time
server via tcp/ip port 13;
the "time" protocol, which uses either tcp/ip or udp/ip to
port 37 on the server;
the icmp "echo" protocol which sends an echo request to the
icmp layer and measures both the average network delay and the
time difference between the client and the server. This method
is analogous to the standard "ping" utility.
Our servers also support the Network Time Protocol (NTP), which normally
uses udp/ip port 123. There is no example source code in this directory
for a client program that uses this format, although version 3.0 of
nistime-32bit.exe can be configured to query our servers in this format.
Client programs for this format are available from many sources. A very
comprehensive distribution is available from the University of Delaware at
URL: www.eecis.udel.edu/~ntp. This version of the software can be configured
to operate as a client or as a server in many different configurations. More
information about this protocol can be found in document RFC 1305 and
in the very complete documentation set that is part of the University
of Delaware distribution.
All of these protocols assume that you are connected to the internet --
either directly to a local-area network or indirectly via a dial-up
connection using SLIP, PPP or some equivalent protocol. If you use
a dial-up connection, you may have to complete this connection before
you can use any of these programs, although some network interfaces
will initiate a dial-in sequence automatically when a network request
is posted. (Many DSL and cable modems are configured to act as local-
area networks and are effectively connected to the Internet at all
times.)
(If you have a standard dial-up modem but no connection to the Internet at
all, you can still connect to our time service using the ACTS protocol.
See the files in directory /pub/acts on this system for more information.)
The daytime protocol contains the most information, and we recommend using
these client programs in preference to the simpler time requests to
port 37. The icmp echo request will estimate the network delay between
the client and the server, but it has other limitations that are
discussed below.
The server will respond to a "daytime" request with a text string
giving the date as a Modified Julian Day number and as a civil date and
the Universal Coordinated Time (formerly called GMT). The message also
contains advance notice for the transitions to and from Daylight Saving
Time (using the US transition dates) and for leap seconds. The response
can be parsed to set the time on your machine with an uncertainty that is
determined primary by the variability in the transmission time across
the internet path which is typically about 0.1 seconds or less. Several
versions of the software are provided. The different versions are
variations of the same basic program adapted for different computing
environments. The environments that are currently supported are
described below:
1. If you have a workstation with "standard" UNIX that supports
tcp/ip communication over the internet, then you can build a version
for your machine using files sw.c, tcp_time_client.c and Makefile. The
file nistime.man is a manual-page for this program; it describes the
various options that can be selected via switches and the format of
the message that is sent by the NIST time server. Files
udp_time_client.c and tcp_port37_client.c are examples of how to link
to the "time" service via udp/ip or tcp/ip, respectively, in the same
hardware and software environment. Since this protocol provides less
information than the "daytime" messages its use is not recommended in
normal circumstances. You can also use the icmp "echo" method; an
example of how to do this is in file t_ping.c.
2. If you have a PC-compatible machine that is running 16-bit Windows (v3.x
or most early versions of Windows 9x) and which has a network interface that
is compatible with the Winsock standard (v1.1 or later), then file nistimew.exe
is a compiled and linked program that will run in this environment.
If you are using 32-bit windows (e.g., Windows NT, many versions of Win 98,
and all versions of Windows after Win 98), then use the 32-bit version of this
program, which is named nistime-32bit.exe.
Both versions of the program will probably work in a Windows 95 environment,
but only the 32-bit version will be able to set the clock in a 32-bit
NT environment. The 16-bit version may not work in Windows 2000 or Windows
Me.
If you are in doubt, use the 16-bit version for Win 3.x and the 32-bit version
for all other flavors.
Please consult file nistimew.doc for more information about either
version of this program. The documentation file is a flat text file, but
you must copy nistimew.exe or nistime-32bit.exe in binary (image) mode.
These program is based on the code contained in file tcp_time_client.c, with
additional code to make it compatible with the Windows environment.
3. If you have an MS-DOS PC-compatible machine that has tcp/ip network
software (such as PC/TCP), then file nistimen.exe is a compiled and
linked program that will run in this environment. (It may or may not
run from inside Windows). Its operation is described in the manual page
in file nistimen.man. The manual page is a flat text file, but you must
copy nistimen.exe in binary (image) mode. The source code for this program is
provided in nistimen.c (you will also need sw.c, unpbcd.c and cvt2jd.c), but
you must also have the PC/TCP network libraries (or something equivalent) if
you wish to rebuild this program. You may also be able to use the other
programs, although you may have to modify the software to run in this
environment.
4. If you have an MS-DOS PC-compatible machine that has a packet driver
interface to the network, then file nistimep.exe is a compiled and
linked program that will run in this environment. (It may or may not
run from inside Windows). Its operation is described in the manual page in
file nistimep.man. The manual page is a flat text file, but you must copy
nistimep.exe in binary (image) mode. The source code for this program is
provided in nistimep.c, and you will also need sw.c, unpbcd.c, cvt2jd.c,
cnvbcd.c and adjclk.c, all of which are in this directory. You will also need
the network interface that supports tcp/ip communications via a packet-driver
inteface to the network. Program nistimep.exe was built using the
Waterloo TCP library. The source code to build this library is
available via anonymous ftp from dorm.rutgers.edu in /pub/msdos/wattcp.
5. If you have a VAX computer with the VAX/VMS operating system and
the UCX internet extensions, then file vax_tcp_time_client.c is
a version of the tcp_time_client software that has been modified to
run in this environment. Instructions for compiling and using this
version are in the comments at the start of the file.
6. If your hardware or software are not compatible with any of the
choices above, then you will have to use the source code in this
directory as an template for building a version that will run in
your environment. You will find the extensive comments in the
source code helpful, and you may send technical queries to
time@time-a.timefreq.bldrdoc.gov. We would recommend using the
"daytime" service (via tcp/ip port 13) because of the additional
information it provides rather than the "time" service via
port 37, but the time server will respond to either type of
request.
7. If you query any of our servers using NTP, it will respond
as a stratum-1 server to any host but will not accept external
synchronization and you cannot modify the operation of the
daemon. Most of the other status queries that are described in
the NTP documentation will be recognized by our servers, and you
can use utility programs such as xntpdc or ntpq to transmit
such queries. We request that you notify us if you are planning
to use our servers on a regular basis. Please send an e-mail
message to time@time.nist.gov giving the ip address of the
client system(s) and the server(s) that you plan to use.
8. The icmp "echo" method estimates both the time difference
between the client and the server and it corrects this measurement
for the network delay. An icmp "echo" packet uses 4 time stamps:
(1) when the packet leaves the client, (2) when it arrives at the
server, (3) when the echo leaves the server and (4) when the echo
arrives back at the client. The one-way network delay is estimated
as one-half of (4) - (1) minus the latency of the server, which is
(3) - (2). This delay is used to correct the two estiamtes of the
time difference between the client and the server -- one using the
outbound packet and the second using the echo packet. All of the
times are expressed in milliseconds since 0000 UTC of the current
day so that no date information is available. There is also a
potential ambiguity if the message is sent just before 0000 and
the echo arrives back shortly after 0000. This method uses a
raw socket interface and may require root privileges in some
environments. It is most useful when the network delay is an
appreciable fraction of a second, which is unlikely to be true
between the server and any client localted within the continental US.
An example of how to use this protocol is in file t_ping.c
For additional information, see file timeserver.info.