[ns] how to get SIFS, DIFS, RTS, CTS, DATA and ACK packet size

2006-08-06 Thread ns user

dear all,
can anyone help me how to get values of RTS, CTS, DATA and ACK packet size of 
802.11 Ad hoc net. also i want to know the way to get SIFS and DIFS values.

please reply, urgent

[ns] Missing MAC collisions in EDCA simulations

2006-08-06 Thread Sven Kopetzki

Hello All,

I recently played around with the IEEE 802.11e EDCA Model from TKN
Berlin. I used ns 2.28. I enabled MAC tracing in their example script
'multi_udpflows.tcl' and set all UDP agents to priority 0.
Surprisingly there were no collisions in the trace file.
So, I disabled edca support [set opt(mac) Mac/802_11] and rerun the
simulation. Now, there are collisions as expected in the trace.

With edca support enabled, I expect collisions when QoS stations of prio
0 and 1 are trying to access the channel in the same slot, or when more
than one station of a specific prio is active. Access category voice and
video have the same AIFS of 2. Therefore collisions should occur. In my
test I set all udp flows to prio 0. Why there are no collisions?

Are collision not traced, or is there a problem in the implementation?
I would like to exchange experiences with you.

Best regards

[ns] delaySamp_ object and Delay samples

2006-08-06 Thread Filippos Kolovos

Dear all,

has anybody used, or tried to use the delaySamp_ object
that is provided with a queuemonitor object?

In the manual it states that this object can be used to measure queue delays
(page 76 of ns-manual).
It has two methods:

$queuemonitor get-delay-samples, which says it returns a Samples object
delaySamp_ to record delays about queues and

$queuemonitor set-delay-samples delaySamp_, is to set up the delay samples
object to record delay statistics about queues. Also,  it states that
delaySamp_ is a handle to a samples object, which must have been previously
created (supposedly with the get-delay-samples method above).

However I have the following code:

#Setting a queue-monitor object for a specific queue
set monitorQueue2_3  [$simulation monitor-queue $node2 $node3 stdout]
#Setting the integrator for the average queue size - this works ok
set integratorObject [$monitorQueue2_3 get-pkts-integrator]

#using the get-delay-samples method of the queuemonitor object to get a
delay samples
set delaySamples [$monitorQueue2_3 get-delay-samples]
#using the set-delay-samples method on, supposedly, the returned object to
set-it up,
#according to the manual
$monitorQueue2_3 set-delay-samples delaySamples

more code

When I simulate the tcl code I get the following error:

(_o59 cmd line 1)
invoked from within
_o59 cmd set-delay-samples delaySamples
invoked from within
catch $self cmd $args ret
invoked from within
if [catch $self cmd $args ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error error when calling class $cls: $args $...
(procedure _o59 line 2)
(SplitObject unknown line 2)
invoked from within
$monitorQueue2_3 set-delay-samples delaySamples
(file simulation-Class-AverageQueue.tcl line 80)

What Could be the cause of this? I use ddd as my debugger and I have come to
the conclusion that the get-delay-samples method does not return anything,
the delaySamp_ object is initialized to NULL upon initialization of the
queuemonitor object.
The code is in the queue-monitor.cc file in ns-directory/tools/

How can one use the delaySamp_ objects of queuemonitor to measure queue
Am I correct, or I am erroneously using these methods?

Any help would be appreciated.

Kind Regards,


Filippos N Kolovos

Software Systems Analyst  Engineer
M.Sc. (Eng.) in Data Communications

Automation  Networking Department
University of Macedonia Library
Egnatia 156, P.O.Box 1591
540 06 Thessaloniki, Greece

Phone: +30-2310-891-826

[ns] A compiling error

2006-08-06 Thread Fan Xiaopeng

Dear all,

I have a question about compiling NS2.

When I replaced ../pgm/pgm-agent.cc with my own one, I recompile the source 
code and encountered the following error. 

trace/trace.cc: In member function `virtual void DequeTrace::recv(Packet*, 
trace/trace.cc:567: warning: int format, nsaddr_t arg (arg 5)
trace/trace.cc:567: warning: int format, nsaddr_t arg (arg 6)
trace/trace.cc:586: warning: int format, nsaddr_t arg (arg 5)
trace/trace.cc:586: warning: int format, nsaddr_t arg (arg 6)
make: *** [trace/trace.o] Error 1

And my code had nothing with the file of trace.cc. Would you mind telling me 
the reason?


Mr. Fan Xiaopeng  
PHD Student
Department  of  Computing 
Hong  Kong  Polytechnic  University 
Hung  Hom,  Kowloon,  Hong  Kong

[ns] Calculate Average queue delay and average queue size - Explained

2006-08-06 Thread Filippos Kolovos

Dear ns-community,

I probably have found a way to answer my own question which was posted
previously concerning the calculation of average queue delay and size with
monitor objects.

After thorough study, I eventually found out what one has to do in order
to calculate the average queue delay and average queue size (i.e. without
extra-tcl code
or awk scripts) through a monitor object. The code to do that has already
been implemented
in ns-2, in monitor objects.

However, please note that the methods below correspond to my observations
and effort and thereby
I do not guarantee that there are 100% error-free, since I might have missed
something, or understood
something wrong. On the other hand, after the experiments that I carried out
with some tcl scripts,
it seems that the monitor objects along with these methods work OK. The
experiments were carried out for wired links and with no
line-failures (the monitor objects in ns present problems in the calculation
of the queue statistics when a line
drops and comes up again - it seems that all counters get reset!).

The NS-2 version I use is ns-2.29 under Debian Sarge

For the examples below I am assuming a 3-node topology with links

node1 - node2 - node3

The link characteristics (propagation delay, bandwidth, etc) and the queue
management (droptail, RED, etc) may be as one desires


After the creation of the links and the nodes, we are going to measure the
average queue
size of the connection from node2 to node3. Instead of using a tcl procedure
that is executed
every n seconds, we are going to use the Integrator objects that ns-2
already supports under the monitor objects.

At first we create the monitor object as usual, for the queue that we want
to monitor:

set monitorN2_N3 [$ns monitor-queue $node2 $node3 stdout]

then we get the integrator object through the monitor object for the
queue. This method returns an
integrator object which later can be queried for the average queue size in
packets (Integrator objects calculate
integrals of samples over time):

set inetgratorObjectN2_N3 [$monitorN2_N3 get-pkts-integrator] (or
[$monitorN2_N3 get-bytes-integrator] for average size in bytes)

and finally before the end of our simulation we print out the result with:

puts stdout Average queue size: [expr {[$integratorObjectN2_N3 set

where sum_ is a property of the integrator object that contains the integral
sum of all the sample points from the start of the
simulation until the time we get it (finishTime).

finishTime is a custom variable containing the finish time of our simulation
(100,200 seconds, etc).
We have to divide it in order to get the average over all the simulated


In order to calculate the average queue delay of a queue with a monitor
object, we can use a Samples object that accompanies
the monitor object, which simply uses the timestamp field of a special
common header (hdr_common) in the packets transmitted. This header is
solely used for this purpose (i.e. calculate statistics).

Below I include the code for the average queue size as well

At first we create a samples object that will be passed to the monitor
object later:

set monitorN2_N3 [$ns monitor-queue $node2 $node3 stdout]
set inetgratorObjectN2_N3 [$monitorN2_N3 get-pkts-integrator]

set samples_object [new Samples]

Then we must set it up to be used with our monitor object:

$monitorN2_N3 set-delay-samples $samples_object

Then we get it through the get method of our monitor object (as we have
done for the monitor object)

set delaySamplesObject [$monitorN2_N3 get-delay-samples]

And then at the end of the simulation we call the mean method of the
samples object (that has been assigned to our queue)
to get the mean delay of the queue in seconds:

puts stdout Average Queue Delay: [$delaySamplesObject mean]

There are other methods to use with the samples object, such as variance,
cnt, etc. For more information concerning these
methods one might check the Mathematical Support chapter 24 of the ns-2

Also, there are set-pkts-integrator and set-bytes-integrator methods as well
for setting up the integrator objects as well.
However, it is not necessary one to use them, since their corresponding
Samples objects are being created through
init-monitor during the initialization of the monitor object. Only the delay
samples is not being initialized and not calling
the method set-delay-samples with an existing samples object returns an

Also, please note that the above might have alradey been documented as such
somewhere else beyond my knowledge,
but since I have seen this question many times in the forum I decided to
post an answer in the forum. My apologies
for any inconvenience this might have caused.

Comments concerning the above are welcome.

Kind Regards,

[ns] Two mobility models in one simulation - attack/adversary modelling?

2006-08-06 Thread Martin Junkersen

Dear NS users 

Is it somehow possible to have two different mobility models in the same 

I have been looking on a few trace file generators and a number of research 
articles, and I have been unable to find any of them, which used two different 
kind of mobility in the same simulation.

I am studying security in mobile ad hoc networks, and I would like to model an 
attacker/adversary, which selects a certain good node based on some kind of 
traffic analysis and then follows this node. The good nodes would have to 
follow e.g. a group mobility model or just Random Waypoint, and the movement of 
the attacker should be some function of the received signals. So far I have 
only seen attackers/adversaries, which moved in the same way as the good 
nodes or were stationary.

I would like to use ns-2 for it, but if it is not possible and you know it can 
be done in some other simulator, please let me know! 

Any tips would be most welcome, since at the moment I am about to give up the 
idea, because it does not seem to be possible.

Thank you very much for your help,


[ns] how to create .o files

2006-08-06 Thread Armelle Gnassou


I want to add a new module in ns2, I have created file.cc/h, but I don't 
know how to create file.o (to put into makefile).
Can anybody help me with this? please it's important

Thanks in advance.


Retrouvez tout en un clin d'oeil avec la barre d'outil MSN Search ! 

[ns] [BUG] -- MAC 802.11, the error frame presumption

2006-08-06 Thread JengFarn Lee

Hi to all,

   The current ns-2 implementation has a problem in mis-identify the frames 
sent from stations
located between carrier sense and transmission range of receivers as error 
frames which will 
cause significant throughput unfairness resulting in many wrong simulation 
results in wireless networks. 
Here we provide a patch to fix this problem.


JengFarn Lee

Re: [ns] how to make .o files

2006-08-06 Thread Buvaneshwari M

where do you want your Pick.o to be in- thats where you place your .h/cc

Message: 7
Date: Sun, 6 Aug 2006 15:51:47 +0200
From: Bie New 
Subject: [ns] how to make .o files
To: ns-users@ISI.EDU

Content-Type: text/plain; charset=ISO-8859-1; format=flowed

 Hello there:

I an a newbie to NS2 and C++. I make a files Pick.cc/.h files and Pick.tcl,
to install the Pick to NS2 , I need to put Pick.o into makefile,but I don't
know how to create Pick.o file,

In Pick.h, It include connector.h , I don't know where to put my Pick.cc/.h
files and how to make pick.o.

I use cygwin on window XP

Thanks in advance !!


[ns] how to find the SNR and BER

2006-08-06 Thread sivagami amirthalingam

I am simulating Wireless network for IEEE 802.11standard. To analysis 
the network, I have chosen delay, througput , SNR and BER parameters. Any 
body can help me to calculate the SNR and BER value. 
 One more question. Any one tell how to set the value  'd' (no of 
packets after which the ack has to be sent by the sink)f or delayed 
acknowldegement of Agent/TcpSink/DelAck 
 Thank you

 Here’s a new way to find what you're looking for - Yahoo! Answers 

[ns] how to analysis the performance of routing protocols

2006-08-06 Thread sivagami amirthalingam

I have simulated wireless network with 40 nodes. A node 1 is sending TCP 
tranffic to Node 38 which is about 600 km distance. I have tried with DSR, 
AODV, and DSDV routing protocol. I am interested in throughput and delay 
analysis. DSDV protocol is working fine and I can get the thorughput at node 
38. But the other two protocols fail to deliver the packet to the destination. 
I have used the same code for all the protocols. The same code works fine with 
a network having only two nodes and all the protocols could deliver the packet 
to the desitination. Can any body help me to understand/explain this situation? 
  Thank you

 Here’s a new way to find what you're looking for - Yahoo! Answers