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

Re: trace-{topo|tree} functional?



On Mon, 7 Sep 1998, Ahmed A-G Helmy wrote:
[ns docs, 31 August 1998, p115 section 16.1]
> Have you used the same example for multicast without the mcast 
> monitors...

Yup. It appears to execute fine; there's nothing much to see apart
from the

total=2

count of all nodes, which isn't useful. But that's not a very good
guide to what's going on, so I hacked in the usual nam finish stuff to
see what was happening (modified script below) - the result is the
remarkably short:

V -t * -v 1.0a5 -a 0
A -t * -n 1 -p 0 -o 255 -c 30 -a 1
A -t * -h 1 -m 4194303 -s 8
n -t * -a 0 -s 0 -S UP -v circle -c black
n -t * -a 1 -s 1 -S UP -v circle -c black
l -t * -s 0 -d 1 -S UP -r 1500000 -D 0.01 -o 

which is a bit lacking in time-based events, suggesting that the
multicast wasn't set up right for ns... and if multicast monitors
expect an actual multicast to be running for them to monitor, not
having one to hand could be the cause of the monitor problem and why
$mcastmonitor trace-{topo|tree} displays errors.

So, why doesn't the multicast code do anything? I'm hoping someone can
point out the obvious that I've missed.

puzzled,

L.

wondering if multicast monitors can be displayed in nam.

> I'm just trying to narrow down the problem... if it works , 
> then the problem is with the mcast monitors only... otherwise there could 
> be some interaction between multicast and the monitors..

<http://www.ee.surrey.ac.uk/Personal/L.Wood/>PGP<[email protected]>

set ns [new Simulator]
set f [open out.tr w]

$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf

# necessary to close tracefile and show results in nam
proc finish {} {
   global ns nf f
   $ns flush-trace
   close $nf
   puts "ns calculations complete; launching nam to show results"
   exec nam out.nam &
   exit 0
}


Simulator set EnableMcast_ 1       ;# enable multicast routing
Node expandaddr                    ;# expand address space, unneeded here
 
 
set group [Node allocaddr]         ;# allocate a multicast address

set mproto dynamicDM               ;# configure multicast protocol
set mrthandle [$ns mrtproto $mproto {}]
 ;# if an empty list is given, all nodes will contain multicast
   # protocol agents

set node0 [$ns node]               ;# create multicast-capable nodes
set node1 [$ns node]
Simulator set NumberInterfaces_ 1  ;# number of interfaces for all links
$ns duplex-link $node0 $node1 1.5Mb 10ms DropTail
                                   ;# create links with interfaces
 
set udp [new Agent/UDP]           ;# create a source agent at node 0
set src [new Application/Traffic/CBR]
$src attach-agent $udp
$udp set dst_ $group  

$ns attach-agent $node0 $udp
 
set rcvr [new Agent/LossMonitor] ;# create a receiver agent at node 1
$ns attach-agent $node1 $rcvr   
$ns at 0.3 "$node1 join-group $rcvr $group"
 ;# join the group at simulation time 0.3 (sec)
   
set mcastmonitor [$ns McastMonitor]
$mcastmonitor set period_ 0.03  ;# default 0.03 (sec)
 
# trace-tree almost works
# $mcastmonitor trace-tree $src $group
 
# but the alternative trace-topo fails entirely!
# $mcastmonitor trace-tree $src $group
 
$ns at 2.0 "finish"
$ns run