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 >
Text File  |  2001-02-23  |  10KB  |  171 lines

  1.      The files in this directory can be used to build programs that
  2. will query the NIST time server using several different protocols,
  3. including:
  4.  
  5.     the tcp/ip "daytime" protocol, which connects to the time 
  6.     server via tcp/ip port 13;
  7.  
  8.     the "time" protocol, which uses either tcp/ip or udp/ip to 
  9.     port 37 on the server;
  10.  
  11.     the icmp "echo" protocol which sends an echo request to the
  12.     icmp layer and measures both the average network delay and the 
  13.     time difference between the client and the server.  This method
  14.     is analogous to the standard "ping" utility.
  15.  
  16. Our servers also support the Network Time Protocol (NTP), which normally
  17. uses udp/ip port 123. There is no example source code in this directory
  18. for a client program that uses this format, although version 3.0 of 
  19. nistime-32bit.exe can be configured to query our servers in this format. 
  20. Client programs for this format are available from many sources. A very 
  21. comprehensive distribution is available from the University of Delaware at 
  22. URL: www.eecis.udel.edu/~ntp.  This version of the software can be configured 
  23. to operate as a client or as a server in many different configurations. More 
  24. information about this protocol can be found in document RFC 1305 and
  25. in the very complete documentation set that is part of the University
  26. of Delaware distribution.
  27.  
  28. All of these protocols assume that you are connected to the internet -- 
  29. either directly to a local-area network or indirectly via a dial-up 
  30. connection using SLIP, PPP or some equivalent protocol. If you use
  31. a dial-up connection, you may have to complete this connection before 
  32. you can use any of these programs, although some network interfaces
  33. will initiate a dial-in sequence automatically when a network request
  34. is posted. (Many DSL and cable modems are configured to act as local-
  35. area networks and are effectively connected to the Internet at all
  36. times.)
  37.  
  38. (If you have a standard dial-up modem but no connection to the Internet at 
  39. all, you can still connect to our time service using the ACTS protocol.
  40. See the files in directory /pub/acts on this system for more information.)
  41.  
  42. The daytime protocol contains the most information, and we recommend using 
  43. these client programs in preference to the simpler time requests to 
  44. port 37.  The icmp echo request will estimate the network delay between
  45. the client and the server, but it has other limitations that are
  46. discussed below.
  47.  
  48. The server will respond to a "daytime" request with a text string 
  49. giving the date as a Modified Julian Day number and as a civil date and 
  50. the Universal Coordinated Time (formerly called GMT).  The message also 
  51. contains advance notice for the transitions to and from Daylight Saving 
  52. Time (using the US transition dates) and for leap seconds.  The response 
  53. can be parsed to set the time on your machine with an uncertainty that is 
  54. determined primary by the variability in the transmission time across
  55. the internet path which is typically about 0.1 seconds or less.  Several
  56. versions of the software are provided. The different versions are 
  57. variations of the same basic program adapted for different computing 
  58. environments.  The environments that are currently supported are
  59. described below:
  60.  
  61. 1.  If you have a workstation with "standard" UNIX that supports
  62. tcp/ip communication over the internet, then you can build a version
  63. for your machine using files sw.c, tcp_time_client.c and Makefile.  The
  64. file nistime.man is a manual-page for this program; it describes the
  65. various options that can be selected via switches and the format of
  66. the message that is sent by the NIST time server.  Files
  67. udp_time_client.c and tcp_port37_client.c  are examples of how to link 
  68. to the "time" service via udp/ip or tcp/ip, respectively, in the same 
  69. hardware and software environment. Since this protocol provides less 
  70. information than the "daytime" messages its use is not recommended in 
  71. normal circumstances.  You can also use the icmp "echo" method; an
  72. example of how to do this is in file t_ping.c.  
  73.  
  74. 2. If you have a PC-compatible machine that is running 16-bit Windows (v3.x 
  75. or most early versions of Windows 9x) and which has a network interface that 
  76. is compatible with the Winsock standard (v1.1 or later), then file nistimew.exe 
  77. is a compiled and linked program that will run in this environment.  
  78.  
  79.    If you are using 32-bit windows (e.g., Windows NT, many versions of Win 98,
  80. and all versions of Windows after Win 98), then use the 32-bit version of this 
  81. program, which is named nistime-32bit.exe.
  82. Both versions of the program will probably work in a Windows 95 environment,
  83. but only the 32-bit version will be able to set the clock in a 32-bit
  84. NT environment.  The 16-bit version may not work in Windows 2000 or Windows
  85. Me.
  86.  
  87.   If you are in doubt, use the 16-bit version for Win 3.x and the 32-bit version 
  88. for all other flavors.
  89.  
  90.     Please consult file nistimew.doc for more information about either
  91. version of this program.  The documentation file is a flat text file, but 
  92. you must copy nistimew.exe or nistime-32bit.exe in binary (image) mode.  
  93. These program is based on the code contained in file tcp_time_client.c, with 
  94. additional code to make it compatible with the Windows environment.
  95.  
  96. 3.  If you have an MS-DOS PC-compatible machine that has tcp/ip network
  97. software (such as PC/TCP), then file nistimen.exe is a compiled and
  98. linked program that will run in this environment.  (It may or may not
  99. run from inside Windows).  Its operation is described in the manual page 
  100. in file nistimen.man.  The manual page is a flat text file, but you must 
  101. copy nistimen.exe in binary (image) mode. The source code for this program is 
  102. provided in nistimen.c (you will also need sw.c, unpbcd.c and cvt2jd.c), but 
  103. you must also have the PC/TCP network libraries (or something equivalent) if 
  104. you wish to rebuild this program.  You may also be able to use the other 
  105. programs, although you may have to modify the software to run in this 
  106. environment.
  107.  
  108.  
  109. 4. If you have an MS-DOS PC-compatible machine that has a packet driver
  110. interface to the network, then file nistimep.exe is a compiled and 
  111. linked program that will run in this environment.  (It may or may not
  112. run from inside Windows).  Its operation is described in the manual page in 
  113. file nistimep.man.  The manual page is a flat text file, but you must copy 
  114. nistimep.exe in binary (image) mode.  The source code for this program is 
  115. provided in nistimep.c, and you will also need sw.c, unpbcd.c, cvt2jd.c, 
  116. cnvbcd.c and adjclk.c, all of which are in this directory.  You will also need 
  117. the network interface that supports tcp/ip communications via a packet-driver
  118. inteface to the network.  Program nistimep.exe was built using the 
  119. Waterloo TCP library.  The source code to build this library is
  120. available via anonymous ftp from dorm.rutgers.edu in /pub/msdos/wattcp.
  121.  
  122. 5. If you have a VAX computer with the VAX/VMS operating system and
  123. the UCX internet extensions, then file vax_tcp_time_client.c is
  124. a version of the tcp_time_client software that has been modified to
  125. run in this environment.  Instructions for compiling and using this
  126. version are in the comments at the start of the file.
  127.  
  128. 6.  If your hardware or software are not compatible with any of the
  129. choices above, then you will have to use the source code in this
  130. directory as an template for building a version that will run in
  131. your environment.  You will find the extensive comments in the 
  132. source code helpful, and you may send technical queries to
  133. time@time-a.timefreq.bldrdoc.gov. We would recommend using the
  134. "daytime" service (via tcp/ip port 13) because of the additional 
  135. information it provides rather than the "time" service via 
  136. port 37, but the time server will respond to either type of
  137. request.
  138.  
  139. 7.  If you query any of our servers using NTP, it will respond 
  140. as a stratum-1 server to any host but will not accept external 
  141. synchronization and you cannot modify the operation of the
  142. daemon. Most of the other status queries that are described in 
  143. the NTP documentation will be recognized by our servers, and you
  144. can use utility programs such as xntpdc or ntpq to transmit
  145. such queries. We request that you notify us if you are planning
  146. to use our servers on a regular basis. Please send an e-mail 
  147. message to time@time.nist.gov giving the ip address of the
  148. client system(s) and the server(s) that you plan to use.
  149.  
  150. 8.  The icmp "echo" method estimates both the time difference
  151. between the client and the server and it corrects this measurement
  152. for the network delay.  An icmp "echo" packet uses 4 time stamps:
  153. (1) when the packet leaves the client, (2) when it arrives at the
  154. server, (3) when the echo leaves the server and (4) when the echo
  155. arrives back at the client.  The one-way network delay is estimated
  156. as one-half of (4) - (1) minus the latency of the server, which is
  157. (3) - (2).  This delay is used to correct the two estiamtes of the
  158. time difference between the client and the server -- one using the
  159. outbound packet and the second using the echo packet.  All of the
  160. times are expressed in milliseconds since 0000 UTC of the current
  161. day so that no date information is available.  There is also a
  162. potential ambiguity if the message is sent just before 0000 and 
  163. the echo arrives back shortly after 0000.  This method uses a
  164. raw socket interface and may require root privileges in some
  165. environments.  It is most useful when the network delay is an
  166. appreciable fraction of a second, which is unlikely to be true
  167. between the server and any client localted within the continental US.
  168. An example of how to use this protocol is in file t_ping.c
  169.  
  170.     For additional information, see file timeserver.info.
  171.