problem with running tcl script under ns 2.33
i have installed ns 2.33 and added the patch mobiwan for supprting mobile ipv6. when i tried to run my tcl script , i got segmentation fault, can anybody just why we get segmentation fault when we run tcl
[code] manju@manju-desktop:~/Desktop$ ns mytcl.tcl num_nodes is set 7 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl (except for MobiWAN simulations) INITIALIZE THE LIST xListHead >-------------------- NS Addressing --------------------< Domains (domain_num) : 4 Clusters (cluster_num) : 1 3 1 1 Nodes (nodes_num) : 1 1 2 1 1 1 >-------------------------------------------------------< Segmentation fault [\code] |
1) Code tags are [/code], not backslash like [\code].
2) I don't think anybody can answer your question, when the code in "mytcl.tcl" is unknown. Please attach the code. .. |
I have the code and the same question
The code is:
# Basic Mobile IPv6 example without using ns-topoman # Needs proc defined in file proc-mipv6-config.tcl Phy/WirelessPhy set RXThresh 2.64161e-10 Agent/MIPv6/MN set bs_forwarding_ 0 ; # 1 if forwarding from previous BS ################################################################ proc log-mn-movement_no_topo { } { global logtimer ns Class LogTimer -superclass Timer LogTimer instproc timeout {} { global mobile_ $mobile_ log-movement $self sched 1 } set logtimer [new LogTimer] $logtimer sched 1 } ################################################################ # Create Topology ################################################################ proc create-my-topo {} { global ns opt topo mobile_ cn_ mnn_nodes_ # Create and define topography set topo [new Topography] # set prop [new $opt(prop)] # $prop topography $topo $topo load_flatgrid 1000 1000 # god is a necessary object when wireless is used # set to a value equal to the number of mobile nodes create-god 6 # Call node-config $ns node-config \ -addressType hierarchical \ -agentTrace ON \ -routerTrace ON # Set NS Addressing AddrParams set domain_num_ 2 AddrParams set cluster_num_ {1 6} AddrParams set nodes_num_ {1 1 3 1 1 1} # Create Nodes set cn_ [create-router 0.0.0] $cn_ label "CN" set router_ [create-router 1.0.0] $router_ label "Router" set bs1_ [create-base-station 1.1.0 1.0.0 200 200 0] $bs1_ label "BS1" set bs2_ [create-base-station 1.2.0 1.0.0 200 600 0] $bs2_ label "BS2" set bs3_ [create-base-station 1.3.0 1.0.0 600 200 0] $bs1_ label "BS3" set bs4_ [create-base-station 1.4.0 1.0.0 600 600 0] $bs2_ label "BS4" set bs5_ [create-base-station 1.5.0 1.0.0 700 700 0] $bs1_ label "BS5" set mobile_ [create-mobile 1.1.1 1.1.0 190 190 0 1 0.01] $mobile_ label "MN" # Create Links $ns duplex-link $cn_ $router_ 100Mb 1.80ms DropTail $ns duplex-link $router_ $bs1_ 100Mb 1.80ms DropTail $ns duplex-link $router_ $bs2_ 100Mb 1.80ms DropTail $ns duplex-link $router_ $bs3_ 100Mb 1.80ms DropTail $ns duplex-link $router_ $bs4_ 100Mb 1.80ms DropTail $ns duplex-link $router_ $bs5_ 100Mb 1.80ms DropTail display_ns_addr_domain } ################################################################ # End of Simulation ################################################################ proc finish { } { global tracef ns namf opt mobile_ cn_ puts "Simulation finished" # Dump the Binding Update List of MN and Binding Cache of HA [[$mobile_ set ha_] set regagent_] dump [$cn_ set regagent_] dump [$mobile_ set regagent_] dump $ns flush-trace flush $tracef close $tracef close $namf #puts "running nam with $opt(namfile) ... " #exec nam $opt(namfile) & exit 0 } ################################################################ # Main ################################################################ proc main { } { global opt ns TOPOM namf n tracef mobile_ cn_ # Source Files # source set-def-options.tcl # set BASEDIR to your own correct path source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/proc-tools.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/proc-topo.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/ns-topoman.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-global.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-config.tcl source ~/fz/ns-allinone-2.33/ns-2.33/tcl/mobility/timer.tcl set NAMF out.nam set TRACEF out.tr set INFOF out.info set opt(mactrace) ON set opt(NAM) 1 set opt(namfile) $NAMF set opt(stop) 100 set opt(tracefile) $TRACEF #>--------------- Extract options from command line ---------------< #Getopt ; # Get option from the command line #DisplayCommandLine #>---------------------- Simulator Settings ----------------------< set ns [new Simulator] #>------------------------ Open trace files ----------------------< exec rm -f $opt(tracefile) set tracef [open $opt(tracefile) w] #... dump the file $ns trace-all $tracef set namf [open $opt(namfile) w] $ns namtrace-all $namf #>------------- Protocol and Topology Settings -------------------< create-my-topo log-mn-movement_no_topo set-cbr # set-ping-int 0.1 $cn_ $mobile_ 10 $opt(stop) #>----------------------- Run Simulation -------------------------< $ns at 40 "$mobile_ setdest 200.0 200.0 25.0" $ns at 80 "$mobile_ setdest 200.0 600.0 25.0" $ns at 120 "$mobile_ setdest 600.0 600.0 25.0" $ns at 160 "$mobile_ setdest 600.0 200.0 25.0" $ns at 180 "$mobile_ setdest 200.0 200.0 25.0" $ns at 40 "$mobile_ setdest 700.0 700.0 25.0" $ns at $opt(stop) "finish" $ns run $ns dump-topology $namf close $namf #puts "running nam with $opt(namfile) ... " #exec nam $opt(namfile) & } proc set-cbr { } { global ns cn_ mobile_ set udp [new Agent/UDP] $ns attach-agent $cn_ $udp set dst [new Agent/Null] $ns attach-agent $mobile_ $dst $ns connect $udp $dst set src [new Application/Traffic/CBR] $src set packetSize_ 1000 $src set rate_ 100k $src set interval_ 0.05 $src attach-agent $udp $ns at 20.0 "$src start" } main thanks a lot! |
this is the tcl file i tried to run. problem is when i run nam , it starts and then suddenly stops giving segmentation fault ,
Code:
# FIRST SCENARIO WITHOUT BUFFER Code:
manju@manju-desktop:~/Desktop$ nam out.nam |
@ zhouyaobin, post # 3 : Welcome to LQ.
Please edit post #3 to use 'code tags'. I.e. [/code] after the code, and [code] at code start. http://www.linuxquestions.org/questi....php?do=bbcode The code you show, is "simple_mobileipv6.tcl" It is explained in post #2 here, how to use it .. http://www.linuxquestions.org/questi...an_1-a-842686/ .. May be " ~ " isn't working for the path. The full path /home/<name>/ , etc. should be preferred. .. |
3 Attachment(s)
Post #4 manjunath11 : I edited the code to my path, and the output is
Code:
[knudfl@localhost ns-2.33]$ ./ns _mob.tcl.txt ( 'nam.out' is 21,9 kB gzipped. Attached as out.nam__mob_tcl_.gz.txt ). 'nam nam.out' works. But almost freezes the OS, when the play button is used. And the nam GUI will also close down. May be the file is too huge for nam to handle ? .. |
Hello,
I have installed ns-2.33 and mobiwan patch succesfully according to Nicta web page (O.Mehani). But when running the first, simple-mipv6.tcl script i get error regarding Agent/MIPv6/MN set bs_forwarding_ 0, as the Agent doesnt exist. Any thoughts about this issue? Am I missing something? Some extra configurations of certain files? Or, any manual or examples of scripts using Mobiwan patch and mipv6 in ns-2.33? Would appreciate any help a lot. kindest regards, Elena |
@ Elenka, post # 7 : Welcome to LQ.
Please read post # 5 and the connected link : http://www.linuxquestions.org/questi...an_1-a-842686/ ... where post #2 shows how to write your personal path in lines 93 .. 99. ... |
@Knudfl: Thank you!
Anyway, I ve just seen your reply... I will read the previous posts today as referred and I will give you my feedback afterward. Regards, Elena |
Although I have changed the source paths in the script, I keep on getting this message:
invalid command name "Agent/MIPv6/MN" while executing "Agent/MIPv6/MN set bs_forwarding_ 0 " (file "simple-mipv6.tcl" line 4) My script is the same mentioned in the previous posts, with correct paths (referring where they really are like: source /home/elena/NetSim/ns-allinone-2.33/ns-2.33/tcl/mobility/timer.tcl). Thats is the only change I ve made in this simple script. Anyway, just after pure installation of ns-2.33 on Ubuntu 9.10, I have applied the following patch (http://www.nicta.com.au/people/mehanio/nsmisc- Mobiwan patch for ns-2.33). And afterward a list of all files that have been patched was shown using this command (patch -p0 <ns-233-mobiwan-1.patch). Is it the same patch mentioned in previous posts? Or am I still missing something in my configuration? :-( I really hope I will get some help, or at least some instructions. BR, Elena |
Post # 10.
Suggest : Read the other "mobiwan threads" at LQ. May be, you will find some hints. LQ Search , Tag = mobiwan .. |
Thanks Knudfl:-)
Actually i forgot to write you that i managed to resolve my issue:-) Thank you for your previous posts and time once again!;-) Best regards! Elena |
how you could solve this problem please?
invalid command name "Agent/MIPv6/MN" while executing "Agent/MIPv6/MN set bs_forwarding_ 0 " (file "simple-mipv6.tcl" line 4) |
Post # 13, @ rochd : Welcome to LQ.
May be read posts #10 - #11. Or ask @Elenka, if she has some other solution. Good luck ! .. |
thanks Knudf
@Elenka how you could solve this problem please? invalid command name "Agent/MIPv6/MN" while executing "Agent/MIPv6/MN set bs_forwarding_ 0 " (file "simple-mipv6.tcl" line 4) |
All times are GMT -5. The time now is 07:38 AM. |