[ns] SOLVED! debugging ns-2 in eclipse

2011-06-14 Thread Ella Taha

Ok so after spending a lot of time on trying to debug ns in eclipse, I found
the solution!
to give a step by step guide:
after installing ns and eclipse, first take the steps given in the following
site : http://blog.karthiksankar.com/ns2-eclipse/ except that don't change
the make file

after doing this you should be able to build and run your ns and tcl file
without error seeing the % command or the output of your tcl

now to be able to debug ns in eclipse, go to your
ns-allinone/ns-2.3x/Makefile.in file and change the following:
1. change CCOPT= @V_CCOPT@


On Tue, Jun 14, 2011 at 10:47 AM, ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed 
teto...@yahoo.com wrote:

 unfortunalety, i dont know how to debug c++ , please if you know inform me
 , thanks alot


 --- On *Sun, 6/12/11, Ella Taha ella.t...@gmail.com* wrote:


 From: Ella Taha ella.t...@gmail.com
 Subject: Re: [ns] debugging ns-2.33 in eclipse
 To: ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed teto...@yahoo.com
 Date: Sunday, June 12, 2011, 9:11 AM


 go to run -- run configurations and then choose the arguments tab and
 inside the program arguments add the address of your tcl file for example:
 /home/ns-allinone2-33/ns2-33/aodv/file.tcl

 do you know how I can debug the C++ files?

 On Sun, Jun 12, 2011 at 2:06 PM, ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed 
 teto...@yahoo.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=teto...@yahoo.com
  wrote:


 please could you help me how to run tcl file inside eclips
 --- On *Sun, 6/12/11, Ella Taha 
 ella.t...@gmail.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=ella.t...@gmail.com
 * wrote:


 From: Ella Taha 
 ella.t...@gmail.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=ella.t...@gmail.com
 
 Subject: [ns] debugging ns-2.33 in eclipse
 To: ns users 
 ns-users@ISI.EDUhttp://us.mc305.mail.yahoo.com/mc/compose?to=ns-users@ISI.EDU
 
 Date: Sunday, June 12, 2011, 5:05 AM



 Dear friends
 I am trying to debug ns-2.33 with eclipse CDT(Helios Service Release 2). I
 have added the ns folder as a new project to the eclipse. the build runs
 without error and I have set my tcl file as an argument to the run
 configuration. when I run, I can see the tcl file running with no problem
 and the output is displayed. However, when I set some breakpoints and hit
 the debug, it doesn't stop at those points and what happens, is exactly the
 same as when running the project resulting in no debug outputs!
 I would really appreciate if anyone can help me!
 thanks

 p.s I have already added the following lines to the makefile:
 CCOPT = -g
 DEFINE = -DNDEBUG
 DEFINE = -DDEBUG


 Ella





Re: [ns] SOLVED! debugging ns-2 in eclipse

2011-06-14 Thread Ella Taha

Ok so after spending a lot of time on trying to debug ns in eclipse, I found
the solution!
to give a step by step guide:
after installing ns2 and eclipse, first take the steps given in the
following site : http://blog.karthiksankar.com/ns2-eclipse/ except that
don't change the make file

after doing this you should be able to build and run your ns and tcl file
without error seeing the % command or the output of your tcl

now to be able to debug ns in eclipse, go to your
.../ns-allinone/ns-2.3x/Makefile.in file and change the following:

1. change CCOPT= @V_CCOPT@
to CCOPT= @V_CCOPT@ -g

2. add -DNDEBUG -DDEBUG to the end of
DEFINE= -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@
@DEFS@-DNS_DIFFUSION -DSMAC_NO_SYNC
-DCPP_NAMESPACE=@CPP_NAMESPACE@-DUSE_SINGLE_ADDRESS_SPACE -Drng_test

that is:

DEFINE= -DTCP_DELAY_BIND_ALL -DNO_TK @V_DEFINE@ @V_DEFINES@
@DEFS@-DNS_DIFFUSION -DSMAC_NO_SYNC
-DCPP_NAMESPACE=@CPP_NAMESPACE@-DUSE_SINGLE_ADDRESS_SPACE -Drng_test
-DNDEBUG -DDEBUG

now navigate to .../ns-allinone/ns2.3x and run ./configure and after that
make clean and then make

now you will be getting a few errors in some files (I only got 2!) regarding
debug, go to the line numbers of those files and comment what is causing the
error (probably puts)

thats it! now you can go to your eclipse and define some breakpoints and hit
the debug button and lean back and enjoy what you see!

Good Luck and have fun

Ella

On Tue, Jun 14, 2011 at 10:47 AM, ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed 
teto...@yahoo.com wrote:

 unfortunalety, i dont know how to debug c++ , please if you know inform me
 , thanks alot


 --- On *Sun, 6/12/11, Ella Taha ella.t...@gmail.com* wrote:


 From: Ella Taha ella.t...@gmail.com
 Subject: Re: [ns] debugging ns-2.33 in eclipse
 To: ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed teto...@yahoo.com
 Date: Sunday, June 12, 2011, 9:11 AM


 go to run -- run configurations and then choose the arguments tab and
 inside the program arguments add the address of your tcl file for example:
 /home/ns-allinone2-33/ns2-33/aodv/file.tcl

 do you know how I can debug the C++ files?

 On Sun, Jun 12, 2011 at 2:06 PM, ÞÕÇÏ Úíäì Ýì ßá ãßÇä mohammed 
 teto...@yahoo.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=teto...@yahoo.com
  wrote:


 please could you help me how to run tcl file inside eclips
 --- On *Sun, 6/12/11, Ella Taha 
 ella.t...@gmail.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=ella.t...@gmail.com
 * wrote:


 From: Ella Taha 
 ella.t...@gmail.comhttp://us.mc305.mail.yahoo.com/mc/compose?to=ella.t...@gmail.com
 
 Subject: [ns] debugging ns-2.33 in eclipse
 To: ns users 
 ns-users@ISI.EDUhttp://us.mc305.mail.yahoo.com/mc/compose?to=ns-users@ISI.EDU
 
 Date: Sunday, June 12, 2011, 5:05 AM



 Dear friends
 I am trying to debug ns-2.33 with eclipse CDT(Helios Service Release 2). I
 have added the ns folder as a new project to the eclipse. the build runs
 without error and I have set my tcl file as an argument to the run
 configuration. when I run, I can see the tcl file running with no problem
 and the output is displayed. However, when I set some breakpoints and hit
 the debug, it doesn't stop at those points and what happens, is exactly the
 same as when running the project resulting in no debug outputs!
 I would really appreciate if anyone can help me!
 thanks

 p.s I have already added the following lines to the makefile:
 CCOPT = -g
 DEFINE = -DNDEBUG
 DEFINE = -DDEBUG


 Ella





Re: [ns] accessing queue length in 802.11 MAC

2011-06-14 Thread St4Ski0


Hi, anyone as tested this method?
I've insert following code in mac-802_11.cc in recvDATA() but i've
segmentation fault problem...why if i test if the pointer is non-null?

int pkt_in_q = 0;

//Thesis
if ( ((LL *)uptarget_)-ifq()){
//code if non-null
pkt_in_q = ((LL *)uptarget_)-ifq()-length();
printf(non-null queue \n);
} else {
// code if null
printf(null queue \n);
}


M. Shen wrote:
 
 
 Dear guys,
 
 I tried to access queue length in MAC. So I wrote 
 int pkt_num = ((LL *)uptarget_)-ifq()-length(); 
 
 When I run the simulation us gdb, segmentation fault occurs. I shows
 that
 
 Program received signal SIGSEGV, Segmentation fault.
 0x080c3ad4 in Queue::length() (this=0x0) at queue/queue.h:136
 136 int length() { return pq_-length(); }  /* number of pkts currently
 in
 
 Does any one know how to deal with this problem?
 
 Thank you very much,
 Min
 
 
 

-- 
View this message in context: 
http://old.nabble.com/Re%3A-accessing-queue-length-in-802.11-MAC-tp7713314p31833588.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] error in ns2

2011-06-14 Thread umair shah

Hi when i'm running simulation in ns2 I'm getting the following error ,can 
anyone help me 
Missing required flag -y in: W -t 100

Parsing error in event.


[ns] throughput too high plz help

2011-06-14 Thread RamiHach


Dear all,
I have a logical question plz:
the FTP/CBR application in my simulation.tcl have paquet size set to 1500
and the interval set to 0.1s.
following my logic, I should obtain a maximum  throughput = (1500 * 8)bits
/0.1s  = 120 000 bits/s or 120Kbit/s
or my file awk calculate the throughput = 163.84Kbit/s  120 Kbit/s . is
this wrong? or can be  120.Kbit/s
 
what you can say about the value of 163.84 can be a correct value or never
??
 
plz waiting your answer
-- 
View this message in context: 
http://old.nabble.com/throughput-too-high-plz-help-tp31841932p31841932.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] Eliminating wireless losses and propogation delay

2011-06-14 Thread Faran


I am trying to model 802.11 network without any wireless losses and without
any delay. I have made following changes but results are not convincing.

I have used free space propagation model and made following change in
propagation.cc file:

Instead of calculating Friss free space equation, I have directly returned
'Pt' (Power at transmitter) for the function to depict as if power has not
been affected at receiver resulting in loss less model.

In channel.cc, I have hard coded propdelay=0 at all places to eliminate
propagation delay.

With following modifications, i placed 10 nodes close to each other and ran
5 different flows of same type between 5 pairs. I expected to see same
throughput on all nodes since there is no delay involved (so nodes perform
irrespective of their position) and no loss is present but results were
totally different with large asymmetry.

Can someone plot a better idea of eliminating delay and losses? Also is it a
wrong assumption in such a scenario to expect same throughput?

Regards
Faran
-- 
View this message in context: 
http://old.nabble.com/Eliminating-wireless-losses-and-propogation-delay-tp31841948p31841948.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] VANET, Ad-hoc broadcast protocol

2011-06-14 Thread Vineeth Mohan

Hello All,

I am currently using DumbAgent as routing protocol to simulate VANET
scenario and the Flooding mechanism is written within ping Agent code. Can
some one suggest me any other VANET or Ad-Hoc broadcast protocol which is
implemented in NS2?

I am looking for any of the broadcast method it can be a probability based
method, Area based or Neighbor Knowledge Method.

Thank You
Rakesh


[ns] Fwd: ns2 wpan simulation: Bug?

2011-06-14 Thread Devashish

I am working on ns2 and need to simulate a simple application on lines of
ping. I'm using the ns2.34 build and it comes with the wpan module. When I
tried to test the application with a ping agent. It throws the error,
Scheduler: Event UID not valid.
here is the tcl scrip i'm using and the simple ping agent available under
apps folder.
---
# ==
# Define options
# ==
set val(chan)   Channel/WirelessChannel;# Channel Type
set val(prop)   Propagation/TwoRayGround   ;# radio-propagation
model
set val(netif)  Phy/WirelessPhy/802_15_4
set val(mac)Mac/802_15_4
set val(ifq)Queue/DropTail   ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant)Antenna/OmniAntenna;# antenna model
set val(ifqlen) 10 ;# max packet in ifq
set val(nn) 2 ;# number of mobilenodes
set val(rp) AODV  ;# routing protocol
set val(x) 50
set val(y) 50
set val(nam) 1.nam
set stopTime50 ;# in seconds

# Initialize Global Variables
set ns_ [new Simulator]
set tracefd [open ./1.tr w]
$ns_ trace-all $tracefd
if { $val(nam) == 1.nam } {
set namtrace [open ./$val(nam) w]
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
}

$ns_ puts-nam-traceall {# nam4wpan #} ;# inform nam that this is a trace
file for wpan (special handling needed)

Mac/802_15_4 wpanCmd verbose on
Mac/802_15_4 wpanNam namStatus on ;# default = off (should be turned on
before other 'wpanNam' commands can work)
#Mac/802_15_4 wpanNam ColFlashClr gold ;# default = gold

# For model 'TwoRayGround'
set dist(5m)  7.69113e-06
set dist(9m)  2.37381e-06
set dist(10m) 1.92278e-06
set dist(11m) 1.58908e-06
set dist(12m) 1.33527e-06
set dist(13m) 1.13774e-06
set dist(14m) 9.81011e-07
set dist(15m) 8.54570e-07
set dist(16m) 7.51087e-07
set dist(20m) 4.80696e-07
set dist(25m) 3.07645e-07
set dist(30m) 2.13643e-07
set dist(35m) 1.56962e-07
set dist(40m) 1.20174e-07
Phy/WirelessPhy set CSThresh_ $dist(30m)
Phy/WirelessPhy set RXThresh_ $dist(30m)

# set up topography object
set topo   [new Topography]
$topo load_flatgrid $val(x) $val(y)

# Create God
set god_ [create-god $val(nn)]

set chan_1_ [new $val(chan)]

# configure node

$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 OFF \
-macTrace ON \
-movementTrace OFF \
-channel $chan_1_

set node_(0) [$ns_ node]
$node_(0) random-motion 0 ;# disable random motion


$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
 -ifqType $val(ifq) \
-ifqLen 2 \
-antType $val(ant) \
 -propType $val(prop) \
-phyType $val(netif) \
-topoInstance $topo \
 -agentTrace OFF \
-routerTrace OFF \
-macTrace ON \
 -movementTrace OFF \
-channel $chan_1_

set node_(1) [$ns_ node]
$node_(1) random-motion 0 ;# disable random motion

$node_(0) set X_ 25
$node_(0) set Y_ 25
$node_(0) set Z_ 0
$node_(1) set X_ 25
$node_(1) set Y_ 15
$node_(1) set Z_ 0

$ns_ at 0.0 $node_(0) NodeLabel PAN Coor
$ns_ at 0.0 $node_(0) sscs startPANCoord 1 2 2 ;# startPANCoord
txBeacon=1 BO=3 SO=3

$ns_ at 15 $node_(1) sscs startDevice 0 0

Mac/802_15_4 wpanNam PlaybackRate 3ms

$ns_ at 25 puts \\nTransmitting data ...\n\

Mac/802_15_4 wpanCmd ack4data off
# Setup traffic flow between nodes

set r [new Agent/Ping]
$ns_ attach-agent $node_(0) $r
set c [new Agent/Null]
$ns_ attach-agent $node_(1) $c

$ns_ connect $r $c
$ns_ at 28.0005 $r send


# defines the node size in nam
for {set i 0} {$i  $val(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 0.5
}

# Tell nodes when the simulation ends
for {set i 0} {$i  $val(nn) } {incr i} {
$ns_ at $stopTime $node_($i) reset;
}

$ns_ at $stopTime stop
$ns_ at $stopTime puts \NS EXITING...\n\
$ns_ at $stopTime $ns_ halt

proc stop {} {
global ns_ tracefd appTime1 val env
$ns_ flush-trace
close $tracefd
set hasDISPLAY 0
foreach index [array names env] {
#puts $index: $env($index)
if { ($index == DISPLAY)  ($env($index) != ) } {
set hasDISPLAY 1
}
}
if { ($val(nam) == 1.nam)  ($hasDISPLAY == 1) } {
exec nam beacon_enabled_star.nam 
}
}

puts \nStarting Simulation...
$ns_ run
__

rohit@rohit-laptop:~/ns2/ns-allinone-2.34/ns-2.34/examples$ ns 1.tcl
num_nodes is set 2
INITIALIZE 

[ns] goodput calculation

2011-06-14 Thread RamiHach


Dear all,
any body can tell me how to calculate with awk the goodput ? plz
-- 
View this message in context: 
http://old.nabble.com/goodput-calculation-tp31844005p31844005.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] setdest utility can't use

2011-06-14 Thread umair shah

Hey I can't use setdest  
THis is what happening 
umair@umair-VirtualBox:~/ns2/ns-2.34/indep-utils$ cd cmu-scen-gen/
umair@umair-VirtualBox:~/ns2/ns-2.34/indep-utils/cmu-scen-gen$ cd setdest
umair@umair-VirtualBox:~/ns2/ns-2.34/indep-utils/cmu-scen-gen/setdest$ 
./setdestbash: ./setdest: No such file or directory
umair@umair-VirtualBox:~/ns2/ns-2.34/indep-utils/cmu-scen-gen/setdest$ 
can anybody help me ?asap


[ns] Olsr patch not working

2011-06-14 Thread umair shah

Hi ,I am using ns2 2.34 on ubuntu 11.04 in virtualbox, and I can't patch olsr 
http://masimum.dif.um.es/?Software:UM-OLSR:Installation
i 've tried details given in this link yet i can't do that.it gives me error 
when i run this 
patch -p1  olsr/um-olsr_ns-2.29_v0.8.8.patch


gives no directory or command or something like that,



[ns] olsr patching issue

2011-06-14 Thread umair shah

i get the following error when i tried the olsr patching from masimum 
 Installation of otcl seems incomplete or can't be found automatically.
Please correct the problem by telling configure where otcl is
using the argument --with-otcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with --with-otcl=no.
after i configure it 
what should i do ?


[ns] pls help!! [conditional break in scheduler]

2011-06-14 Thread Devashish

I'm using ns2.34. I'm getting event uid not valid error on running a tcl
script. I created a ping agent as described in mark greis tutorial. It works
fine with 802.11 but doesn't work with 802.15.4 and throws scheduler event
uid not valid error. Does anyone know why this is occurring?
Please let me know, how to know who dispatched the event. I know the event
id. What are the specific lines (for conditional break) that need to be
added to scheduler::schedule() to find out who scheduled that packed or in
dispatch() to find out who dispatched it.
Please help, I'm stuck here for last 8 hours. :(

Regards,
Devashish Sethia