[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Hier/Mcast routing problem (please !)
Hi all,
i couldn't succeed in using multicast and hierarchical
routing at the same time (i am using ns-2.1b8);
i'd be glad if someone could send me a script i can
take as example :)
This is the script i've used
(the "hierarchical" lines are taken from an example in
the tcl/ex directory :) )
set ns [new Simulator -multicast on]
$ns set-address-format hierarchical
$ns namtrace-all [open aj/hier-out-a.nam w]
$ns trace-all [open aj/hier-out-a.tr w]
AddrParams set domain_num_ 2
lappend cluster_num 2 2
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 2 3 2 3
AddrParams set nodes_num_ $eilastlevel
set naddr {0.0.0 0.0.1 0.1.0 0.1.1 0.1.2 1.0.0 1.0.1
1.1.0 1.1.1 1.1.2}
for {set i 0} {$i < 10} {incr i} {
set n($i) [$ns node [lindex $naddr $i]]
}
$ns duplex-link $n(0) $n(1) 5Mb 2ms DropTail
$ns duplex-link $n(1) $n(2) 5Mb 2ms DropTail
$ns duplex-link $n(2) $n(3) 5Mb 2ms DropTail
$ns duplex-link $n(2) $n(4) 5Mb 2ms DropTail
$ns duplex-link $n(1) $n(5) 5Mb 2ms DropTail
$ns duplex-link $n(5) $n(6) 5Mb 2ms DropTail
$ns duplex-link $n(6) $n(7) 5Mb 2ms DropTail
$ns duplex-link $n(7) $n(8) 5Mb 2ms DropTail
$ns duplex-link $n(8) $n(9) 5Mb 2ms DropTail
set mproto DM
set mrthandle [$ns mrtproto $mproto {}]
set group0 [Node allocaddr]
set group1 [Node allocaddr]
set udp0 [new Agent/UDP]
$ns attach-agent $n(0) $udp0
$udp0 set dst_addr_ $group0
$udp0 set dst_port_ 0
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
set udp1 [new Agent/UDP]
$udp1 set dst_addr_ $group1
$udp1 set dst_port_ 0
$udp1 set class_ 1
$ns attach-agent $n(2) $udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 attach-agent $udp1
set rcvr [new Agent/LossMonitor]
$ns attach-agent $n(8) $rcvr
$ns at 1.0 "$cbr0 start"
$ns at 1.1 "$cbr1 start"
$ns at 1.2 "$n(8) join-group $rcvr $group1"
$ns at 1.25 "$n(8) leave-group $rcvr $group1"
$ns at 1.3 "$n(8) join-group $rcvr $group1"
$ns at 1.35 "$n(8) join-group $rcvr $group0"
$ns at 3.5 "finish"
proc finish {} {
global ns
$ns flush-trace
puts "running nam..."
exec nam aj/hier-out-a.nam &
exit 0
}
$ns run
and this is the error messge i get
invalid command name "P�"
while executing
"[$self set classifier_] install $dst $target"
(procedure "_o110" line 3)
(RtModule add-route line 3)
invoked from within
"$rtnotif_ add-route $dst $target"
(procedure "_o109" line 5)
(Node add-route line 5)
invoked from within
"$self add-route $address_ $dmux_"
(procedure "_o109" line 8)
(Node attach line 8)
invoked from within
"$node attach $mctrl_"
(procedure "_o331" line 4)
(DM init line 4)
invoked from within
"_o331 init _o3 _o109"
(Class create line 1)
invoked from within
"DM create _o331 _o3 _o109"
invoked from within
"catch "$className create $o $args" msg"
(procedure "new" line 3)
invoked from within
"new $mproto $self $node"
(procedure "_o3" line 2)
(Simulator mrtproto-iifs line 2)
invoked from within
"$self mrtproto-iifs $mproto $Node_($n) """
(procedure "_o3" line 23)
(Simulator mrtproto line 23)
invoked from within
"$ns mrtproto $mproto {}"
invoked from within
"set mrthandle [$ns mrtproto $mproto {}]"
(file "aj/hier3.tcl" line 34)
Thanks in advance.
______________________________________________________________________
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it