[ns] using AODV and Queue/DRR or Queue/Red will occur segmentation fault

2008-11-14 Thread howardgod howardgod

-- Forwarded message --
From: howardgod howardgod [EMAIL PROTECTED]
Date: 2008/11/13
Subject: Segmentation fault in AODV when using DRR in wireless network
To: ns-users@isi.edu


Hi all!
I got a segmentation fault when using Queue/DRR and AODV in wireless
network.
following is the message output by valgrind

==2252== Invalid read of size 4
==2252==at 0x81BD274: PacketQueue::head() (queue.h:82)
==2252==by 0x829A1D6: PriQueue::filter(int) (priqueue.cc:158)
==2252==by 0x82C82FF: AODV::rt_ll_failed(Packet*) (aodv.cc:343)
==2252==by 0x82C8339: aodv_rt_failed_callback(Packet*, void*)
(aodv.cc:293)
==2252==by 0x827A041: Mac802_11::RetransmitRTS() (mac-802_11.cc:1295)
==2252==by 0x827A4C4: Mac802_11::send_timer() (mac-802_11.cc:883)
==2252==by 0x827A530: Mac802_11::sendHandler() (mac-802_11.cc:793)
==2252==by 0x82A142D: TxTimer::handle(Event*) (mac-timers.cc:254)
==2252==by 0x81A7933: Scheduler::dispatch(Event*, double)
(scheduler.cc:150)
==2252==by 0x81A7B85: Scheduler::run() (scheduler.cc:129)
==2252==by 0x81A7E44: Scheduler::command(int, char const* const*)
(scheduler.cc:198)
==2252==by 0x83CCAFD: TclClass::dispatch_cmd(void*, Tcl_Interp*, int,
char const**) (in /home/howardgod/ns2/ns-2.33/ns)
==2252==  Address 0x1a is not stack'd, malloc'd or (recently) free'

I think the problem is in AODV::rt_ll_failed(Packet*)
and PriQueue::filter(int).
And there was a similar problem posed
http://mailman.isi.edu/pipermail/ns-users/2005-April/048686.html
and there's a solution about this problem
http://mailman.isi.edu/pipermail/ns-users/2005-April/048710.html
but solution is aimed at adding a new routing protocol. So the solutions is
not help for me.

I'm making a new queue based on DRR. And use it in wireless network. So when
I use Queue/MyQueue and AODV in TCL file, segmentation fault occurs. But I
make the problem easier. I write the same tcl file except I use Queue/DRR.
And I find out there's still a segmentation fault just as I use
Queue/MyQueue.

following is the TCL file

# =
# Define options
# =
set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DRR
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(ifqLen) 50
set opt(nn) 7
set opt(rp) AODV
set opt(x) 1000
set opt(y) 1000
set opt(stop) 10
set opt(tran) 250

# =
# Create simulation object
set ns [new Simulator]

# Open trace file
set tracefd [open drr-out.tr w]
set namtrace [open drr-out.nam w]
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $opt(x) $opt(y)

# Create topology object
set topo [new Topography]

# Define topology
$topo load_flatgrid $opt(x) $opt(y)

# Create God
create-god $opt(nn)

set chan [new $opt(chan)]

# Congigure for node
$ns node-config -adhocRouting $opt(rp) \
-llType $opt(ll) \
 -macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqLen) \
 -antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
 -channel $chan \
-topoInstance $topo \
-agentTrace ON \
 -routerTrace ON \
-macTrace OFF \
-movementTrace OFF

# =
# Node Definition
# =

for {set i 0} {$i  3} {incr i} {
 set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
puts wireless node $i created ...
 $wl_node_($i) set X_ [expr 200.0 + $i * 200.0]
$wl_node_($i) set Y_ 400.0
 $wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}

for {set i 3} {$i  5} {incr i} {
set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
 puts wireless node $i created ...;
$wl_node_($i) set X_ 400.0
 $wl_node_($i) set Y_ [expr 800.0 - ($i - 3)*200.0]
$wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}

for {set i 5} {$i  7} {incr i} {
set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
 puts wireless node $i created ...;
$wl_node_($i) set X_ 400.0
 $wl_node_($i) set Y_ [expr 200.0 - ($i - 5)*200.0]
$wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}
# =
# Traffic Definition
# =
set udp0 [new Agent/UDP]
set dst_udp0 [new Agent/Null]
$ns attach-agent $wl_node_(0) $udp0
$ns attach-agent $wl_node_(2) $dst_udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set rate_ 200Kb
$cbr0 attach-agent $udp0
$ns connect $udp0 $dst_udp0
$ns at 0.0 $cbr0 start
$ns at $opt(stop) $cbr0 stop

set udp1 [new Agent/UDP]
set des_udp1 [new Agent/Null]
$ns attach-agent $wl_node_(4) $udp1
$ns attach-agent $wl_node_(5) $des_udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set rate_ 500Kb
$cbr1 attach-agent $udp1
$ns connect $udp1 $des_udp1
$ns at 0.0 $cbr1 start
$ns at $opt(stop) $cbr1 stop

set udp2 [new Agent/UDP]

[ns] setdest: how to avoid getting Destination Unreachables?

2008-11-14 Thread Noor Asraf

Using the setdest utility, is there a way to avoid getting
#Destination Unreachables: 54? I mean if I want to avoid this, how do
I choose my parameters? And it seems like the number of  Destination
Unreachables keep changing for the same parameter. I got 54, 61, 41
using the following command:

./setdest -n 10 -p 0 -s 1 -t 150 -x 1500 -y 300  scen-a

If I want to be able to reach all destinations, how do I choose my
params? What's the significance of this? Because, when I print out the
route table using AODV, I see NRTE. Something to do with random number
seed, but even if that changes it should give the same result??

Thanks!
Asraf



[ns] install umts extensions over ns-2.29

2008-11-14 Thread esmat shoja


hi All,
i have to install umts extensions over ns-2.29.
I downloaded files from EURANE Website  but I could not Install them without 
error.
can u please clarify me how to install umts extensions for ns2.29
and how Could I test if my installation is coorect ?
    thank you.





  


Re: [ns] oldsim error

2008-11-14 Thread Alireza Nafarieh

On Fri, Nov 14, 2008 at 11:03 AM, Alireza Nafarieh
[EMAIL PROTECTED]wrote:

 Hi everyone,

 I have installed ns-2.33. It gets following error when I try to run any
 example:

 error when calling class OldSim

 anyone has got this error before? and what would be the solution?

 thanks,
 Ali



[ns] Segmentation fault in AODV when using DRR in wireless network

2008-11-14 Thread howardgod howardgod

Hi all!
I got a segmentation fault when using Queue/DRR and AODV in wireless
network.
following is the message output by valgrind

==2252== Invalid read of size 4
==2252==at 0x81BD274: PacketQueue::head() (queue.h:82)
==2252==by 0x829A1D6: PriQueue::filter(int) (priqueue.cc:158)
==2252==by 0x82C82FF: AODV::rt_ll_failed(Packet*) (aodv.cc:343)
==2252==by 0x82C8339: aodv_rt_failed_callback(Packet*, void*)
(aodv.cc:293)
==2252==by 0x827A041: Mac802_11::RetransmitRTS() (mac-802_11.cc:1295)
==2252==by 0x827A4C4: Mac802_11::send_timer() (mac-802_11.cc:883)
==2252==by 0x827A530: Mac802_11::sendHandler() (mac-802_11.cc:793)
==2252==by 0x82A142D: TxTimer::handle(Event*) (mac-timers.cc:254)
==2252==by 0x81A7933: Scheduler::dispatch(Event*, double)
(scheduler.cc:150)
==2252==by 0x81A7B85: Scheduler::run() (scheduler.cc:129)
==2252==by 0x81A7E44: Scheduler::command(int, char const* const*)
(scheduler.cc:198)
==2252==by 0x83CCAFD: TclClass::dispatch_cmd(void*, Tcl_Interp*, int,
char const**) (in /home/howardgod/ns2/ns-2.33/ns)
==2252==  Address 0x1a is not stack'd, malloc'd or (recently) free'

I think the problem is in AODV::rt_ll_failed(Packet*)
and PriQueue::filter(int).
And there was a similar problem posed
http://mailman.isi.edu/pipermail/ns-users/2005-April/048686.html
and there's a solution about this problem
http://mailman.isi.edu/pipermail/ns-users/2005-April/048710.html
but solution is aimed at adding a new routing protocol. So the solutions is
not help for me.

I'm making a new queue based on DRR. And use it in wireless network. So when
I use Queue/MyQueue and AODV in TCL file, segmentation fault occurs. But I
make the problem easier. I write the same tcl file except I use Queue/DRR.
And I find out there's still a segmentation fault just as I use
Queue/MyQueue.

following is the TCL file

# =
# Define options
# =
set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/802_11
set opt(ifq) Queue/DRR
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(ifqLen) 50
set opt(nn) 7
set opt(rp) AODV
set opt(x) 1000
set opt(y) 1000
set opt(stop) 10
set opt(tran) 250

# =
# Create simulation object
set ns [new Simulator]

# Open trace file
set tracefd [open drr-out.tr w]
set namtrace [open drr-out.nam w]
$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $opt(x) $opt(y)

# Create topology object
set topo [new Topography]

# Define topology
$topo load_flatgrid $opt(x) $opt(y)

# Create God
create-god $opt(nn)

set chan [new $opt(chan)]

# Congigure for node
$ns node-config -adhocRouting $opt(rp) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqLen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace OFF

# =
# Node Definition
# =

for {set i 0} {$i  3} {incr i} {
set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
puts wireless node $i created ...
$wl_node_($i) set X_ [expr 200.0 + $i * 200.0]
$wl_node_($i) set Y_ 400.0
$wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}

for {set i 3} {$i  5} {incr i} {
set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
puts wireless node $i created ...;
$wl_node_($i) set X_ 400.0
$wl_node_($i) set Y_ [expr 800.0 - ($i - 3)*200.0]
$wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}

for {set i 5} {$i  7} {incr i} {
set wl_node_($i) [$ns node]
$wl_node_($i) random-motion 0
puts wireless node $i created ...;
$wl_node_($i) set X_ 400.0
$wl_node_($i) set Y_ [expr 200.0 - ($i - 5)*200.0]
$wl_node_($i) set Z_ 0.0
$ns initial_node_pos $wl_node_($i) 20
}
# =
# Traffic Definition
# =
set udp0 [new Agent/UDP]
set dst_udp0 [new Agent/Null]
$ns attach-agent $wl_node_(0) $udp0
$ns attach-agent $wl_node_(2) $dst_udp0
set cbr0 [new Application/Traffic/CBR]
$cbr0 set rate_ 200Kb
$cbr0 attach-agent $udp0
$ns connect $udp0 $dst_udp0
$ns at 0.0 $cbr0 start
$ns at $opt(stop) $cbr0 stop

set udp1 [new Agent/UDP]
set des_udp1 [new Agent/Null]
$ns attach-agent $wl_node_(4) $udp1
$ns attach-agent $wl_node_(5) $des_udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set rate_ 500Kb
$cbr1 attach-agent $udp1
$ns connect $udp1 $des_udp1
$ns at 0.0 $cbr1 start
$ns at $opt(stop) $cbr1 stop

set udp2 [new Agent/UDP]
set des_udp2 [new Agent/Null]
$ns attach-agent $wl_node_(3) $udp2
$ns attach-agent $wl_node_(6) $des_udp2
set cbr2 [new Application/Traffic/CBR]
$cbr2 set rate_ 500Kb
$cbr2 attach-agent $udp2
$ns connect 

[ns] Compile a debug version

2008-11-14 Thread pallavi kb

Hi,
I was wondering how do you compile a debug version in NS2

I tried doing:
configure --enable-debug
but when i typed make it gave me a strange error

thanks,
pall



  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/