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

[ns] Multicast monitoring



Hi everybody,
i've just started running simulations on multicast routing and i'm
allready experiencing some problems:
when i run the script below i get this error message:

_o3 : unable to dispatch method McastMonitor
       while executing
"$ns McastMonitor"
       invoked from within
"set mmonitor [$ns McastMonitor]"

I believe that the problem is to be found among these lines:

set mmonitor [$ns McastMonitor]
set chan [open multmon.tr w]
$mmonitor attach $chan
$mmonitor set period_ 0.04
$mmonitor filter IP dst_ $group


although they are quite similar to the ones quoted in the NS manual.
Please give me some hints,
thanks in advance,
                      Andrea Josi.



set ns [new Simulator -multicast on]

set nf [open outmult.nam w]
$ns namtrace-all $nf
$ns color 1 Red

proc finish  {  }  {
                global ns nf
                $ns flush-trace
                close $nf
                exec nam  outmult.nam &
                exit 0
             }

set group [Node allocaddr]

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n1 $n3 1Mb 10ms DropTail

set mproto CtrMcast
set mrthandle [$ns mrtproto $mproto ]

set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
set src0 [new Application/Traffic/CBR]
$src0 attach-agent $udp0
$udp0 set dst_addr_ $group
$udp0 set fid_ 1

set rcv2 [new Agent/Null]
$ns attach-agent $n2 $rcv2
set rcv3 [new Agent/Null]
$ns attach-agent $n3 $rcv3


set mmonitor [$ns McastMonitor]
set chan [open multmon.tr w]
$mmonitor attach $chan
$mmonitor set period_ 0.04
$mmonitor filter IP dst_ $group

$ns at 0.01 "$src0 start"
$ns at 0.3 "$n2 join-group $rcv2 $group"
$ns at 0.3 "$n2 color red"
$ns at 0.6 "$n3 join-group $rcv3 $group"
$ns at 0.6 "$n3 color red"
$ns at 1.0 "$n3 leave-group $rcv3 $group"
$ns at 1.0 "$n3 color black"

$ns at 1.2 "finish"
$ns run