LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-06-2010, 12:46 AM   #1
manjunath11
LQ Newbie
 
Registered: Nov 2010
Posts: 18

Rep: Reputation: 0
problem with ns 2.33 and Mobiwan_1


hi,
when i tried to run simple_mobileipv6.tcl on ns2.33 with mobiwan patch added. i got the following error.
Code:
manju@manju-desktop:~/Desktop$ ns simple_mobileipv6.tcl
couldn't read file "BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl": no such file or directory
    while executing
"source.orig BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel source.orig[list $fileName]"
    invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
    (procedure "source" line 8)
    invoked from within
"source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl"
    (procedure "main" line 6)
    invoked from within
"main"
    (file "simple_mobileipv6.tcl" line 161)
what might be the problem , please anybody help me out, simple_mobileipv6.tcl is follows
Code:
 
# Basic Mobile IPv6 example without using ns-topoman
# Needs proc defined in file proc-mipv6-config.tcl

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 800 800 

  # god is a necessary object when wireless is used
  # set to a value equal to the number of mobile nodes
  create-god 5 

  # 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 5}
  AddrParams set nodes_num_ {1 1 3 1 1 1}

  # Create Nodes
  set cn_ [create-router 0.0.0]
  set router_ [create-router 1.0.0]
  set bs1_ [create-base-station 1.1.0 1.0.0 200 200 0]
  set bs2_ [create-base-station 1.2.0 1.0.0 200 600 0]
  set bs3_ [create-base-station 1.3.0 1.0.0 600 200 0]
  set bs4_ [create-base-station 1.4.0 1.0.0 600 600 0]
  set mobile_ [create-mobile 1.1.1 1.1.0 190 190 0 1 0.01]


  # 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

  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 BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl
   source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-tools.tcl
   source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-topo.tcl
   source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/ns-topoman.tcl
   source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-global.tcl
   source BASEDIR/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-config.tcl
   source BASEDIR/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 $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

Last edited by manjunath11; 11-07-2010 at 12:59 AM.
 
Old 11-06-2010, 03:47 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,554

Rep: Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512Reputation: 2512
Well, there's no way of setting or exporting BASEDIR in "tcl".
At least not any, that I know about.

"tcl" / 'ns' will understand the full path.
So where is "ns-allinone-2.33/" ? That's the BASEDIR.
( I.e. edit line 93--99 to the actual location .. )

simple_mobileipv6.tcl :
Code:
    92	# set BASEDIR to your own correct path
    93	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl
    94	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/proc-tools.tcl
    95	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/proc-topo.tcl
    96	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/ns-topoman.tcl
    97	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-global.tcl
    98	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-config.tcl
    99	source /home/knudfl/8tmp//ns-allinone-2.33/ns-2.33/tcl/mobility/timer.tcl
Then my output is
Code:
[knudfl@localhost ns-2.33]$ ./ns simple_mobileipv6.tcl
num_nodes is set 5
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) : 2
  Clusters (cluster_num) : 1 5
  Nodes (nodes_num) :  1 1 3 1 1 1
  >-------------------------------------------------------<

SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
31.9021 get_coa for BS 1.2.0:4198400
Simulation finished

|Binding Cache for node 1.1.0 at 100 --------------------------------------- |
|Node           COA             Type    Info    Flag    Last    Time            Life    Expire       Nb|
|1.1.1          1.2.6           7       MN      1       22      96.9076         10      0            12 |


|Binding Cache for node 0.0.0 at 100 --------------------------------------- |
|Node           COA             Type    Info    Flag    Last    Time            Life    Expire       Nb|
|1.1.1          1.2.6           7       MN      1       23      96.9098         10      0            11 |


|Binding Update List for node 1.1.1 at 100 --------------------------------------- |
|Node           COA             Type    Info    Flag    Last    Time            Life    Expire       Nb|
|0.0.0          1.2.6           5       CN      1       23      96.9021         10      109.964      11 |
|1.1.0          1.2.6           3       HA      1       22      96.9021         10      2.68435e+08  12 |


|Base Station List for node 1.1.1 at 100 --------------------------------------- |
|Node           COA             Type    Info    Flag    Last    Time            Life    Expire       Nb|
|1.2.0          1.2.6           8       BS      1       -1      99.5648         1       0            135 |

[knudfl@localhost ns-2.33]$
And please edit post #1 to use code tags. (A problem in your other thread too.)
Just write [/code] at text end, and [code] at text start.
http://www.linuxquestions.org/questi....php?do=bbcode
..
Attached Images
File Type: jpg screen9285.jpg (13.6 KB, 26 views)

Last edited by knudfl; 11-07-2010 at 04:04 AM.
 
Old 11-07-2010, 01:01 AM   #3
manjunath11
LQ Newbie
 
Registered: Nov 2010
Posts: 18

Original Poster
Rep: Reputation: 0
thank u sir , simple_mobileipv6.tcl worked finally
 
Old 11-30-2010, 09:43 PM   #4
ghassan_akrem
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Help !!

Quote:
Originally Posted by manjunath11 View Post
thank u sir , simple_mobileipv6.tcl worked finally
Hi, I tried to run simple-mipv6.tcl in ns-2.32 under cygwin, but I got some errors, may be the paths of some files, hope to get some help.

Last edited by ghassan_akrem; 11-30-2010 at 09:44 PM.
 
Old 11-30-2010, 11:46 PM   #5
manjunath11
LQ Newbie
 
Registered: Nov 2010
Posts: 18

Original Poster
Rep: Reputation: 0
post the error message
 
Old 12-01-2010, 12:58 AM   #6
ghassan_akrem
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by manjunath11 View Post
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)
 
  


Reply

Tags
ns2 mobiwan


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem linking f77 and f90 object files Make problem (I think) TheBrick Programming 1 05-22-2006 06:17 AM
Sound Card problem(every time i install linux i have diffirent hardware problem) jacka1l Linux - Newbie 7 08-11-2005 06:10 AM
Lan configuration problem - NFS boot problem - RX&TX packets errors 242VDM242 Linux - Networking 4 11-25-2004 01:35 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM


All times are GMT -5. The time now is 05:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration