Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Generally :
A default file.tcl is not supposed to work in a mobiwan patched ns2.
Only dedicated "mobiwan tcl files" must work.
The usual suggestion : Save the binary ns from an unpatched ns-2.33.
Also : copy the unpatched binary ns to /usr/local/bin/ as "ns233".
Other example (from today), post #2 here : http://www.linuxquestions.org/questi...33-a-936417/#2
# FIRST SCENARIO WITHOUT BUFFER
# 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 Off\
# Set NS Addressing
AddrParams set domain_num_ 2
AddrParams set cluster_num_ {1 3}
AddrParams set nodes_num_ {1 1 2 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 100 100 0]
set bs2_ [create-base-station 1.2.0 1.0.0 100 550 0]
set mobile_ [create-mobile 1.1.1 1.1.0 230 100 0 0 0.01]
# Create Links
$ns simplex-link $cn_ $router_ 10Mb 2.0ms DropTail
$ns duplex-link $router_ $bs1_ 10Mb 2.0ms DropTail
$ns duplex-link $router_ $bs2_ 10Mb 2.0ms 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
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mipv6-config.tcl
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/proc-tools.tcl
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/proc-topo.tcl
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/ns-topoman.tcl
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-global.tcl
source /home/slim/Desktop/Work/ns-allinone-2.33/ns-2.33/tcl/lib/proc-mobi-config.tcl
source /home/slim/Desktop/Work/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
#set new trace file for wireless
$ns use-newtrace
$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)
#start movement to pos(x,y) with velocity v
#$ns at 10.0 "$mobile_ setdest 700 400 10"
#MN move again to BS2#####
$ns at 2.0 "$mobile_ setdest 230 500 10"
#>----------------------- 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_ 160
$src set rate_ 64k
$src set interval_ 0.05
$src attach-agent $udp
$ns at 10.0 "$src start"
$ns at 15.0 "$src stop"
}
main
and I have this message :
"
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
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,473
Rep:
cd ns-allinone-2.33/ns-2.33'
./ns mobiwan-MIBV6-file.tcl ( Your file from post # 6.)
Code:
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 3
Nodes (nodes_num) : 1 1 2 1
>-------------------------------------------------------<
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
26.3025 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.4 7 MN 1 13 91.3087 10 0 13 |
|Binding Update List for node 1.1.1 at 100 --------------------------------------- |
|Node COA Type Info Flag Last Time Life Expire Nb|
|1.1.0 1.2.4 3 HA 1 13 91.3025 10 2.68435e+08 14 |
|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.4 8 BS 1 -1 99.6504 1 0 149 |
running nam with out.nam ...
... Which the expected OK result.
About your error ( Segmentation fault ) :
Probably the usual : Avoid Ubuntu 11.04, 11.10 ( 12.04 ) for ns2. Did all tests pass ?
If it must be Ubuntu : 10.04 should be preferred.
( All ns2 was made for and tested on CentOS / RHEL / Scientific Linux.)
P.S. : You could try out the old binary "ns233-mobiwan", that I am using.
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,473
Rep:
# 10
Two things : An OS for ns2 should be 32bits. ( i386 / i686.)
Not everything will work in a 64bits OS.
( The command 'uname -m' will reply with <arch>.)
And, most important :
ns-allinone-2.33 must be compiled with gcc-4.1 / g++-4.1
to get a usable result. ( sudo apt-get install g++-4.1 ).
Yes my os is 32 bits(i686)
"sudo apt-get install g++-4.1" not work (the same thing for gcc-4.1)
the default version that I found for gcc and g++ (gcc -v && g++ -v) is 4.6 and the minimum version that I can install with apt-get is 4.4
How I can return to the posterior versions (4.1 for example) if I use an ubuntu 11.10 ??
Distribution: PCLinuxOS2021 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,473
Rep:
# 12 : No old Ubuntu compilers will work in Ubuntu 11.10.
I have patched up the Ubuntu 11.04 gcc41-compat,
so it will work in Ubuntu 11.10 :
sudo dpkg -i \
gcc41-compat-4.1.2.ubu1110_i386.deb g++41-compat-4.1.2_i386.deb
.. Then reboot, and the new gcc41 / g++41 will work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.