11.1Scgd#	@(#)CHANGES	5.1 (Berkeley) 5/11/93
21.1Scgd
31.1ScgdThis new version is almost identical to the timed and timedc code
41.1Scgdthat has been shipped for years by a workstation vendor.
51.1Scgd
61.1ScgdAmong the many changes:
71.1Scgd
81.1Scgdimprove `timedc msite` to accept a list of hostnames.
91.1Scgd
101.1Scgdchange slave-masters to answer the packets generated by `timedc msite`
111.1Scgd    with the name of the real master, not their own.  This makes it
121.1Scgd    possible to "chase the chain" of slave servers to the ultimate
131.1Scgd    master.
141.1Scgd
151.1Scgdmuch improve the log caused by `timedc trace on`:
161.1Scgd    -made `timed -t` work.
171.1Scgd    -suppression of repeated entries, which both slowed down the daemon
181.1Scgd	(sometimes catastrophically) and tended to make disks fill up
191.1Scgd	even more quickly.
201.1Scgd    -better time stamps on log entries
211.1Scgd    -more messages
221.1Scgd    -dump information about slaves, master, and so on each time
231.1Scgd	a message asking the log be turned on is received, and
241.1Scgd	when the log is turned off.
251.1Scgd    -fewer CPU cycles
261.1Scgd
271.1Scgduse a hash table to keep track of slaves, instead of the stupid linear
281.1Scgd    list.  This becomes handy with hundreds of slaves, instead of
291.1Scgd    the original design limit of "a room with a few VAX's."
301.1Scgd
311.1Scgdseparate the main protocol timer from that used to look for other networks
321.1Scgd    to master.
331.1Scgd
341.1Scgdtime stamp packets received by the daemon, so that time corrections
351.1Scgd    are not made (even more) inaccurate by waiting in the internal,
361.1Scgd    timed queue while the daemon is processing other messages.
371.1Scgd
381.1Scgdmade -n and -i work with subnets not named in /etc/networks
391.1Scgd
401.1Scgdcompute the median of the measured clocks, instead of the average
411.1Scgd    of "good" times.
421.1Scgd
431.1Scgdvastly improve the accuracy of the clock difference measure by 
441.1Scgd    `timedc clockdiff`.
451.1Scgd
461.1Scgduse adjtime() when possible, and directly set the clock only when
471.1Scgd    necessary.
481.1Scgd
491.1Scgdwhen the requested adjustment is small, perform only part of it, to
501.1Scgd    damp oscillations and improve the long term accuracy of the
511.1Scgd    adjustments.
521.1Scgd
531.1Scgdfix uncounted core-dumps on machines that do not allow dereferencing 0
541.1Scgd    in both the daemon and timedc.
551.1Scgd
561.1Scgdfix "master loop detection".
571.1Scgd
581.1Scgdfix several cases in which multi-homed masters could get into shouting 
591.1Scgd    matches, consuming all available network bandwidth and CPU cycles
601.1Scgd    (which ever runs out first), and convincing all bystanders to stop
611.1Scgd    advancing their own clocks.
621.1Scgd
631.1Scgdrefuse to behave badly when other machines do.  Instead of arguing forever,
641.1Scgd    go off and sulk when other machines refuse to play by the rules.
651.1Scgd
661.1Scgdincrease the maximum number of clients.
671.1Scgd
681.1Scgdadd "-F host,host2,..." to "freerun" or "trust" only some hosts.  This
691.1Scgd    is handy both when only some machines should be trusted to let
701.1Scgd    root use the `date` command to change time in the network.
711.1Scgd
721.1Scgd    It is also handy when one machine has some other way of adjusting
731.1Scgd    its clock, whether NTP or a direct radio or atomic connection.
741.1Scgd    "-F localhost" causes `timed` to "trust" only itself.
751.1Scgd
761.1Scgd    It is also handy to build a hierarchy of timed masters crossing
771.1Scgd    networks.  The TSP protocol has no provision of "goodness of clock",
781.4Smsaitoh    no natural way to completely heal network partitions.  Judicious
791.1Scgd    use of -F or -G can cause each gateway to trust only itself and
801.1Scgd    machines closer to a central machine with a radio or atomic clock.
811.1Scgd
821.1Scgdadd #ifdef code that supports NIS "netgroups" of trusted hosts, which
831.1Scgd    can be easier to administer than -F.
841.1Scgd
851.1Scgdadd #ifdef code to compute an aged total adjustment.  This can be used
861.1Scgd    in systems that can make long term changes in their system clock
871.1Scgd    frequency, e.g. "timetrim" in the Silicon Graphics kernel.
881.1Scgd
891.1Scgd
901.1ScgdProblems observed by others that are unresolved include:
911.1Scgd
921.1ScgdPractically any users can send to the master TSP messages and this
931.1Scgd	way corrupt the reliability of the system.  Authentication
941.1Scgd	of messages should be provided.  Unfortunately, that would
951.1Scgd	require changing the protocol with all of the implied
961.3Swiz	compatibility problems.  Fortunately, the new -F and -G args
971.1Scgd	can be used to cause the daemon to ignore time changes from
981.1Scgd	untrusted machines.
991.1Scgd
1001.1ScgdMAN.	The limit of 1013 on the number of slaves hosts should be doc'ed.
1011.1Scgd
1021.1Scgd	It should be dynamically allocated with no limit.  On a
1031.1Scgd	large network, one host could possibly master over many
1041.1Scgd	more than 30 hosts.   Given the timers in the code and
1051.1Scgd	effectively in the protocol, and the time required by each
1061.1Scgd	master to talk to each slave, it is not practical to have
1071.1Scgd	more than 200-300 slaves.  The master cannot keep up because
1081.1Scgd	the slave-chatting is single-threaded.  when the master
1091.1Scgd	gets behind, slaves start demanding elections.  To
1101.1Scgd	significantly increase the number of slaves would require
1111.1Scgd	multi-treading things, and given that a network with more
1121.1Scgd	than 300 directly addressable machines has worse problems
1131.1Scgd	than keep the time of day right, not worth worrying about.
1141.1Scgd
1151.1ScgdUGLY,CODE. timedc/cmds.c has a lots of repeated code in it.
1161.1Scgd
1171.1Scgd****    The first thing is that each command is set up as if it
1181.1Scgd	were an individual program taking argc and argv.  A more
1191.1Scgd	conventional calling style should be used.  I don't think
1201.1Scgd	any of the routines take more than a couple arguments.
1211.1Scgd
1221.1ScgdUGLY.	fxn definition syntax does't follow convention:
1231.1Scgd	has type on same line.
1241.1Scgd
1251.1Scgd****	It needs to be fixed at least enough that tags
1261.1Scgd	will work on it.  An entire cleanup might be nice later, but
1271.1Scgd	is noncritical.
1281.1Scgd
1291.1ScgdLOBBY(mildly),CODE:	Would be very convenient if date(1) took a
1301.1Scgd	+-<number> argument to set the time relatively.  With
1311.1Scgd	the advent of timed it is now reasonable to synchronize
1321.1Scgd	with WWV, which is nearly impossible to do "by hand"
1331.1Scgd	with just an absolute date, and scripts are too slow.
1341.1Scgd	format could be +-nn...nn.ss, where the '.' is required
1351.1Scgd	to remove ambiguity.
1361.1Scgd
1371.1Scgd****	If you want to do it go ahead.  It sounds useful.  As far as
1381.1Scgd	syntax goes, the normal format for the date should work just
1391.2Swiz	fine for this.  If the date is preceded by a plus or minus,
1401.1Scgd	the change is relative, otherwise it is absolute.
1411.1Scgd
1421.1Scgd
1431.1ScgdVernon Schryver.
1441.1Scgdvjs@sgi.com
145