LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   problem with ns 2.33 and Mobiwan_1 (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-ns-2-33-and-mobiwan_1-a-842686/)

manjunath11 11-06-2010 12:46 AM

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


knudfl 11-06-2010 03:47 AM

1 Attachment(s)
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
..

manjunath11 11-07-2010 01:01 AM

thank u sir , simple_mobileipv6.tcl worked finally

ghassan_akrem 11-30-2010 09:43 PM

Help !!
 
Quote:

Originally Posted by manjunath11 (Post 4151603)
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.

manjunath11 11-30-2010 11:46 PM

post the error message

ghassan_akrem 12-01-2010 12:58 AM

Quote:

Originally Posted by manjunath11 (Post 4176602)
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)

pon 09-04-2014 02:11 AM

Hi Mr.knodfl ,

when i run the same simple-ipv6.tcl,
i am not getiing following binding output in terminal as you got in post#2 of this thread,


Quote:

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

but i am getting till this below in terminal

Quote:

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
running nam and seeing output ,it is ok, but when it reaches time t= 21.00000 in nam run the following warning messages coming at terminal
Quote:

Warning: Tracefile events are not sorted by time.
+ -t 33.153760000 -s 2 -d 6 -p cbr -e 1000 -c 2 -a 0 -i 1358 -k RTR
The above event should occur at or after -t 33.153760.

Warning: Tracefile events are not sorted by time.
+ -t 33.163760000 -s 2 -d 6 -p cbr -e 1000 -c 2 -a 0 -i 1359 -k RTR
The above event should occur at or after -t 33.163760.

Warning: Tracefile events are not sorted by time.
+ -t 33.173760000 -s 2 -d 6 -p cbr -e 1000 -c 2 -a 0 -i 1360 -k RTR
The above event should occur at or after -t 33.173760.


pls anybody help me above said problems.

Thanks

Pon

knudfl 09-04-2014 03:13 AM

# 7, @pon.

If you want to reproduce a result done 4 years ago,
you can use (the oldish) CentOS 5.10 and CentOS 6.5 .
And remember : Must be the 32bits versions.

* Do not expect any contemporary Linux OS
to be able to work with all the old patches.

-

pon 09-06-2014 12:07 AM

I agree Mr.Knudfl. i am new to ns2 and ubuntu (only 2 months old) , so only i am working with open source , those are available only on very old patches.


pls could you tell me one more thing

i run following commands and i got following in terminal

probably i installed 32 bit ubuntu-12.o4 i686


Code:

chase@chase-desktop:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"
chase@chase-desktop:~$ uname -a
Linux chase-desktop 3.5.0-54-generic #81~precise1-Ubuntu SMP Tue Jul 15 04:05:58 UTC 2014 i686 i686 i386 GNU/Linux
chase@chase-desktop:~$ file /sbin/init
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x07075fcb55b05aeb6286efabba63534fa6ecd213, stripped
chase@chase-desktop:~$ /bin/uname -m
i686
chase@chase-desktop:~$


Is it right ?

or is there any other commands to find our OS bit-version, pls tell me.


Thanks

Pon

knudfl 09-06-2014 03:41 AM

# 9 .

The right "specify your OS" commands are :
Architecture, all OS : $ uname -m
Name and version {Debian, Mint, Ubuntu} : $ cat /etc/issue


All times are GMT -5. The time now is 12:40 PM.