*BSD News Article 66187


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!in-news.erinet.com!bug.rahul.net!rahul.net!a2i!genmagic!sgigate.sgi.com!swrinde!elroy.jpl.nasa.gov!decwrl!amd!netcomsv!uu4news.netcom.com!rhyolite.com!rhyolite.com!not-for-mail
From: vjs@calcite.rhyolite.com (Vernon Schryver)
Newsgroups: comp.unix.bsd.bsdi.misc,comp.unix.bsd.misc
Subject: Re: Timed and time-zones
Date: 19 Apr 1996 16:11:08 -0600
Organization: Rhyolite Software
Lines: 71
Message-ID: <4l931s$r2i@calcite.rhyolite.com>
References: <3177D99A.2F6A@youngman.demon.co.uk>
NNTP-Posting-Host: calcite.rhyolite.com
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:3266 comp.unix.bsd.misc:753

In article <3177D99A.2F6A@youngman.demon.co.uk>,
Jeremy Youngman  <jeremy@youngman.demon.co.uk> wrote:

> ...
>Is anybody using this successfully? Any idea what the -F flag means?
>Can I enforce a system to be a slave (when I've started Timed with no 
>parms it still sometimes becomes a master). Can you easily tell Timed
>to be a master on one port and slave on another? Likewise can you 
>easily tell Timed not to be active (listen or broadcast) on a certain
>port? It looks like the latter can be done by telling it to ignore
>networks, but there could be many networks ultimately able to access
>either port; also I've not had much luck with this - do you really
>need to update /etc/networks?

The -F flag means "Free run".  I added it in about 1987 in imitation of
what I understood Richard Johnsson at decwrl had done to his version.
It evolved a little bit after that.  -F takes a list of hostnames, and
only trusts those hosts, and tries to shut up other would-be mediators.

Note that "master" and "slave" are unfortunate words to describe the
`timed` participants.  People consistently misunderstand the protoocol
by looking only at the words "master" and "slave" and not how things
actually work.  Better words are "moderator" and "consituent".  The
moderator only collects ticks from other clocks on the network, including
its own, and then redistributes the averaged result.  -F skews that
collecting a little; the clocks of machines not in the list are
not add to the averaged.


>What I really want is one machine to always be a master on one port
>and slave on another, and another machine to be a slave on one port
>and not interfere on the other.

That is exactly the intended application of -F.

If you don't feel like chucking timed and using NTP, consider:
    1. on one machine with a reference clock, such as a WWV or GPS
	receiver, run with "-F localhost".  Since it only listens
	to itself, it will refuse to allow other systems within
	broadcast range to become moderator, and it will let its own
	clock free run or be adjusted by some other program such
	as `timeslave`.

    2. make a list of IP hostnames of IP gateways (routers) within
	reach of a broadcast of the machine in step one, including the
	machine in step one.  Let call this list timelords1 (or use a
	NIS netgroup if you have NIS).  On all of those machines, run
	`timed -F <timelords1>`

	Should the master in step one die, a moderator will be elected
	by the machines in timelords1, and it will average their
	ticks.  It is ok to add non-gateways to the list to improve
	the accuracy of the ticks

    3. make a list of IP gateways within reach of a broadcast of any
	machine in timelords1.  Call this list timelords2, and use
	`timed -F <timelords2>` on all of those machines.
	Notice that if all of the gateways toward the master die,
	the right thing happens to time.

    4. repeat until you reach the end of the net.

This scheme is still in use in the engineering organization at my daytime
employer. The deepest I've seen it used is about timelords7, but the
net has become so interconnected that only timelords4 is needed.

I think all of this is at least somewhat described in the 4.4BSD-Lite
timed man page.


Vernon Schryver    vjs@rhyolite.com