[ns] Problem with "regagent_"

2007-06-24 Thread xueguanpeng

hello everybody:I use NS2-2.27 recently,the OS is Fedora Core 5 ,and encounter 
a problem while I run a wireless simulation.first is the tcl 
script:mobileIP.tcl# 
==# 
 Options# 
== set 
opt(nn)  1   ;# one MHset num_wired_nodes  2   
;# two wired nodes set opt(x)  670 ;# x coordinate of 
topologyset opt(y)  670 ;# y coordinate of topology set 
opt(ftp1-start)  100.0 ;#start to transfer ftpset opt(stop) 
 250  ;#simulation stop set opt(tr-ns)infra-out.tr ;# 
set trace fileset opt(tr-nam)  infra-out.nam  ;# set nam  # 
==# 
  MAC# 
== 
Mac/802_11!
  set dataRate_2.0e6 ;# transfer rate 2MbpsMac/802_11 set 
RTSThreshold_3000 ;# not use RTS/CTS # 
==# 
  Nodes# 
== set ns_  
 [new Simulator]$ns_ node-config -addressType hierarchical  ;# address 
mode AddrParams set domain_num_ 3   ;# set 3 domain: wired, wireless, 
wirelesslappend cluster_num 2 1 1  ;# set 2 clusters for wired 
domain,1 to wireless 1, 1 to wireless 2AddrParams set cluster_num_ 
$cluster_numlappend eilastlevel 1 1 2 1;#set 1 node for wired 
domain, cluster 1, 1 node for wired domain, cluster 2   
 ;# set two nodes for wireless 1, cluster 1, set one node for wireless 2, 
cluster 1AddrParams set nodes_num_ $eilastlevel  ;# of each domain set tracefd  
[open $opt(tr-ns) w]set namtrace [open $opt(tr-nam) w]$ns_ trace!
 -all $tracefd$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y) set 
topo   [new Topography]$topo load_flatgrid $opt(x) $opt(y) create-god [expr 
$opt(nn) + 2]#   2 for HA and FA 
#---#   
   wired nodes#--- 
#set wired nodesset temp {0.0.0 0.1.0}   ;# hierarchical addressesfor 
{set i 0} {$i < $num_wired_nodes} {incr i} {set W($i) [$ns_ node [lindex 
$temp $i]]} #---#   
hybrid and wireless 
nodes#--- $ns_ 
node-config  -mobileIP ON \ -adhocRoutiing DSDV \   
  -llType LL \ -macType Mac/802_11 \ -ifqType 
Queue/DropTail/PriQueue \ -ifqLen 50 \ -antType 
Antenna/OmniAntenna \ -propType Propagation/TwoRayGround \  
   -phyType Phy/WirelessPhy \ -channel [n!
 ew "Channel/WirelessChannel"] \ -topoInstance $topo \  
   -wiredRouting ON \ -agentTrace ON \ 
-routerTrace OFF \ -macTrace OFF # set HA and FAset HA [$ns_ 
node 1.0.0]   ;#domain 2, cluster 1, node 1set FA [$ns_ node 2.0.0]   ;#domain 
3, cluster 1, node 1 $HA set X_ 1.00$HA set Y_ 2.00$HA set Z_ 0.00 $FA set X_ 
650.00$FA set Y_ 600.00$FA set Z_ 0.00 # create links between wired and 
BaseStation nodes$ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail$ns_ duplex-link 
$W(1) $HA 5Mb 2ms DropTail$ns_ duplex-link $W(1) $FA 5Mb 2ms DropTail $ns_ 
duplex-link-op $W(0) $W(1) orient down$ns_ duplex-link-op $W(1) $HA orient 
left-down$ns_ duplex-link-op $W(1) $FA orient right-down # create a mobilenode 
(in the domain of the HA)# that is moving between HA and FA.$ns_ node-config 
-wiredRouting OFF #set Mobile Hostset MH [$ns_ node 1.0.1]#register MH to HAset 
HAaddress [AddrParams addr2id [$HA node-addr]][$MH set regagent!
 _] set home_agent_ $HAaddress$MH set Z_ 0.00$MH set Y_ 2.00$MH set X_ 
2.00 # at 100 sec,MH move towards FA$ns_ at 100.00 "$MH setdest 640.00 610.00 
20.00"# at 200 sec,MH move towards HA$ns_ at 200.00 "$MH setdest 2.00 2.00 
20.00" # Define initial node position in nam$ns_ initial_node_pos $MH 20 
#==#
 
Agents#== set 
tcp1 [new Agent/TCP]$tcp1 set class_ 2set sink1 [new Agent/TCPSink]$ns_ 
attach-agent $W(0) $tcp1$ns_ attach-agent $MH $sink1$ns_ connect $tcp1 
$sink1set ftp1 [new Application/FTP]$ftp1 attach-agent $tcp1$ns_ at 
$opt(ftp1-start) "$ftp1 start" 
#==#
 
End#== $ns_ at 
$opt(

[ns] How to get an agent's trace file?

2007-06-24 Thread 魏于涛


Hi everyone,I want to know how to obtain the trace file of  a specific agent in 
ns2. I 
want to know what the specific agent did, but I do not know how to trace 
the agent.
Any suggestions will be appreciated.Thanks in advance.
Yutao Wei,CCMIP, Shandong University, P.R. China
_
探索 Windows Vista 的世界
http://search.live.com/results.aspx?q=windows+vista&mkt=zh-cn&FORM=LIVSOP

[ns] Distance function in mobilenode.cc

2007-06-24 Thread leticia bela

Hi all,
   
  I modify the AODV protocol, in aodv.cc I want to calculate the distance 
between a node and its neighbors with using the distance function in 
common/mobilenode.cc having as parameter "MobileNode" type how can i proceed.
(In aodv index is a nsaddr_t type)

thank you for your Help


 
-
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 


Re: [ns] urgent help with trace graphs

2007-06-24 Thread Venelin


Hello,

I am having the same issue. Did you managed to interpreter this trace file
and i so, what command did you use? 




bageira wrote:
> 
> hi...i'm in urgent need of help with creating a trace graph from a trace
> file.i'm using ns-2 and my code is for a wimax module.  i have a trace
> file of this kind:
> 
> s 0.000100840 _0_ MAC  --- 0 DLMAP 24 [0 0  0] --- [0:0 0:0 0
> 0] 
> s 0.000100840 _0_ MAC  --- 0 ULMAP 28 [0 0  0] --- [0:0 0:0 0
> 0] 
> s 0.000100840 _0_ MAC  --- 0 DCD 116 [0 0  0] --- [0:0 0:0 0
> 0] 
> s 0.000100840 _0_ MAC  --- 0 UCD 180 [0 0  0] --- [0:0 0:0 0
> 0] 
> r 0.000101598 _5_ MAC  --- 0 DLMAP 24 [0 0  0] --- [0:0 0:0 0
> 0] 
> r 0.000101598 _5_ MAC  --- 0 ULMAP 28 [0 0  0] --- [0:0 0:0 0
> 0] 
> r 0.000101598 _5_ MAC  --- 0 DCD 116 [0 0  0] --- [0:0 0:0 0
> 0] 
> r 0.000101598 _5_ MAC  --- 0 UCD 180 [0 0  0] --- [0:0 0:0 0
> 0] 
> r 0.000101638 _1_ MAC  --- 0 DLMAP 24 [0 0  0] --- [0:0 0:0 0
> 0] 
> 
> but i dont know what command to type in the console to have it plotted on
> a trace graph so i can analyse it. could someone pliz help me???
> thanks alot
> 

-- 
View this message in context: 
http://www.nabble.com/urgent-help-with-trace-graphs-tf3877163.html#a11274838
Sent from the ns-users mailing list archive at Nabble.com.



[ns] how does monitor-queue works?

2007-06-24 Thread Ali Moarefianpour

Dear NS users

I simulated a simple network consisting of 2 sources and 3 links, using
ns2.29.
In this simulation I want to monitor the queue between nodes n3 and n4.
I used the following command to do this:
set qmon [$ns monitor-queue $n3 $n4 [open qm.out w] 0.1];
[$ns link $n3 $n4] queue-sample-timeout;
At the end of simulation "qm.out" is created.
The 4'Th column must be the queue size in bytes and the 5'Th column must be
queue size in packets.
These variables must be integer variable, whereas related columns in "qm.out"
are real value numbers.
I want to know is this normal or it is a bug.

How can I collect the queue size correctly, if it is a bug? Or how can one
interpret this (expected integer value data (queue_size) are real value data
in practice).

Some lines of "qm.out" are presented here.



0 3 4 0 0 0 0 0 0 0 0
0.10001 3 4 0.0 0.0 0 0 0 0 0 0
0.20001 3 4 0.0 0.0 0 0 0 0 0 0
0.30004 3 4 0.0 0.0 0 0 0 0 0 0
0.40002 3 4 0.0 0.0 0 0 0 0 0 0
0.5 3 4 0.0 0.0 0 0 0 0 0 0
0.59998 3 4 0.0319987601 0.000799969006 3 3 0
1120 1120 0
0.69996 3 4 151.42379 0.145599798 8 8 0 6320
5200 0
0.79993 3 4 650.623263 0.625599294 18 17 0 16720
9360 0
0.89991 3 4 1890.303999819 1.8175983 30 27 0 29200
10400 0
0.99989 3 4 4367.99627 4.1647 42 36 0 41680
9360 0
1.0999 3 4 6880.639998775 6.61598833 54 46 0 54160
10400 0
1.2 3 4 9383.295997056 9.02237151 66 55 0 66640 9360 0
1.3 3 4 11870.97599499 11.4143519 78 65 0 79120 10400 0
1.4001 3 4 14386.9439931 13.8335334 90 75 0 91600
10400 0