hello: it's been a week that I'm trying to modify an example I found in the source code of the module that implements the protocol PIM-SM, the amendment relates to the use of "gt-itm" for the generation of a graph but I Always get the same error.
*Source:* * * # create a simulator instance with multicast features on set ns [new Simulator -multicast on] # define trace files... set pimTraceFile [open pimTracev3.tr w] $ns trace-all $pimTraceFile set pimNamFile [open pimTrace.nam w] $ns namtrace-all $pimNamFile # cbr packets colors $ns color 1 red $ns color 2 green # prune/graft packets $ns color 30 purple $ns color 31 blue # create nodes... set opt(topology) "../scene/r20/r20-0.tcl" source $opt(topology) set num_nodes [create-topology ns n 10Mb] # change shape and color of RP and sources $n(0) shape square; #Rendezvous Point 0 $n(3) shape hexagon; #Source 3 $n(3) color red; $n(9) shape hexagon; #Source 9 $n(9) color green; # topology # Alloc multicast address set pimGroup0 [Node allocaddr] # Setup source 3 set udp3 [new Agent/UDP] $udp3 set dst_addr_ $pimGroup0 $udp3 set dst_port_ 0 $udp3 set class_ 1 $ns attach-agent $n(3) $udp3 set cbr3 [new Application/Traffic/CBR] $cbr3 attach-agent $udp3 # Setup source 9 set udp9 [new Agent/UDP] $udp9 set dst_addr_ $pimGroup0 $udp9 set dst_port_ 0 $udp9 set class_ 2 $ns attach-agent $n(9) $udp9 set cbr9 [new Application/Traffic/CBR] $cbr9 attach-agent $udp9 # Setup receivers (1, 4, 5, 10, 11) set rcvr1 [new Agent/LossMonitor] $ns attach-agent $n(1) $rcvr1 set rcvr4 [new Agent/LossMonitor] $ns attach-agent $n(4) $rcvr4 set rcvr5 [new Agent/LossMonitor] $ns attach-agent $n(5) $rcvr5 set rcvr10 [new Agent/LossMonitor] $ns attach-agent $n(10) $rcvr10 set rcvr11 [new Agent/LossMonitor] $ns attach-agent $n(10) $rcvr11 # define unicast and multicast protocols to use... $ns rtproto DV PIM set RP_($pimGroup0) $n(0) $ns mrtproto PIM # schedule join/leave events... $ns at 0.0 "$ns set-animation-rate 10ms" $ns at 0.10 "$ns set-animation-rate 0.2ms" $ns at 0.10 "$ns trace-annotate \"Receiver on Node 1 joins the group...\"" $ns at 0.10 "$ns trace-annotate \"Node 1 sends Join towards group RP.\"" #$ns at 0.10 "$n(1) join-group $rcvr1 $pimGroup0" $ns at 0.12 "$ns trace-annotate \"Receiver on Node 4 joins the group...\"" $ns at 0.12 "$ns trace-annotate \"Node 4 sends Join towards group RP.\"" $ns at 0.12 "$n(4) join-group $rcvr4 $pimGroup0" $ns at 0.14 "$ns trace-annotate \"Receiver on Node 5 joins the group...\"" $ns at 0.14 "$ns trace-annotate \"Node 5 sends Join towards group RP.\"" $ns at 0.14 "$n(5) join-group $rcvr5 $pimGroup0" $ns at 0.16 "$ns trace-annotate \"Receiver on Node 10 joins the group...\"" $ns at 0.16 "$ns trace-annotate \"Node 10 sends Join towards group RP.\"" $ns at 0.16 "$n(10) join-group $rcvr10 $pimGroup0" $ns at 0.18 "$ns trace-annotate \"Receiver on Node 11 joins the group...\"" $ns at 0.18 "$ns trace-annotate \"Node 11 sends Join towards group RP.\"" $ns at 0.18 "$n(11) join-group $rcvr11 $pimGroup0" $ns at 0.20 "$ns trace-annotate \"Shared Tree branches created.\"" $ns at 0.25 "$ns trace-annotate \"Source at Node 3 starts sending... \"" $ns at 0.25 "$ns trace-annotate \"Node 3 forwards CBR packets to RP.\"" $ns at 0.25 "$cbr3 start" $ns at 0.30 "$ns trace-annotate \"Node 10 decides to join source (3) tree...\"" $ns at 0.30 "$ns trace-annotate \"Node 10 sends Join towards Node 3.\"" $ns at 0.30 "$n(10) join-group $rcvr10 $pimGroup0 $n(3)" $ns at 0.3328 "$ns trace-annotate \"Source Tree branch 3-2-6-10 created.\"" $ns at 0.34 "$ns trace-annotate \"Node 2 is now receiving source 3 traffic from nodes 3 and 0.\"" $ns at 0.34 "$ns trace-annotate \"Node 2 prunes source 3 from shared tree.\"" $ns at 0.356 "$ns trace-annotate \"Node 0 blocks source 3 traffic on branch 0-2.\"" $ns at 0.36 "$ns trace-annotate \"Traffic is now being forwarded on both trees.\"" $ns at 0.40 "$ns trace-annotate \"Source at Node 9 starts sending... \"" $ns at 0.40 "$ns trace-annotate \"Node 9 forwards CBR packets to RP.\"" $ns at 0.40 "$cbr9 start" $ns at 0.56 "$ns set-animation-rate 0.2ms" $ns at 0.56 "$ns trace-annotate \"Node 11 decides to join source (9) tree...\"" $ns at 0.56 "$ns trace-annotate \"Node 11 sends Join towards Node 9.\"" $ns at 0.56 "$n(11) join-group $rcvr11 $pimGroup0 $n(9)" $ns at 0.61 "$ns trace-annotate \"Source Tree branch 9-4-2-6-11 created.\"" $ns at 0.63 "$ns trace-annotate \"Node 2 is now receiving source 9 traffic from nodes 4 and 0.\"" $ns at 0.63 "$ns trace-annotate \"Node 2 prunes source 9 from shared tree.\"" $ns at 0.646 "$ns trace-annotate \"Node 0 blocks source 9 traffic on branch 0-2.\"" $ns at 0.67 "$ns trace-annotate \"Some group members are connected to source based trees.\"" $ns at 0.67 "$ns trace-annotate \"All members are connected to the shared tree.\"" $ns at 0.70 "$ns set-animation-rate 20ms" $ns at 4.50 "$ns set-animation-rate 0.2ms" $ns at 4.50 "$ns trace-annotate \"Node 10 leaves source 3 only...\"" $ns at 4.50 "$n(10) leave-group $rcvr10 $pimGroup0 $n(3)" $ns at 4.60 "$ns trace-annotate \"Node 11 leaves group...\"" $ns at 4.60 "$n(11) leave-group $rcvr11 $pimGroup0" $ns at 4.70 "$ns trace-annotate \"Node 4 leaves group...\"" $ns at 4.70 "$n(4) leave-group $rcvr4 $pimGroup0" $ns at 4.80 "$ns trace-annotate \"Node 5 leaves group...\"" $ns at 4.80 "$n(5) leave-group $rcvr5 $pimGroup0" $ns at 4.90 "$ns trace-annotate \"Node 1 leaves group...\"" $ns at 4.90 "$n(1) leave-group $rcvr1 $pimGroup0" $ns at 4.95 "$ns trace-annotate \"Source at Node 3 stops sending... \"" $ns at 4.95 "$cbr3 stop" $ns at 4.98 "$ns trace-annotate \"Source at Node 9 stops sending... \"" $ns at 4.98 "$cbr9 stop" $ns at 5.00 "$ns trace-annotate \"Simulation finished... \"" $ns at 5.00 "finish" proc finish {} { global ns pimTraceFile pimNamFile $ns flush-trace close $pimTraceFile close $pimNamFile puts "running nam pimTrace.nam..." exec nam pimTrace.nam & exit 0 } $ns run *error message:* ns: _o39 join-group _o929 -2147483648: can't read "Node_(-1)": no such element in array while executing "return $Node_($id)" (procedure "_o3" line 3) (Simulator get-node-by-id line 3) invoked from within "$ns_ get-node-by-id [[$ns_ get-routelogic] lookup $id_ $srcID]" (procedure "_o39" line 6) (Node rpf-nbr line 6) invoked from within "$self rpf-nbr $node" (procedure "_o39" line 6) (Node from-node-iface line 6) invoked from within "$node_ from-node-iface $RP_($group)" (procedure "_o986" line 11) (PIM join-rpt line 11) invoked from within "$self join-rpt $group" (procedure "_o986" line 10) (PIM join-group line 10) invoked from within "_o986 join-group -2147483648" ("eval" body line 1) invoked from within "eval $p $op $args" invoked from within "if ![info exists protos($p)] { set protos($p) 1 eval $p $op $args }" (procedure "_o45" line 5) (mrtObject all-mprotos line 5) invoked from within "_o45 all-mprotos join-group -2147483648" ("eval" body line 1) invoked from within "eval $self all-mprotos join-group $grp $src" (procedure "_o45" line 2) (mrtObject join-group line 2) invoked from within "$mrtObject_ join-group $group $src" (procedure "_o39" line 5) (Node join-group line 5) invoked from within "_o39 join-group _o929 -2147483648" -- -- cordialement ------------------------------------------------------------------------- BADDI YOUSSEF Master de Recherche en GĂ©nie Informatique ENSIAS, RABAT Tel: +212 672 43 54 15 ---------------------------------------------------------------------------