[net.news.b] What is MULTICAST? 2.10.3 news option

kre@munnari.OZ (Robert Elz) (12/09/85)

In article <1240@hpda.UUCP>, bd@hpda.UUCP (Bob Desinger) writes:
> I came across several chunks of "#ifdef MULTICAST" code in ifuncs.c,
> What kind of feeds would benefit most from multicast?

Since I'm responsible for the MULTICAST code, and its apalling
lack of documentation, I suppose I should say something...

The kinds of links where its useful (so all of you who
don't have, and never will have, such a link can hit the 'n'
key) are those where you have a store and forward network that
can send a message to multiple destination systems in one
command (hence the name).

Now that's not UUCP ...  nor is it TCP/IP, and I suspect its
not RSCS either.  However, if you happen to have SunIII (the
underlying network code of ACSnet) then you're in luck!

MULTICAST is ifdef'd as only a small proportion of the net
will find it useful at all (but see near the end of this
message about a possible relationship of news & mail).

Now to how its used ...  Bob is right, its based on the M
flag in the sys file.  If that flag exists, the the fourth
field becomes a "multi-cast name", simply a string, which is
assumed to exist somewhere else in the sys file as a system
name (and following the line that uses it with the M flag).
To make what I'm about to say a little clearer, I think an
example is needed ...

	ME:all::
	siteA:net,!net.flame,!net.religion,mod:M:Msite
	siteB:net,!net.flame,mod:M:Msite
	Msite:net::send %s

If an article in net.news arrives at the local site, then
it would (ignoring the M flag for now) be sent to each of
siteA, siteB, and Msite.  With the M flag, the same happens
except that only one command is run.  This has the advantage
that news processing is faster (less forks/execs) and less
spool space is used to store the news awaiting transmission.
(It may or may not save actual net traffic, depending on the
links being used - but that isn't the aim).

The command is that in the 4th field of the Msite line, it
gains an extra %s argument - that argument is repeated as
many times as there were sites with the M flag that want
this news item, each time with one of the site names replacing
the %s.  Notice, that the Msite name is not one of those,
if we want to arrange that the news be sent to this site
that must be coded into the args given.

Now typically, Msite is not a net site at all, its a fiction
just for the use of the M flag, and the command run does not
send to a site called "Msite", just to the sites interpolated
by the %s.

An article in net.news will run the command
	send siteA siteB
whereas an article in net.religion would run
	send siteB
as siteA doesn't want that group.

Here we get our first complication - assume an article
arrives in net.flame (which no-one wants...).  Now there are
no systems that want the article, but the group selection in
the line for Msite still includes it (it need not if you knew
in advance that no-one wants it, but that may be hard to determine
when things start getting more complicated, with Distribution
headers affecting things).  As it stands, inews would run the
command
	send
which shouldn't do any harm, but is likely to be wasteful (and
who wants to waste resources on net.flame?).  Inews cannot simply
not run the command, as it may be that this command really does send
to a site "Msite".  Instead, there is yet another sys file flag ('O')
to tell inews that running this command is unnecessary (or perhaps
even harmful) if there were no M flag lines that referred to this
line.

Now for the last complication.  Assume an article arrives in mod.general.
This should go to both siteA and siteB, but the line for Msite doesn't
include it, so that isn't used.  If the fragment resented above were
the entire sys file, then this article simply would not be sent (though
in the log file it may look as if it was...).  Here we get to another
"new feature" of 2.10.3.

There can be multiple sys file lines with the same site name.
This applies regardless of MULTICAST.  In this case, inews
simply goes through them in sequence, selecting the first
in the sys file that this article can be sent to, and ignoring
any after that.

Now I've let that out of the bag - let me tell you what its NOT
for.  Its NOT to allow you to split long sys file lines...  there
are other ways to do that!  There are a couple of uses which I will
leave you to imagine, but of interest here, assume that we have another
line in the sys file
	Msite:mod:O:send -h %s
Now our article in mod.general will run the command
	send -h siteA siteB
which we might imagine to send the news at higher priority than
the normal send.  (I must add here that these examples are fictional,
the details of how this is actually done with SunIII would simply
bore you).

To complete this, I just need to remark that the if the M
flag is used, no other flags make sense.  But on the Msite
line, all the flags except M can be used (yes, even F, though
its not yet clear that this is remarkably useful - the batch
file format is modified to include the names of the systems
to which this news article is to be sent, but the batch program
knows nothing at all about this refinement...)

While I'm clearing the air of new stuff in 2.10.3 which isn't
documented as I'm notorious for not documenting anything, and
which is also unrelated to MULTICAST ...

The first field in the sys file has always had two uses, except
that before it was convenient to think of them as one.  First it
names the system to which you are going to send news, and second
it indicates that if the news has already been to that system
it should not be sent again.  (The first of those is actually just
a convention, there's nothing to stop the command that's run from
sending the news to some system completely unrelated to the name
in the first field).

This has been extended to allow the first field to have the format

	name/a,b,c,..

Here "name" is the traditional first field, and works exactly
the same way.  The other names (a,b,c) list sites that if they
appear on the path line anywhere, exclude this line from use.
That is, if the news item being retransmitted has ever visited
any of the sites "name", "a", "b", or "c", it will not be sent
to "name" (unless there is another line for the "name" system).

This can be used as an adjunct to the L flag (and yes, that
is in 2.10.3) to strengthen news links without transmiting
news to a site that you know almost certainly has it already.
Eg: assume that there are 5 sites

     -- A ---- ME ----- B
	       |        |
	       C--------D---


Now, if you get news from B that B got from D, its obviously
useless to send it to C - you know that D will be sending it
there as well.  Before, you would simply have not sent any news
to C, or perhaps you would have included an "L" flag, so only
news originating at your site (or perhaps A and B) would be sent
to C.  However, you may really want to send any news item that you
get from A to C as well, regardless of how many hops it has
already passed along, you can do that now ...

	ME:all::
	A:net,mod::
	B/D:net,mod::
	C/D:net,mod::

Lastly, the promised use of MULTICAST, for at least some, normal,
ordinary, uucp net sites, which I offer as a bonus to anyone who
has kept reading this far...

Some sites like to mail news items to people to read, and forget
readnews/rn/vnews altogether, or perhaps to mail some newsarticles
to people at sites that don't get news.  Now it happens, that
all (sane) mail systems allow multicast addressing, when the "address"
in this case, is an ordinary mail address.  (In English, what I
just said is that the "mail" command can send to multiple people...)

To use multicast to do that, you might have a sys file that looks
like...

	ME:all::
	fred:net.unix-wizards:M:NewsMail
	joe:net.unix-wizards,net.news.sa:M:NewsMail
	bill:net.jokes,net.sources,mod.movies:M:NewsMail
	jane@remotehost.arpa/remotehost:net.unix-wizards:M:NewsMail
	NewsMail:all:O:mail %s

Now, if an article in net.unix-wizards arrives, the command

	mail fred joe jane@remotehost.arpa < article

will be run (unless the article has been to "remotehost" already
in which case jane won't be sent it).  Notice that the names
in the mail command are the same as the "system" names in
the first field - this is inherent in the design, but notice
also that various magic characters are legal (and always
have been).

Lastly, a warning - there are (fairly small) limits on the use
of the M flag - no single article can be sent to more than "n"
different "multicast" sites (that is, there can't be more than
n different 4th fields on lines that have the M flag, and to
which this article is to be sent).  Also, no single multicast
site can multicast an article to more than "m" recipient sites.
(That is, a limit on the number of expansions of the %s arg
in the 4th field of the Msite line).  I think these numbers
are set at 10 & 20 resp (but you should check the source - they
are easy to alter if you need to).  If either of these is exceeded
then inews will "xerror" and not continue processing the offending
article (which is something to be avoided!).

Robert Elz	seismo!munnari!kre  kre%munnari.oz@seismo.css.gov

ps: No, there's no point in asking me when 2.10.3 will be generally
available.  That's entirely up to Rick.

pps: if you've read the above, you know why I rarely write documentation!