LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-24-2012, 03:41 AM   #1
robina
LQ Newbie
 
Registered: Dec 2008
Location: Pakistan
Posts: 7

Rep: Reputation: 0
Problem with ns2.34 and mobileIP


hi
i am trying to run my tcl file based on mobileip,mpls and hierarchical addressing. whenever i run the file, i come accross the following output.

num_nodes is set 9
INITIALIZE THE LIST xListHead
Default value for cluster_num set to 4

Default value for nodes_num set to 5

Segmentation fault


what might be the problem, could someone figure it out. The code is as follows
Code:
set opt(chan)   Channel/WirelessChannel        ;# channel type
set opt(prop)   Propagation/TwoRayGround       ;# radio-propagation model
set opt(netif)  Phy/WirelessPhy                ;# network interface type
set opt(mac)    Mac/802_11                     ;# MAC type
set opt(ifq)    Queue/DropTail/PriQueue        ;# interface queue type
set opt(ll)     LL                             ;# link layer type
set opt(ant)    Antenna/OmniAntenna            ;# antenna model
set opt(ifqlen)         50                     ;# max packet in ifq
set opt(nn)             2                      ;# number of mobilenodes
set opt(adhocRouting)   DSDV                   ;# routing protocol

set opt(x)      400                            ;# x coordinate of topology
set opt(y)      400                            ;# y coordinate of topology
set opt(stop)   60                            ;# time to stop simulation

set ns [new Simulator]
set tracefd [open hiermip-out.tr w]
$ns trace-all $tracefd
set tracefile [open hiermip-out.nam w]
$ns namtrace-all $tracefile

$ns node-config -addressType hierarchical

AddrParams set domain_num 3
AddrParams set cluster_num {2 1 2}
AddrParams set nodes_num {3 2 1 2 1}

set topo [new Topography]
$topo load_flatgrid 400 400

set god [create-god 9]

#wired nodes
set chan1 [new $opt(chan)]
set chan2 [new $opt(chan)]

set LSR(1) [$ns node 0.0.0]
set LSR(2) [$ns node 0.0.1]
set LSR(3) [$ns node 0.0.2]

set LSR(4) [$ns node 0.1.0]
set LSR(6) [$ns node 0.1.1]

# Configure for ForeignAgent and HomeAgent nodes
$ns node-config -mobileIP ON \
                 -adhocRouting $opt(adhocRouting) \
                 -llType $opt(ll) \
                 -macType $opt(mac) \
                 -ifqType $opt(ifq) \
                 -ifqLen $opt(ifqlen) \
                 -antType $opt(ant) \
                 -propType $opt(prop) \
                 -phyType $opt(netif) \
                 -channel $chan2 \
		 -topoInstance $topo \
                 -wiredRouting ON \
		 -agentTrace ON \
                 -routerTrace OFF \
                 -macTrace OFF

set HA [$ns node 1.0.0]
set FA1 [$ns node 2.0.0]
set FA2 [$ns node 2.1.0]

#$HA random-motion 0
$FA1 random-motion 0
$FA2 random-motion 0

$HA set X 100.00
$HA set Y 150.00
$HA set Z 0.00

$FA1 set X 100.00
$FA1 set Y 500.00
$FA1 set Z 0.00

$FA2 set X 200.00
$FA2 set Y 50.00
$FA2 set Z 0.00

#mobile node

set MN [$ns node 2.0.1]
set node(0) $MN
set HAaddress [AddrParams addr2id [$HA node-addr]]
	       [$MN set regagent_] set homeagent $HAaddress

$ns duplex-link $LSR(1) $LSR(2) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(1) $LSR(2) orient right

$ns duplex-link $LSR(2) $LSR(3) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(2) $LSR(3) orient right

$ns duplex-link $LSR(3) $LSR(4) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(3) $LSR(4) orient down

$ns duplex-link $LSR(4) $LSR(6) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(4) $LSR(6) orient right

$ns duplex-link $LSR(6) $FA1 5Mb 2ms DropTail
$ns duplex-link-op $LSR(6) $FA1 orient left

$ns duplex-link  $LSR(6) $FA2 5Mb 2ms DropTail
$ns duplex-link-op $LSR(6) $FA2 orient right

proc finish {} {
    global ns  
    $ns flush-trace
   
    exec nam s1a-out.nam &
    exit 0
}
$ns at 60.0 "finish"
$ns run
 
Old 02-25-2012, 01:34 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Well, I got the same "Segmentation fault" by using your file.
( Same result in ns-2.34 and 2.33 ).

And your thread is now marked [SOLVED], so we will
very much appreciate that you show the solution in a new post.


Kind Regards.

.
 
Old 02-25-2012, 02:46 PM   #3
robina
LQ Newbie
 
Registered: Dec 2008
Location: Pakistan
Posts: 7

Original Poster
Rep: Reputation: 0
the problem existed here.
to define Domain number,cluster number and node number in a default way as domain_num_, cluster_num_,node_num_. Else, these values are ignored and the default values used by AddrParams of 4 clusters, and 5 nodes is considered.

Regards
 
Old 11-25-2015, 09:33 PM   #4
safwan.ghaleb11
LQ Newbie
 
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
Thumbs up This is the correct file without segmentation fault

set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 2 ;# number of mobilenodes
set opt(adhocRouting) DSDV ;# routing protocol

set opt(x) 400 ;# x coordinate of topology
set opt(y) 400 ;# y coordinate of topology
set opt(stop) 60 ;# time to stop simulation

set ns [new Simulator]
set tracefd [open hiermip1-out.tr w]
$ns trace-all $tracefd
set tracefile [open hiermip-out.nam w]
$ns namtrace-all $tracefile

$ns node-config -addressType hierarchical


AddrParams set domain_num_ 3 ;# number of domains
lappend cluster_num 2 1 2 ;# number of clusters in each domain
AddrParams set cluster_num_ $cluster_num
lappend eilastlevel 3 2 1 2 1 ;# number of nodes in each cluster
AddrParams set nodes_num_ $eilastlevel ;# of each domain


set topo [new Topography]
$topo load_flatgrid 400 400

set god [create-god 9]

#wired nodes
set chan1 [new $opt(chan)]
set chan2 [new $opt(chan)]

set LSR(1) [$ns node 0.0.0]
set LSR(2) [$ns node 0.0.1]
set LSR(3) [$ns node 0.0.2]

set LSR(4) [$ns node 0.1.0]
set LSR(6) [$ns node 0.1.1]

# Configure for ForeignAgent and HomeAgent nodes
$ns node-config -mobileIP ON \
-adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channel $chan2 \
-topoInstance $topo \
-wiredRouting ON \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF

set HA [$ns node 1.0.0]
set FA1 [$ns node 2.0.0]
set FA2 [$ns node 2.1.0]

#$HA random-motion 0
$FA1 random-motion 0
$FA2 random-motion 0

$HA set X 100.00
$HA set Y 150.00
$HA set Z 0.00

$FA1 set X 100.00
$FA1 set Y 500.00
$FA1 set Z 0.00

$FA2 set X 200.00
$FA2 set Y 50.00
$FA2 set Z 0.00

#mobile node

set MN [$ns node 2.0.1]
set node(0) $MN
set HAaddress [AddrParams addr2id [$HA node-addr]]
[$MN set regagent_] set homeagent $HAaddress

$ns duplex-link $LSR(1) $LSR(2) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(1) $LSR(2) orient right

$ns duplex-link $LSR(2) $LSR(3) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(2) $LSR(3) orient right

$ns duplex-link $LSR(3) $LSR(4) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(3) $LSR(4) orient down

$ns duplex-link $LSR(4) $LSR(6) 5Mb 2ms DropTail
$ns duplex-link-op $LSR(4) $LSR(6) orient right

$ns duplex-link $LSR(6) $FA1 5Mb 2ms DropTail
$ns duplex-link-op $LSR(6) $FA1 orient left

$ns duplex-link $LSR(6) $FA2 5Mb 2ms DropTail
$ns duplex-link-op $LSR(6) $FA2 orient right

proc finish {} {
global ns tracefd tracefile
$ns flush-trace
close $tracefd
close $tracefile
exec nam hiermip-out.nam &
exit 0
}
$ns at 60.0 "finish"
$ns run
 
1 members found this post helpful.
  


Reply


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
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 06:53 PM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 02:44 AM
any one help me with this problem on ns2 narayanasai Linux - Networking 2 10-05-2009 04:11 PM
NS2 problem kantu Linux - Networking 0 09-28-2008 01:47 AM
Problem with ns2 vivekr Programming 4 07-22-2006 07:48 AM


All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration