[ns] e2e delay

2009-01-09 Thread souhaj


hello  

i am workin with ns...and i am tring to analyse the trace file..
i have found an awk programm that calculate the end to end delay...
http://mailman.isi.edu/pipermail/ns-users/2007-August/060808.html
however i didn't understand, this part of the program (i know that is
calculating the end to end delay : but how this is done) :
 
# CALCULATE DELAY 
  if ( start_time[packet_id] == 0 )  start_time[packet_id] = time;
  if (( $1 == r)   ( $35 == cbr )  ( $19==AGT )) { 
end_time[packet_id] = time;  }
   else {  end_time[packet_id] = -1;  }

 
..

...
for ( i in end_time )
  {
  start = start_time[i];
  end = end_time[i];
  packet_duration = end - start;
  if ( packet_duration  0 )  
  {sum += packet_duration;
   recvnum++; 
  }
  }

can you help me..
thanks in advance
-- 
View this message in context: 
http://www.nabble.com/e2e-delay-tp21367971p21367971.html
Sent from the ns-users mailing list archive at Nabble.com.



Re: [ns] NAM does not run wireless simulation over ns 2

2009-01-09 Thread souhaj


try this command...
first as first remark 
its preferable to work under this directory : /ns-allinone-2.33/bin and put
in it the trace file , the nam file and obviously the Tcl file..ok
second 
i will suppose that you have done this.so to run the nam file :

exec ./nam /home/faraz/Desktop/ns-allinone-2.33/bin/attachment 



i hope that it will work

  




Syed Faraz Hasan wrote:
 
 
 Hello ALL,
 
 I am trying to visualize the entire simulation using NAM. I open the .nam
 file in the finish procedure. I have associated CBR source with one of the
 nodes to make it send packets to another node. NAM executes properly at
 the beginning (but does not show nodes at all), as soon as the scheduled
 time of sending packets arrive NAM exits. Although it generates the trace
 file.
 
 Please write back soon
 
 Heres the code...
 
 # ==
 
 # Define options
 
 # ==
 
 set val(chan)   Channel/WirelessChannel;# channel type
 
 set val(prop)   Propagation/TwoRayGround   ;# radio-propagation
 model
 
 set val(netif)  Phy/WirelessPhy;# network interface
 type
 
 set val(mac)Mac/802_11 ;# MAC type
 
 set val(ifq)Queue/DropTail/PriQueue;# interface queue type
 
 set val(ll) LL ;# link layer type
 
 set val(ant)Antenna/OmniAntenna;# antenna model
 
 set val(ifqlen) 50 ;# max packet in ifq
 
 set val(nn) 3  ;# number of
 mobilenodes
 
 set val(rp) AODV   ;# routing protocol
 
 set val(x)  880   ;# x-axis of grid
 set val(y)  880   ;# y-axis of grid
 set opt(energymodel)EnergyModel ;
 set opt(radiomodel) RadioModel ;
 set opt(initialenergy)  1000;# Initial energy in Joules
 set num_ms_nodes10;
 set opt(nn) 2;
 
 # ==
 
 # Main Program
 
 # ==
 
 
 
 
 
 #
 
 # Initialize Global Variables
 
 #
 
 
 
 #start the simulator
 set ns [new Simulator]
 
 #open the trace file
 set tracefile1 [open a.tr w]
 $ns trace-all $tracefile1
 
 #Open NAM file
 set nf [open attachment.nam w]
 $ns namtrace-all $nf
 
 
 #define the procedure finish
 #proc finish {} {
 #global ns tracefile1
 #$ns flush-trace
 #close $tracefile1
 #exit 0
 #}
 
 proc finish {} {
 global ns nf
 $ns flush-trace
 close $nf
 exec /home/faraz/Desktop/ns-allinone-2.33/nam-1.13/nam
 attachment.nam 
 exit 0
 }
 
 
 # set up topography object
 
 set topo   [new Topography]
 
 
 $topo load_flatgrid $val(x) $val(y)
 
 
 
 # Create God General Operations Director
 
 
 
 create-god [expr $opt(nn) + $num_ms_nodes]
 
 # Create channel #1 and #2
 set chan_1_ [new $val(chan)]
 
 
 
 #
 
 #  Create the specified number of mobilenodes [$val(nn)] and attach them
 
 #  to the channel.
 
 #  Here two nodes are created : node(0) and node(1)
 
 
 
 # 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 ON \
 
  -macTrace OFF \
 
  -movementTrace OFF\
  -channel $chan_1_
 
 
  #-energyModel $opt(energymodel) \
  -idlePower 1.0 \
  -rxPower 1.0 \
  -txPower 1.0 \
  -sleepPower 0.001 \
  -transitionPower 0.2 \
  -transitionTime 0.005 \
  -initialEnergy $opt(initialenergy)
 
 
 for {set i 0} {$i  $val(nn) } {incr i} {
set node_($i) [$ns node]
$node_($i) random-motion 0   ;# disable random motion
}
 
 
 set udp0 [new Agent/UDP]
 $ns attach-agent $node_(0) $udp0
 
 set cbr0 [new Application/Traffic/CBR]
 $cbr0 set packetSize_ 1000
 $cbr0 set interval_ 0.005
 $cbr0 attach-agent $udp0
 
 set null0 [new Agent/Null]
 $ns attach-agent $node_(1) $null0
 
 $ns connect $udp0 $null0
 
 $ns at 1 $cbr0 start
 $ns at 4 $cbr0 stop
 $ns at 4.1 finish
 
 puts Starting Simulation...
 $ns run
 
 
 

-- 
View this message in context: 

[ns] otcl tutorial needed

2009-01-09 Thread tanixmukherzee


can ne1 suggest a gud otcl tutorial.i found one.but that seems not enuf...plz
do provide useful links
-- 
View this message in context: 
http://www.nabble.com/otcl-tutorial-needed-tp21371733p21371733.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] passing parmeters from .tcl files to .cc

2009-01-09 Thread Nadine Chen

Hi all
As you know, in the implementation of routing protocols, for
example in aodv we have AODV::AODV(nsaddr_t id) ; so I want to create
a .tcl file in which I have nodes , and each node has an identifier
that will be passed as the nsaddr_t id (the argument of AODV) 
how can I do this please?
thank you for your help.



  


[ns] Segmentation fault when compiling

2009-01-09 Thread Daniel A

Hi everybody,

I am working on ns2.33 using cygwin. When compiling the attached code, I get
the following message:

$ ./ns Evaltran.tcl 
num_nodes is set 1
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Base station is created!
wireles node is created!
39.312258
Simulation starts!!
Segmentation fault (core dumped)



An ns.exe text file appears in my compiling folder with the following
content

Exception: STATUS_ACCESS_VIOLATION at eip=18F71E50
eax= ebx=011F762C ecx=011EBDE4 edx=011F6808 esi=00229B00
edi=00229B50
ebp=002294B8 esp=002293E0
program=C:\cygwin\home\KiKoLoCo\ns-allinone-2.33\ns-2.33\ns.exe, pid 8112,
thread main
cs=001B ds=0023 es=0023 fs=003B gs= ss=0023
Stack trace:
Frame Function  Args
002294B8  18F71E50  (011E0998, 0602, , )
002294D8  19226F3E  (011E0998, 0602, , 1913AFAB)
002294F8  18F8685D  (011E1E08, 0602, 00229518, 18F88603)
00229518  18F86ED0  (011E1E08, 011E1E08, 00229968, 18F86668)
00229528  18F8863A  (011E1E08, 19338CEB, 00F72488, )
00229968  18F86668  (011E1E08, 0002, 00229B0C, 0003)
00229988  1913B9C6  (011E1E08, 00F72370, 0005, 00229B00)
00229B38  1913F0F2  (011EB1D0, 00F72370, 0003, 00229B50)
00229BB8  19143F88  (011EB2F0, 00F72370, 0003, 00F74690)
00229C48  19145650  (00F72370, 0003, 00F74690, )
00229EF8  191671D3  (00F72370, 011F29A8, 0010, 1915C357)
00229F28  1916AC4C  (00F72370, 011F29A8, 0005, )
0022A1D8  19167463  (00F72370, 0116D2A0, 0022A208, 1916B2FC)
0022A208  1916AC4C  (00F72370, 00F7B320, 00F7CF40, 0001)
0022A5D8  19160E78  (00F861F8, 00F72370, 0005, 0022A600)
0022A668  191610F5  (00F861F8, 00F72370, 0005, 0022A720)
End of stack trace (more stack frames may be present)


I tried to solve this problem by following the instructions in the link
listed below and provided by Mr Rehmani. 

http://article.gmane.org/gmane.network.simulator.isi/2766/match=segmentation
+fault 

but I got the following lines

$ gdb -c core
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/g
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show cop
and show warranty for details.
This GDB was configured as i686-pc-cygwin.
/home/KiKoLoCo/ns-allinone-2.33/ns-2.33/core: No such file or directo
(gdb) gdb -c core
Undefined command: gdb.  Try help.
(gdb) file ns
Reading symbols from /home/KiKoLoCo/ns-allinone-2.33/ns-2.33/ns.exe..
ing symbols found)...done.
(gdb) bt
No stack.
(gdb) select 0
No registers.
(gdb)


Note that at compiling other .tcl files everything works out. I attached the
compiled file, you may probably see the problem.

Thank you very much in advance.

Dan


[ns] logic error at handleTXTimer in ns-2.33

2009-01-09 Thread charlie zhang

Dear all,
I have installed the ns-allinone-2.33 and patched it with the 80211Ext
(updated October 21st, 2008) following the instruction from
http://dsn.tm.uni-karlsruhe.de/english/Overhaul_NS-2.php.
But when validating, the program reports as following:
---
validata overall report: some portable tests failed:
./test-all-wireless-lan-newnode-80211Ext
some non-portable tests also failed:
./test-all-smac-multihop  ./test-all-simulataneous  ./test-all-wireless-tdma
to return a specific test, cd tcl/test; ./test-all-TEST-NAME

when I run a .tcl scripts using the 80211Ext MAC and PHY, such as,
set val(netif)  Phy/WirelessPhyExt
set val(mac)Mac/802_11Ext

it reports:
-
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 18883.9
SORTING LISTS ...DONE!
L 0.00243737 0 MAC PHYBusyInd
L 0.00243757 0 MAC PHYBusyInd
L 0.00243761 0 MAC PHYBusyInd
L 0.00243858 0 MAC PHYBusyInd
L 0.00243943 0 MAC PHYBusyInd
L 0.00243944 0 MAC PHYBusyInd
L 0.00243989 0 MAC PHYBusyInd
L 0.00247737 0 MAC RxStartInd
L 0.00247757 0 MAC RxStartInd
L 0.00247761 0 MAC RxStartInd
L 0.00247858 0 MAC RxStartInd
L 0.00247943 0 MAC RxStartInd
L 0.00247944 0 MAC RxStartInd
L 0.00247989 0 MAC RxStartInd
logic error at handleTXTimer
L 0.00264537 0 MAC PHYIdleInd
L 0.00264537 0 MAC RxEndInd SUCC
Segmentation fault (core dumped)
--

who can help me how to tackle this problem? I am very grateful with tears.

CharlieZhang


[ns] Passing arguments when creating a TCPAgent in .tcl file

2009-01-09 Thread pankaj chand


 There is an instproc init {} procedure each for Agent and for Agent/TCPAgent.
I could not find the instproc init {} procedure of Agent/TCP/Reno or any of the 
other TCP Agents.
 
Why?
 
Is it because they inherit in a virtual way from class TCPAgent?, and so the 
instproc init {} procedure of the class TCPAgent is called only once for each 
of them.
 
Then how do we differentiate between the creation of the different TCPAgents 
from only one instproc init {} procedure of class TCPAgent.
 
My main objective is to pass arguments to the new Agent/TCP/Reno command which 
will pass the arguments to its respective init procedure (which I cannot find) 
and then the arguments will be passed to its static class constructor in the 
tcp-reno.cc file so i can choose whether or not to pass an argument to the 
constructor of the actual class RenoTcpAgent.
 
The main idea is to add one more constructor to class RenoTcpAgent and then to 
be able to choose which constructor to call when creating the object from the 
tcl script like set tcpreno [new Agent/TCP/Reno].
So i thought i would do it by passing an argument like set tcpreno [new 
Agent/TCP/Reno arg1].
 
Any help, advice or suggestions for the above problem, or achieving a solution 
of some kind will be appreciated.
 
Many thanks in advance.
 
Pankaj
_
See all the ways you can stay connected to friends and family
http://www.microsoft.com/windows/windowslive/default.aspx