G NBS - Set system time to National Bureau of Standards Clock - Version 3    September 26, 1995   Author:	Marc L. Kozam  	MLK Software Services 	13245 Glenhill Road 	Silver Spring, MD  20904-3260
 	201-567-9204  	UUCP: mimsy!mlksoft!kozam6 	Internet: kozam@mlksoft.com OR kozam@eisner.decus.org   CHANGES SINCE VERSION 1   9 	The first version had several timing problems for modems ; that were connected directly (i.e. no intervening buffering @ between the system and the modem).  This manifested itself as anB inability to set the time and numerous "Invalid OTM mark" errors. A This was related to the fact that at 1200 baud, both transmit and A receive must be active at the same time in order to read and echo A the time information within one second. Modems that are connected ? via LAT or through other systems, or with buffering internal to : the modem did not suffer from this problem.  This has been" corrected so that all modems work.  1 	There was also a problem if the <delta> time was @ specified at a position other than at the end of the line.  This@ has been corrected so that the command line is correctly parsed.   CHANGES SINCE VERSION 2   7 	Several changes have occurred, the most significant is A the addition of support for the National Bureau of Standards time  server on the Internet.     Support for Internet time server  6 	The National Bureau of Standards now maintains a time@ server system.  NBS has been modified to access this server when= the "-n" switch is used.  This software utilitizes the NETLIB @ package currently supported by Matt Madison.  It is thus able to= work on numerous VMS TCP/IP implementations without requiring ; recompiling.  At present, these include CMU, Multinet, UCX, " TCPware, and Pathway (Wollongong).  & Use of LIB$ADD_TIMES and LIB$SUB_TIMES  : 	The functions formerly provided in the file QSUB.MAR have> been replaced by the VMS-supported functions LIB$ADD_TIMES and> LIB$SUB_TIMES.  The file QSUB.MAR is no longer included in the
 distribution.  	  BUILDING NBS  8 	It has been compiled and tested with VAX C, however, noA VAX C specific features are used and it should work GNU C, DEC C,  etc.    	The commands:  	 	$ CC NBS  	$ LINK NBS,OPT/OPT    RUNNING NBS   9 	For modem connections, NBS requires a 1200 baud modem to 6 connect to the National Bureau of Standards located at; 303-494-4774.  (The alternate number at 202-653-0351 uses a > different, less informative format that is not compatible with@ this program.)  NBS assumes that the connection has already been> established before NBS is started.  The connection may be made@ using your favorite dialer software or manually with SET/HOST or KERMIT.   3 	For internet connections, any connection should be ; suitable.  Even SLIP connections provide good results.  The ? NETLIB package must be installed and the NETLIB logical symbols 3 defined (see the NETLIB documentation for details).   
 Prerequisites   2 	NBS uses the logical symbol MODEM to identify the< communication line to use.  In most cases, this will be your? modem.  Thus, you will need to use the command such as $ DEFINE ( MODEM TXA4: before running this program.  3 	You need to define the command NBS in order to use  command line options, e.g.    	$ NBS :== $ DISK$USER:[TIME]NBS  > You must substitute your local device and directory names that* indicate where the NBS program is located.   Command Line Options  8 -t	Use the system's TOY clock to reset the system clock.9 	This helps provide a measure of system clock drift.  NBS @ 	reports how much adjustment occurred.  No outside connection is  	necessary to use the -t switch.  = -d	Take daylight savings time into account when setting time. < 	This DOES NOT mean that daylight savings time is in effect.< 	When used, NBS uses the information received over the modem9 	to determine whether it is daylight savings time or not. 9 	For most applications, the -d switch should be used.  On ; 	the transitional days, the time offset (see below) is used ; 	to determine if daylight savings time is in effect in your  	local time zone.   ; -c	Don't actually set the system time, merely compare it to - 	the information received.  Useful to see how = 	fast you are drifting.  Non-privleged users can run this too & 	since the system time is not changed.  < -p	Only set the system time if the time can be set with highA 	precision.  For modem connections, the round trip delay is taken ? 	into account.  For network connections, the server must report > 	that it is "healthy".  Without the -p switch, the time is set@ 	regardless.  The -p switch is included for completeness, but it+ 	is unlikely to ever be of practical value.   E <delta>	This is the time offset, when daylight savings time is NOT in = 	effect.  It is a valid VAX/VMS delta time specification.  If ? 	you are in the Eastern time zone, then this should be "0 5:00" = 	to indicate that you are 5 hours behind UTC.  In the Central ; 	time zone, it is "0 6:00".  The day field must be present, 5 	although it will, for almost all applications, be 0.    RECOMMENDATIONS   % 	Most often, the command used will be    	$ NBS -d "0 5:00"  @ (adjusting the <delta> according to your time zone.)  The offset/ "0 5:00" is correct if you are on Eastern time.   
 PRIVILEGES  6 	To get the data from the National Bureau of Standards? modem, you must have privileges necessary to access the modem.  5 No modem access is required if the -t switch is used.   6 	To set the system time, you must have OPER and LOG_IOA privileges.  This is required unless you use the -c option (which 5 causes the time to be compared but not actually set).    ACCURACY  3 	In many ways, the accuracy attainable through this < program far exceeds that which is reasonable for a VAX style@ processor, with its relatively inaccurate system clock.  Without@ using the -p switch, you can anticipate accuracy in the range ofA +/- 250ms (if a satellite link is used) and +/- 50ms (if a ground A link is used).  With the -p switch, accuracy may be +/- 10ms, but = some calls may fail because the NBS system may not be able to ! figure the round-trip delay time.   7 	With system clocks that may drift several seconds in a A day, it should be clear that this is more than sufficient for all A but the most unusual applications.  Special applications may want   to call the NBS number directly.  7 	It is difficult to judge the accuracy of data received = from the internet time server.  Delays in the network are the > major area of concern. This may be related to variable routing= and other network traffic.  Times when the network is lightly > loaded theoretically yield the best results.  Note that the -pA switch does nothing to take delays into account - it only applies @ to how accurate the server thought it was when the time was sent out.   BUGS   Lack of modem control   ; 	No modem control is used, although it probably should be.   NBS terminates when:  / 	1.  The system time has been set (or checked).   @ 	2.  The communication line can not be "cleared" - i.e. we can't$ 	    interpret what we're receiving.  > 	3.  The communication line has had to be cleared 10 times and< 	    we still haven't set the time (probably due to very bad 	    line noise).   ? In the case of a disconnection, NBS will be unable to clear the A line, and after attemting to do so for 2 seconds, will terminate.    Loss of non-internet support  7 	The version now being distributed assumes that you are @ using NETLIB.  For those still wanting a modem only version, the> linking process will leave several undefined symbols.  This is probably OK, but messy.   % Daylight savings time transition days   9 	Exhaustive testing on those wonderful days when daylight : savings time begin and ends has not been performed, but is? believed to be accurate.  In any case, this is probably NOT the @ best way to make the time change.  I recommend SPRINGFOR.COM andA FALLBACK.COM.  These command files cause the time change to occur A over a period of 4 hours.  This keeps events sequential, although > during this period all the times will be wrong, as compared to
 true time.  9 High Speed Error Correcting Modems and Internal Buffering   8 	The initial software for setting the time via modem wasA designed to work with 1200 baud modems.  These older devices were > essentially pipes.  For each character you put into the serialA port, a character came out of the phone jack and on to the remote < system.  Additionally, the delay within the modem itself was? fixed and reproducible.  The reproducible delay could be offset % and the time set even more precisely.   : 	Modems are now essentially computing devices in their ownA right.  Features such as error correction, compress, and internal ? buffering are commonplace.  This means that the round trip time A is always changing.  The National Bureau of Standards modem based = time server is unable to take the delay into account, and can ( never "bless" the time as being precise.  . 	It may be possible to turn off the buffering,= compression, and error correction and coerce modern modems to @ function as their simple predecessors. I leave this to the user,7 since modems brands are far too numerous to provide the ; appropriate commands.  My personal attempts to do this were @ unsuccessful. (In fact, after numerous attempts, I was convinced; that the software had somehow been broken during the latest A revision.  By reinstalling an old and simple 300/1200 baud modem, ( the software was verified to be correct.   Support for Alpha Systems   9  	Not having an Alpha available to me, I can't comment on = whether this software works or not.  Nothing has been done to = prevent it from working and there are no known reasons why it  would not work.   	 ********* L NOTE: Alpha support tested and verified by Hunter Goatley, 29-SEP-1995 14:34	 *********    MORE INFORMATION  8 	I can best be reached via e-mail at the adddress at the< top of this document.  I will try so reply to inquiries in a timely manner.  8 	The National Bureau of Standards maintains an ftp site,; time.nist.gov.  In the /pub/daytime directory are a several A relevant files.  For those interested, there is also a www server < at www.nist.gov that provides information about various NIST	 services.    THANKS  : 	Thanks to Edward James at Martin-Marietta Laboratories in6 Baltimore for pointing me to the Internet time server.