Dear NS-users, I have updated an old working NS script by replacing the source declaration:
set Src1 [new Agent/CBR] by set Src1 [new Application/Traffic/CBR] I now get the following error: (_o342 cmd line 1) invoked from within "_o342 cmd reset" invoked from within "catch "$self cmd $args" ret" invoked from within "if [catch "$self cmd $args" ret] { set cls [$self info class] global errorInfo set savedInfo $errorInfo error "error when calling class $cls: $args" $..." (procedure "_o342" line 2) (SplitObject unknown line 2) invoked from within "$a reset" (procedure "_o10" line 4) (Node reset line 4) invoked from within "$Node_($nn) reset" (procedure "_o3" line 12) (Simulator run line 12) invoked from within "$ns run" (file "MPLS-sim-example.tcl" line 316) I have looked for an implementation of the method reset in the source code and it appears that: - it is implemented for a node and calls the method reset of the CBR agent - this method seems not to exist (or at least I haven't found it?..)?? What should I do in orderr to get rid of this error? In which files are the agent: Agent/CBR and Application/traffic/CBR defined? I thank you a lot for your answers. Mit freundlichen Grüßen, with kind regards, cordialement, ---------------------------------------------------------- Gilles BERTRAND Telecom INT - University of Stuttgart ---------------------------------------------------------- **************Source of the script used*********************** # example found at the following URL : # http://mailman.isi.edu/pipermail/ns-users/2003-September/036046.html # modified by Gilles Bertrand - March 2006 set ns [new Simulator] puts "début du script" $ns color 0 yellow $ns color 1 magenta set nf [open test-mpls.nam w] set nx [open out.tr w] $ns namtrace-all $nf proc finish {} { puts "j\'entre dans la procédure finish" global ns nf nx $ns flush-trace close $nf close $nx exec nam test-mpls.nam & exec xgraph out.tr & exit 0 } #Define a procedure which periodically records the bandwidth received by the #three traffic sinks sink0/1/2 and writes it to the three files f0/1/2. proc record {} { global sink0 sink1 sink2 f0 f1 f2 global Dst0 nx ns puts "j\'entre dans la procédure record" #Set the time after which the procedure should be called again set time 0.1 #How many bytes have been received by the traffic sinks? set bw0 [$Dst0 set bytes_] set bw1 [$sink1 set bytes_] set bw2 [$sink2 set bytes_] #Get the current time set now [$ns now] #Calculate the bandwidth (in MBit/s) and write it to the files puts $nx "$now [expr $bw0/$time*8/1000000]" puts "$now $bw0 [expr $bw0/$time*8/1000000]" #puts $f1 "$now [expr $bw1/$time*8/1000000]" #puts $f2 "$now [expr $bw2/$time*8/1000000]" #Reset the bytes_ values on the traffic sinks $Dst0 set bytes_ 0 $sink1 set bytes_ 0 $sink2 set bytes_ 0 #Re-schedule the procedure $ns at [expr $now+$time] "record" } # # make nodes & MPLSnodes # puts "je definis les noeuds" set Node0 [$ns node] set Node1 [$ns node] $ns node-config -MPLS ON set LSR2 [$ns node] set LSR3 [$ns node] set LSR4 [$ns node] set LSR5 [$ns node] set LSR6 [$ns node] set LSR7 [$ns node] set LSR8 [$ns node] $ns node-config -MPLS OFF set Node9 [$ns node] set Node10 [$ns node] # # make links # puts "je definis les liens" $ns duplex-link $Node0 $LSR2 100Mb 1ms DropTail $ns duplex-link $Node1 $LSR2 100Mb 1ms DropTail $ns duplex-link $LSR2 $LSR3 100Mb 1ms DropTail $ns duplex-link $LSR3 $LSR4 100Mb 1ms DropTail $ns duplex-link $LSR4 $LSR8 100Mb 1ms DropTail $ns duplex-link $LSR2 $LSR5 100Mb 1ms DropTail $ns duplex-link $LSR5 $LSR6 100Mb 1ms DropTail $ns duplex-link $LSR5 $LSR4 100Mb 1ms DropTail $ns duplex-link $LSR6 $LSR7 100Mb 1ms DropTail $ns duplex-link $LSR6 $LSR8 100Mb 1ms DropTail $ns duplex-link $LSR7 $LSR8 100Mb 1ms DropTail $ns duplex-link $LSR7 $Node9 100Mb 1ms DropTail $ns duplex-link $LSR8 $Node10 100Mb 1ms DropTail # # configure ldp agents on all mpls nodes # puts "je configure LDP" #$ns configure-ldp-on-all-mpls-nodes #this is old way. for {set i 2} {$i < 9} {incr i} { for {set j [expr $i+1]} {$j < 9} {incr j} { set a LSR$i set b LSR$j eval $ns LDP-peer $$a $$b } } # # set ldp-message color # $ns ldp-request-color blue $ns ldp-mapping-color red #$ns ldp-withdraw-color magenta $ns ldp-withdraw-color green $ns ldp-release-color orange $ns ldp-notification-color yellow # # set ldp events # # $ns enable-control-driven #$ns enable-data-driven #$ns enable-on-demand #$ns enable-ordered-control # # trace mpls packets # #$LSR1 trace-mpls #$LSR2 trace-mpls #$LSR1 set ttl_ 32 # # make agent to send packets # puts "je definis les sources de traffic" set Src0 [new Application/Traffic/CBR] $ns attach-agent $Node0 $Src0 $Src0 set packetSize_ 5000 $Src0 set interval_ 0.010 set Src1 [new Application/Traffic/CBR] $ns attach-agent $Node1 $Src1 $Src1 set packetSize_ 5000 $Src1 set interval_ 0.010 #set Dst0 [new Agent/Null] set Dst0 [new Agent/LossMonitor] $ns attach-agent $Node9 $Dst0 set Dst1 [new Agent/Null] $ns attach-agent $Node10 $Dst1 $ns connect $Src0 $Dst0 $ns connect $Src1 $Dst1 $Src0 set fid_ 0 $Src1 set fid_ 1 for {set i 2} {$i < 9} {incr i} { set a LSR$i set m [eval $$a get-module "MPLS"] eval set LSR$i $m } #definition of the events puts "je définis les évènements" for { set timer 0.0} {$timer < 4.0} {set timer [expr $timer + 0.01]} { $ns at $timer "puts \"\ntout va bien: temps-> $timer\"" } $ns at 0.1 "$Src0 start" $ns at 0.1 "$Src1 start" $ns at 0.2 "$LSR7 send-ldp-withdraw-msg 9" $ns at 0.2 "$LSR8 send-ldp-withdraw-msg 10" $ns at 0.2 "$LSR7 ldp-trigger-by-withdraw 9 -1" $ns at 0.2 "$LSR8 ldp-trigger-by-withdraw 10 -1" $ns at 0.3 "$LSR2 flow-aggregation 9 -1 6 -1" $ns at 0.3 "$LSR2 flow-aggregation 10 -1 6 -1" $ns at 0.5 "$LSR6 ldp-trigger-by-withdraw 6 -1" $ns at 0.7 "$Src1 stop" $ns at 0.7 "$LSR2 make-explicit-route 7 5_4_8_6_7 3000 -1" $ns at 0.9 "$LSR2 flow-erlsp-install 9 -1 3000" $ns at 1.1 "$LSR2 ldp-trigger-by-release 7 3000" $ns at 1.2 "$LSR4 make-explicit-route 8 4_5_6_8 3500 -1" $ns at 1.4 "$LSR2 make-explicit-route 7 2_3_4_3500_7 3600 -1" $ns at 1.6 "$LSR2 flow-erlsp-install 9 -1 3600" $ns at 3.0 "$Src0 stop" $ns at 2.1 "$LSR2 pft-dump" $ns at 2.1 "$LSR2 erb-dump" $ns at 2.1 "$LSR2 lib-dump" $ns at 2.1 "$LSR3 pft-dump" $ns at 2.1 "$LSR3 erb-dump" $ns at 2.1 "$LSR3 lib-dump" $ns at 2.1 "$LSR4 pft-dump" $ns at 2.1 "$LSR4 erb-dump" $ns at 2.1 "$LSR4 lib-dump" $ns at 2.1 "$LSR5 pft-dump" $ns at 2.1 "$LSR5 erb-dump" $ns at 2.1 "$LSR5 lib-dump" $ns at 2.1 "$LSR6 pft-dump" $ns at 2.1 "$LSR6 erb-dump" $ns at 2.1 "$LSR6 lib-dump" $ns at 2.1 "$LSR7 pft-dump" $ns at 2.1 "$LSR7 erb-dump" $ns at 2.1 "$LSR7 lib-dump" $ns at 2.1 "$LSR8 pft-dump" $ns at 2.1 "$LSR8 erb-dump" $ns at 2.1 "$LSR8 lib-dump" #$ns at 0.3 "$LSR2 aggregate-flows 9 6 " #$ns at 0.3 "$LSR2 aggregate-flows 10 6 " #$ns at 0.5 "$LSR6 send-ldp-withdraw-msg 6" #$ns at 0.7 "$Src1 stop" #$ns at 0.7 "$LSR2 setup-erlsp 7 5_4_8_6_7 3000" #$ns at 0.9 "$LSR2 bind-flow-erlsp 9 -1 3000" #$ns at 1.1 "$LSR2 send-crldp-release-msg 3000" #$ns at 1.2 "$LSR4 setup-erlsp 8 4_5_6_8 3500" #$ns at 1.4 "$LSR2 setup-erlsp 7 2_3_4_L3500_7 3600" #$ns at 1.6 "$LSR2 bind-flow-erlsp 9 -1 3600" #$ns at 1.7 "$LSR2 pft-dump" #$ns at 1.7 "$LSR2 erb-dump" #$ns at 1.7 "$LSR2 lib-dump" #$ns at 1.7 "$LSR4 pft-dump" #$ns at 1.7 "$LSR4 erb-dump" #$ns at 1.7 "$LSR4 lib-dump" #$ns at 1.8 "$LSR7 send-crldp-withdraw-msg 3600" #$ns at 1.9 "$LSR8 send-crldp-withdraw-msg 3500" $ns at 0.0 "record" $ns at 3.0 "$Src0 stop" $ns at 3.0 "$Src1 stop" # # Calls the procedure "finish" # $ns at 3.1 "finish" # # The last line finally starts the simulation # puts "je lance la simulation" $ns run