[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick question about mcast routing



On 08 Feb 1999 09:43:41 PST, Yuri Pryadkin wrote: 
>[email protected] writes:
>
>> Hi everyone,
>> 
>> is there a quick way to discover the links belonging to
>> a multicast tree created by DM?
>> 
>> Christos.
>
>If this link is i->j, you'll need to check if the head of the link is
>an active target in any of i's replicators.  Something like this
>(untested) :
>
>DM instproc mcast-link {i j} {
>	$self instvar ns_
>	set head [[$ns_ link $i $j] head]
>	foreach rep [$i getReps "*" "*"] {
>		if { [$rep is-active-target $head] } {
>			return 1;
>		}
>	}
>	return 0
>}
>
>Since mcast uses bi-directional links, you'll have to check both
>directions.

Something like this probably works, but checking the head of the link
is not very portable.  In general code shouldn't depend on ordering of
the modules on the link since that ordering may change.  For example,
one might add a trace object at the head of the link.

A more portable way would be to modify the code that sets up the tree
to keep a separate list.  Unfortunately it's also probably more work.

   -John Heidemann