Quote:
Originally Posted by manjunath11
post the error message
|
Thanks for replay, the error shown below:
$ ns simple-mipv6-2.tcl
invalid command name "\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\
f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fcharset178{\*\fname Aria
l;}Arial (Arabic);}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\ltrpar\f0\fs24 # Basic
Mobile IPv6 example without using ns-topoman\par
# Needs proc defined in file proc-mipv6-config.tcl\par
\par
Agent/MIPv6/MN set bs_forwarding_ 0 ; # 1 if forwarding from previous
BS\par
################################################################\par
proc log-mn-movement_no_topo \{ \} \{\par
global logtimer ns\par
Class LogTimer -superclass Timer\par
LogTimer instproc timeout \{\} \{\par
\tab global mobile_\par
$mobile_ log-movement \par
$self sched 1 \par
\}\par
set logtimer [new LogTimer]\par
$logtimer sched 1 \par
\}\par
\par
################################################################\par
# Create Topology\par
################################################################\par
proc create-my-topo \{\} \{\par
global ns opt topo mobile_ cn_ mnn_nodes_\par
\par
# Create and define topography\par
set topo [new Topography]\par
# set prop [new $opt(prop)]\par
# $prop topography $topo\par
$topo load_flatgrid 800 800 \par
\par
# god is a necessary object when wireless is used\par
# set to a value equal to the number of mobile nodes\par
create-god 5 \par
\par
# Call node-config\par
$ns node-config \\\par
-addressType hierarchical \\\par
\tab -agentTrace ON \\\par
\tab -routerTrace ON \par
\par
# Set NS Addressing\par
AddrParams set domain_num_ 2 \par
AddrParams set cluster_num_ \{1 5\}\par
AddrParams set nodes_num_ \{1 1 3 1 1 1\}\par
\par
# Create Nodes\par
set cn_ [create-router 0.0.0]\par
set router_ [create-router 1.0.0]\par
set bs1_ [create-base-station 1.1.0 1.0.0 200 200 0]\par
set bs2_ [create-base-station 1.2.0 1.0.0 200 600 0]\par
set bs3_ [create-base-station 1.3.0 1.0.0 600 200 0]\par
set bs4_ [create-base-station 1.4.0 1.0.0 600 600 0]\par
set mobile_ [create-mobile 1.1.1 1.1.0 190 190 0 1 0.01]\par
\par
\par
# Create Links\par
$ns duplex-link $cn_ $router_ 100Mb 1.80ms DropTail\par
$ns duplex-link $router_ $bs1_ 100Mb 1.80ms DropTail\par
$ns duplex-link $router_ $bs2_ 100Mb 1.80ms DropTail\par
\par
display_ns_addr_domain\par
\}\par
\par
################################################################\par
# End of Simulation\par
################################################################\par
proc finish \{ \} \{\par
global tracef ns namf opt mobile_ cn_\par
\par
puts "Simulation finished" \par
# Dump the Binding Update List of MN and Binding Cache of HA\par
[[$mobile_ set ha_] set regagent_] dump\par
[$cn_ set regagent_] dump\par
[$mobile_ set regagent_] dump\par
\par
$ns flush-trace\par
flush $tracef\par
close $tracef\par
close $namf\par
#puts "running nam with $opt(namfile) ... "\par
#exec nam $opt(namfile) &\par
exit 0\par
\}\par
\par
\par
################################################################\par
# Main \par
################################################################\par
proc main \{ \} \{\par
global opt ns TOPOM namf n tracef mobile_ cn_ \par
# Source Files\par
# source set-def-options.tcl \par
# set BASEDIR to your own correct path\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/proc-mipv6-config.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/proc-tools.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/proc-topo.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/ns-topoman.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/proc-mobi-global.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/lib/proc-mobi-config.tcl\par
source /usr/src/ns-allinone-2.32/ns-2.32/tcl/mobility/timer.tcl\par
\par
set NAMF out.nam\par
set TRACEF out.tr\par
set INFOF out.info\par
\par
set opt(mactrace) ON\par
set opt(NAM) 1 \par
set opt(namfile) $NAMF\par
set opt(stop) 100\par
set opt(tracefile) $TRACEF\par
\par
#>--------------- Extract options from command line ---------------<\par
#Getopt\tab ; # Get option from the command line\tab\par
#DisplayCommandLine\par
\par
#>---------------------- Simulator Settings ----------------------<\par
set ns [new Simulator]\par
#>------------------------ Open trace files ----------------------<\par
exec rm -f $opt(tracefile)\par
set tracef [open $opt(tracefile) w]\par
#... dump the file\par
$ns trace-all $tracef\par
\par
set namf [open $opt(namfile) w]\par
$ns namtrace-all $namf\par
\par
#>------------- Protocol and Topology Settings -------------------<\par
create-my-topo\par
log-mn-movement_no_topo\par
\par
set-cbr\par
# set-ping-int 0.1 $cn_ $mobile_ 10 $opt(stop)\par
\par
\par
#>----------------------- Run Simulation -------------------------<\par
$ns at $opt(stop) "finish"\par
$ns run\par
\par
$ns dump-topology $namf\par
close $namf\par
#puts "running nam with $opt(namfile) ... "\par
#exec nam $opt(namfile) &\par
\}\par
\par
proc set-cbr \{ \} \{\par
global ns cn_ mobile_\par
set udp [new Agent/UDP]\par
$ns attach-agent $cn_ $udp\par
\par
set dst [new Agent/Null]\par
$ns attach-agent $mobile_ $dst\par
$ns connect $udp $dst\par
\par
set src [new Application/Traffic/CBR]\par
$src set packetSize_ 1000\par
$src set rate_ 100k\par
$src set interval_ 0.05\par
$src attach-agent $udp\par
$ns at 20.0 "$src start"\par
\} \par
\par
main\par
\par
\par
\pard\rtlpar\qr\lang1065\f1\rtlch\fs20\par
"
while executing
"{\rtf1\fbidis\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcha
rset0 Times New Roman;}{\f1\fswiss\fcharset178{\*\fname Arial;}Arial (A..."
(file "simple-mipv6-2.tcl" line 1)