LinuxQuestions.org
Help answer threads with 0 replies.
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 03-03-2013, 12:32 AM   #1
bensigi
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Rep: Reputation: Disabled
Ns 2 segmentation fault error


i'm new to linux and ns2 platform, i'm doing my thesis and trying to run AODV code, i got the following error, anyone can sort me out

thanks in advance

$ ns DSR.tcl
num_nodes is set 50
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
Segmentation fault (core dumped)
 
Old 03-03-2013, 03:40 AM   #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
Welcome to LQ.

DSR.tcl : Is it dsr.tcl http://read.pudn.com/downloads183/so.../dsr.tcl__.htm ?
dsr.tcl will cause "Segmentation fault" with any 'ns' executable.
I.e. any ns version, and ns patched with any protocol :
Fairly identical output results, and always “Segmentation fault“.

Conclusion : Your 'ns' is OK. 'dsr.tcl' isn't.
But then again : $ 'ns dsr.tcl' will create a usable file 1_out.nam .

** "All" aodv examples ( aodv-uu ) : aodv-uu__examples.tar.bz2
https://docs.google.com/file/d/0B7S2...it?usp=sharing

-
 
Old 03-03-2013, 06:10 AM   #3
bensigi
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
aodv

thanks knudfl for your swift response,

i was using this code of AODV http://code.google.com/p/ns2-gators/wiki/AODVtestcode
then i got that error, since then i have changed the compiler in makefile.in from cc to cc -g
however i got another error,

Program received signal SIGSEGV, Segmentation fault. in Tcl_Write () from otcl......

now if you don't mind i really need tutorial on how to run AODV, DSR, DSDV, AOMDV and probably TORA, from scratch to getting graphs that compares major parameters like end to end delay, packet loss ratio packet delivery ratio and normalized routing load.

thanks my email add is

Last edited by bensigi; 03-03-2013 at 06:45 AM.
 
Old 03-03-2013, 06:30 AM   #4
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
# 3 : Better delete your email address to avoid receiving spam.
We already have : "Send email to bensigi" http://www.linuxquestions.org/questi...ember&u=683933

* http://code.google.com/p/ns2-gators/wiki/AODVtestcode
> The file name is testAODV.tcl : No errors here.

If you want an executable 'ns' with all debugging symbols,
then please also make one that's compiled without 'cc -g'.
To be used for the simulations.
Different naming is allowed : ns, ns-orig, ns-debug, ns-aodv, etc.
( I actually used a "ns234-tora" to test the file : $ ./ns234-tora testAODV.tcl ).

-

Last edited by knudfl; 03-03-2013 at 06:34 AM.
 
Old 03-03-2013, 10:48 AM   #5
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
# 3

Links, AODV, DSR, DSDV, AOMDV, TORA.
-
Attached Files
File Type: txt Links__dsr_aodv_aomdv_tora.txt (4.4 KB, 245 views)
 
1 members found this post helpful.
Old 03-24-2013, 11:14 PM   #6
bensigi
LQ Newbie
 
Registered: Oct 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thumbs up packet delivery ratio, throughput, end to end

Quote:
Originally Posted by knudfl View Post
# 3

Links, AODV, DSR, DSDV, AOMDV, TORA.
-
hey, this was helpful, my major nightmare now is to have a code that gives me a graphs of pdr, E2E delay and throughput for AODV, DSR, DSDV, AOMDV, TORA ,

thanks a million times
 
Old 08-11-2013, 01:20 AM   #7
hltknhung
LQ Newbie
 
Registered: Aug 2013
Posts: 2

Rep: Reputation: Disabled
Hi LQ,

I run: ns mytcl/p10.tcl
==> cause "Segmentation fault (core dumped)"

//projectcodens2.googlecode.com/svn-history/r367/trunk/mytcl/input/SoLuongMHArray/p10.tcl

Please hepl me.
 
Old 08-11-2013, 01:27 AM   #8
hltknhung
LQ Newbie
 
Registered: Aug 2013
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by hltknhung View Post
Hi LQ,

I run: ns mytcl/p10.tcl
==> cause "Segmentation fault (core dumped)"

//projectcodens2.googlecode.com/svn-history/r367/trunk/mytcl/input/SoLuongMHArray/p10.tcl

Please hepl me.
when I command make and then run the tcl file like this "ns mytcl/p10.tcl"
I got warning that is "segmentation fault (core dumped)".
How can I fix this error?
 
Old 10-07-2014, 04:23 AM   #9
rana_abdallah
Member
 
Registered: Sep 2014
Posts: 45

Rep: Reputation: Disabled
Segmentation fault (core dumped)

Hey
Im trying this code and got the error: segmentation fault (core dumped)
how can i solve it? which memory that i dont have to access it?

This is the code:
Code:
#Mac/802_11 set dataRate_ !1Mb
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(ant) Antenna/OmniAntenna ;# Antenna type
set val(ll) LL ;# Link layer type
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen) 50 ;# max packet in ifq
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(nn) 15 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 800
set val(y) 800
# Creating simulation object
set ns [new Simulator]
#creating Output trace files
set f [open complexdcf.tr w]
$ns trace-all $f
set namtrace [open complexdcf.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)
set f0 [open C_DCF_AT.tr w]
set topo [new Topography]
$topo load_flatgrid 800 800
# Defining Global Variables
create-god $val(nn)
set chan_1 [new $val(chan)]
# setting the wireless nodes parameters
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF \
-channel $chan_1 \
proc finish {} {
global ns f f0 namtrace# global variables
# Closing the trace files
$ns flush-trace
close $namtrace
close $f0
exec nam -r 5m complexdcf.nam & # Running the animator
exit 0
}
# Defining a procedure to calculate the througpout
proc record {} {
global sink1 sink3 sink7 sink10 sink11 f0
set ns [Simulator instance]
set time 0.5
set bw0 [$sink3 set bytes_]
set bw3 [$sink3 set bytes_]
set bw7 [$sink7 set bytes_]
set bw10 [$sink10 set bytes_]
set bw11 [$sink11 set bytes_]
set now [$ns now]
puts $f0 "$now [expr ($bw0+$bw3+$bw7+$bw10+$bw11)/$time*8/1000000]"
# Calculating the average throughput
$sink1 set bytes_ 0
$sink3 set bytes_ 0
$sink7 set bytes_ 0
$sink10 set bytes_ 0
$sink11 set bytes_ 0
$ns at [expr $now+$time] "record"
}
#Creating the wireless Nodes
for {set i 0} {$i < $val(nn) } {incr i} {
set n($i) [$ns node]
$n($i) random-motion 0 ;
}
#setting the initial position for the nodes
for {set i 0} {$i < $val(nn)} {incr i} {
$ns initial_node_pos $n($i) 30+i*100
}
for {set i 0} {$i < $val(nn)} {incr i} {
$n($i) set X_ 0.0
$n($i) set Y_ 0.0
$n($i) set Z_ 0.0
}
# making some nodes move in the topography
$ns at 0.0 "$n(0) setdest 100.0 100.0 3000.0"
$ns at 0.0 "$n(1) setdest 200.0 200.0 3000.0"
$ns at 0.0 "$n(2) setdest 300.0 200.0 3000.0"
$ns at 0.0 "$n(3) setdest 400.0 300.0 3000.0"
$ns at 0.0 "$n(4) setdest 500.0 300.0 3000.0"
$ns at 0.0 "$n(5) setdest 600.0 400.0 3000.0"
$ns at 0.0 "$n(6) setdest 600.0 100.0 3000.0"
$ns at 0.0 "$n(7) setdest 600.0 200.0 3000.0"
$ns at 0.0 "$n(8) setdest 600.0 300.0 3000.0"
$ns at 0.0 "$n(9) setdest 600.0 350.0 3000.0"
$ns at 0.0 "$n(10) setdest 700.0 100.0 3000.0"
$ns at 0.0 "$n(11) setdest 700.0 200.0 3000.0"
$ns at 0.0 "$n(12) setdest 700.0 300.0 3000.0"
$ns at 0.0 "$n(13) setdest 700.0 350.0 3000.0"
$ns at 0.0 "$n(14) setdest 700.0 400.0 3000.0"
$ns at 2.0 "$n(5) setdest 100.0 400.0 500.0"
$ns at 1.5 "$n(3) setdest 450.0 150.0 500.0"
$ns at 50.0 "$n(7) setdest 300.0 400.0 500.0"
$ns at 2.0 "$n(10) setdest 200.0 400.0 500.0"
$ns at 2.0 "$n(11) setdest 650.0 400.0 500.0"
#Creating receiving sinks with monitoring ability to monitor the incoming bytes
set sink1 [new Agent/LossMonitor]
set sink3 [new Agent/LossMonitor]
set sink7 [new Agent/LossMonitor]
set sink10 [new Agent/LossMonitor]
set sink11 [new Agent/LossMonitor]
$ns attach-agent $n(1) $sink1
$ns attach-agent $n(3) $sink3
$ns attach-agent $n(7) $sink7
$ns attach-agent $n(10) $sink10
$ns attach-agent $n(11) $sink11
# setting tcp as the transmission protocol over the connections
set tcp0 [new Agent/TCP]
$ns attach-agent $n(0) $tcp0
set tcp2 [new Agent/TCP]
$ns attach-agent $n(2) $tcp2
set tcp4 [new Agent/TCP]
$ns attach-agent $n(4) $tcp4
set tcp5 [new Agent/TCP]
$ns attach-agent $n(5) $tcp5
set tcp9 [new Agent/TCP]
$ns attach-agent $n(9) $tcp9
set tcp13 [new Agent/TCP]
$ns attach-agent $n(13) $tcp13
set tcp6 [new Agent/TCP]
$ns attach-agent $n(6) $tcp6
set tcp14 [new Agent/TCP]
$ns attach-agent $n(14) $tcp14
set tcp8 [new Agent/TCP]
$ns attach-agent $n(8) $tcp8
set tcp12 [new Agent/TCP]
$ns attach-agent $n(12) $tcp12
# Setting FTP connections
set ftp9 [new Application/FTP]
$ftp9 attach-agent $tcp9
$ftp9 set type_ FTP
set ftp13 [new Application/FTP]
$ftp13 attach-agent $tcp13
$ftp13 set type_ FTP
set ftp6 [new Application/FTP]
$ftp6 attach-agent $tcp6
$ftp6 set type_ FTP
set ftp14 [new Application/FTP]
$ftp14 attach-agent $tcp14
$ftp14 set type_ FTP
set ftp8 [new Application/FTP]
$ftp8 attach-agent $tcp8
$ftp8 set type_ FTP
set ftp12 [new Application/FTP]
$ftp12 attach-agent $tcp12
$ftp12 set type_ FTP
#connecting the nodes
$ns connect $tcp0 $sink3
$ns connect $tcp5 $sink3
$ns connect $tcp2 $sink1
$ns connect $tcp4 $sink1
$ns connect $tcp9 $sink7
$ns connect $tcp13 $sink7
$ns connect $tcp6 $sink10
$ns connect $tcp14 $sink10
$ns connect $tcp8 $sink11
$ns connect $tcp12 $sink11
# Defining CBR procedure with the required parametes
proc attach-CBR-traffic { node sink size interval } {
set ns [Simulator instance]
set cbr [new Application/Traffic/CBR]
$ns attach-agent $node $cbr
$cbr set packetSize_ $size
$cbr set interval_ $interval
$ns connect $cbr $sink
return $cbr
}
set cbr0 [attach-CBR-traffic $n(0) $sink3 1000 .015]
set cbr1 [attach-CBR-traffic $n(5) $sink3 1000 .015]
set cbr2 [attach-CBR-traffic $n(2) $sink1 1000 .015]
set cbr3 [attach-CBR-traffic $n(4) $sink1 1000 .015]
# Setting the begining and ending time of each connection
$ns at 0.0 "record"
$ns at 20.0 "$cbr0 start"
$ns at 20.0 "$cbr2 start"
$ns at 800.0 "$cbr0 stop"
$ns at 850.0 "$cbr2 stop"
$ns at 30.0 "$cbr1 start"
$ns at 30.0 "$cbr3 start"
$ns at 850.0 "$cbr1 stop"
$ns at 870.0 "$cbr3 stop"
$ns at 25.0 "$ftp6 start"
$ns at 25.0 "$ftp14 start"
$ns at 810.0 "$ftp6 stop"
$ns at 860.0 "$ftp14 stop"
$ns at 35.0 "$ftp9 start"
$ns at 35.0 "$ftp13 start"
$ns at 830.0 "$ftp9 stop"
$ns at 889.0 "$ftp13 stop"
$ns at 40.0 "$ftp8 start"
$ns at 40.0 "$ftp12 start"
$ns at 820.0 "$ftp8 stop"
$ns at 890.0 "$ftp12 stop"
$ns at 900.0 "finish"
# Runnning the simulation
puts "Start of simulation.."
$ns run


Is there any problen with this tcl code?
Thank you

Last edited by rana_abdallah; 10-08-2014 at 01:20 PM.
 
Old 10-07-2014, 04:43 AM   #10
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
← #9 .

Please edit post #9 : Add code tags around the code.
. http://www.linuxquestions.org/questi....php?do=bbcode
. http://www.linuxquestions.org/questi...gs-4175464257/
.... I.e. type [/code] at code end, and [code] at code text start.


Segmentation fault : http://www.linuxquestions.org/questi...20fault%20ns2/
→ #3 http://www.linuxquestions.org/questi...-4175507630/#3
and #5 http://www.linuxquestions.org/questi...-4175506731/#5

-

Last edited by knudfl; 10-07-2014 at 05:04 AM.
 
Old 10-07-2014, 10:02 AM   #11
rana_abdallah
Member
 
Registered: Sep 2014
Posts: 45

Rep: Reputation: Disabled
Segmentation fault (core dumped)

Thank you knudfl
This is the code attached in the file.

I've tried to reduce the number of nodes for a maximum of 14 nodes.I'm using ns2.30 in cygwin (windows)
Should i reduce the number of nodes to a maximum of 3 or 4 nodes so i will not get this error: "segmentation fault(core dumped)"?
Check the code please if something is wrong with it
Thank you
Attached Files
File Type: pdf Scenario file.pdf (116.2 KB, 50 views)
 
Old 10-07-2014, 10:44 AM   #12
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
← # 11 .

* You will still have to edit post #9 to use code tags. Please do.

Editing : The 'Edit' button.

-

Attachments : tcl code can be attached only as "name.tcl.txt".
Like : 'complexdcf.tcl.txt' .
* A file.pdf won't do.

-

Last edited by knudfl; 10-07-2014 at 10:51 AM.
 
Old 10-08-2014, 03:30 AM   #13
rana_abdallah
Member
 
Registered: Sep 2014
Posts: 45

Rep: Reputation: Disabled
I attached the tcl file as tcl.txt, is that ok? or should i edit it?
Attached Files
File Type: txt Scenario.tcl.txt (6.4 KB, 33 views)
 
Old 10-08-2014, 03:59 AM   #14
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
← #13 .
Quote:
should i edit it ?
You will still have to edit post #9 to use code tags.
Please explain why you can't do that.
 
Old 10-08-2014, 04:24 AM   #15
rana_abdallah
Member
 
Registered: Sep 2014
Posts: 45

Rep: Reputation: Disabled
I didnt understand what i should edit it. The tcl file shows the file with colors
Do u want that i change the color of values? or something else?
 
  


Reply

Tags
aodv-uu, aomdv, ns2


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
Segmentation Fault - Error thoufiq Linux - Server 8 05-18-2011 05:02 AM
segmentation fault error mahmoud Linux - Software 11 02-24-2009 02:12 PM
segmentation fault error dianarani Linux - Hardware 16 02-28-2008 08:19 AM
getting segmentation fault error sanjuonline1 Programming 2 02-14-2007 06:27 AM
Segmentation Fault Error ashwinipahuja Programming 1 03-29-2004 03:09 PM


All times are GMT -5. The time now is 02:32 PM.

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