[ns] some question about "gt-itm"

2006-09-29 Thread r9406014

Dear ns2 users:
When I use gt-itm to generate a general random model, 
but there are some problems in it.

I want to use one parameter files, and generate three graphs.

but, when i input for example, "itm r10", the system's output is "memory alloc 
error".
does anybody know where is "gt-itm"'s problem?

thanks

Tai-Yi Lin



[ns] Urgent reply needed

2006-09-29 Thread Bhoi Maheshbhai Mohanbhai

I run my protocol of spbm, which uses greedy & perimeter routing,
   
  I can compile my code,but got the error
   
  missing close-brace: possible unbalanced brace in comment
while executing
"proc create-spbm-mobile-node { id args } {
global ns ns_ chan prop topo tracefd opt node_
set ns_ [Simulator instance]
#if {[Simulator s..."(file "tcl/mobility/spbm.tcl" line 87)
 
and the Tcl script is as shown below:
   
   
   
  Agent/SPBMAgent set sport_0
Agent/SPBMAgent set dport_0
Agent/SPBMAgent set bint_ 0.5 ;# beacon interval
Agent/SPBMAgent set bdesync_  0.5 ;# beacon desync random component
Agent/SPBMAgent set bexp_ [expr 3*([Agent/SPBMAgent set 
bint_]+[Agent/SPBMAgent set bdesync_]*[Agent/SPBMAgent set bint_])] ;# beacon 
timeout interval
Agent/SPBMAgent set pint_ 1.5 ;# peri probe interval
Agent/SPBMAgent set pdesync_  0.5 ;# peri probe desync random component
Agent/SPBMAgent set lpexp_8.0 ;# peris unused timeout interval
Agent/SPBMAgent set use_mac_  0;# use link breakage feedback from 
MAC
Agent/SPBMAgent set use_peri_ 0   ;# probe and use perimeters
Agent/SPBMAgent set verbose_  0;#
Agent/SPBMAgent set peri_proact_  1   ;# proactively generate peri probes
Agent/SPBMAgent set use_implicit_beacon_ 0 ;# all packets act as beacons; 
promisc.
Agent/SPBMAgent set use_planar_   0;# planarize graph
Agent/SPBMAgent set use_loop_detect_ 0 ;# look for unexpected loops in peris
Agent/SPBMAgent set use_timed_plnrz_ 0 ;# replanarize periodically
  set opt(ragent) Agent/SPBMAgent
  set opt(pos)  NONE   ;# Box or NONE
  if { $opt(pos) == "Box" } {
 puts "*** SPBM using Box configuration..."
}
  Agent instproc init args {
eval $self next $args
}
  Agent/SPBMAgent instproc init args 
 {
 eval $self next $args
 }
 proc create-spbm-routing-agent { node id } {
 global ns_ ragent_ tracefd opt#  Create the Routing Agent and attach 
it to port 255.
#

 
 set ragent_($id) [new $opt(ragent)]
 set ragent $ragent_($id)
## setup address (supports hier-addr) for spbm agent
 ## and mobilenode

 set addr [$node node-addr]
  $ragent node $node

 if [Simulator set mobile_ip_] {
 $ragent port-dmux [$node set dmux_]
 }
  $node addr $addr
  $node set ragent_ $ragent
 
  #$node attach $ragent 255
  $node attach $ragent [Node set rtagent_port_]
  
  $ns_ at 0.0 "$ragent_($id) start-spbm" ;   # Drop Target (always on 
regardless of other tracing)
#
set drpT [cmu-trace Drop "RTR" $node]
$ragent drop-target $drpT
  
# Log Target
  set T [new Trace/Generic]
$T target [$ns_ set nullAgent_]
$T attach $tracefd
$T set src_ $id
$ragent tracetarget $T
  # ifq
$ragent add-ifq [$node set ifq_(0)]
}
  
proc create-spbm-mobile-node { id args } {
global ns ns_ chan prop topo tracefd opt node_
  set ns_ [Simulator instance]
  #if {[Simulator set EnableHierRt_]} {
if [Simulator hier-addr?]
{
   if [Simulator set mobile_ip_]
 {
 set node_($id) [new MobileNode/MIPMH $args]
 }
 #else
 {
 #set node_($id) [new Node/MobileNode/BaseStationNode $args]
 }
}
else
{
 set node_($id) [new Node/MobileNode]
}
set node $node_($id)
$node random-motion 0  ;# disable random motion
$node topography $topo
  
# XXX Activate energy model so that we can use sleep, etc. But put on
# a very large initial energy so it'll never run out of it.

   if [info exists opt(energy)]{
   $node addenergymodel [new $opt(energy) $node 1000 0.5 0.2]
 }   
   # This Trace Target is used to log changes in direction

 # and velocity for the mobile node. 
 #  set T [new Trace/Generic]

 $T target [$ns_ set nullAgent_]
 $T attach $tracefd
 
 $T set src_ $id
 $node log-target $T
 
 if ![info exist opt(err)]
 {
 set opt(err) ""
 }
 if ![info exist opt(outerr)] {
 set opt(outerr) ""
 }
 if ![info exist opt(fec)] {
 set opt(fec) ""
 }
 $node add-interface $chan $prop $opt(ll) $opt(mac) \   
   $opt(ifq) $opt(ifqlen) $opt(netif) $opt(ant) $topo $opt(err) $opt(outerr) 
$opt(fec)
  # Create a Routing Agent for the Node

 #  create-$opt(rp)-routing-agent $node $id   
   if { $opt(pos) == "Box" } {  # Box Configuration
  
 #set spacing 200  
 set maxrow 7 
 
 set col [expr ($id - 1) % $maxrow]  
 set row [expr ($id - 1) / $maxrow]  
 $node set X_ [expr $col * $spacing]
  
 $node set Y_ [expr $row * $spacing]  
 $node set Z_ 0.0
  
 $node set speed_ 0.0

 $ns_ at 0.0 "$node_($id) start"
 }
 return $node
}
   
   
  If any one can point out the error.then it is too good for me.
   
  Reply quickly if possible.
  Thanks in advance...
   
   
  Mahesh


-
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messe

Re: [ns] Urgent reply needed

2006-09-29 Thread Pedro Vale Estrela


Check  "Why can I not place unmatched braces in Tcl comments?"
http://wiki.tcl.tk/462 

And http://phaseit.net/claird/comp.lang.tcl/fmm.html
And http://mini.net/tcl/1669.html

If this helps you, contribute and put this info in the ns2 wiki

Regards
Pedro Vale etsrela


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Bhoi Maheshbhai Mohanbhai
> Sent: sexta-feira, 29 de Setembro de 2006 9:23
> To: ns-users@ISI.EDU
> Subject: [ns] Urgent reply needed
> 
> 
> I run my protocol of spbm, which uses greedy & perimeter routing,
> 
>   I can compile my code,but got the error
> 
>   missing close-brace: possible unbalanced brace in comment
> while executing
> "proc create-spbm-mobile-node { id args } {
> global ns ns_ chan prop topo tracefd opt node_
> set ns_ [Simulator instance]
> #if {[Simulator s..."(file "tcl/mobility/spbm.tcl" line 87)
> 
> and the Tcl script is as shown below:
> 
> 
> 
>   Agent/SPBMAgent set sport_0
> Agent/SPBMAgent set dport_0
> Agent/SPBMAgent set bint_ 0.5 ;# beacon interval
> Agent/SPBMAgent set bdesync_  0.5 ;# beacon desync random component
> Agent/SPBMAgent set bexp_ [expr 3*([Agent/SPBMAgent set
> bint_]+[Agent/SPBMAgent set bdesync_]*[Agent/SPBMAgent set bint_])] ;#
> beacon timeout interval
> Agent/SPBMAgent set pint_ 1.5 ;# peri probe interval
> Agent/SPBMAgent set pdesync_  0.5 ;# peri probe desync random
> component
> Agent/SPBMAgent set lpexp_8.0 ;# peris unused timeout interval
> Agent/SPBMAgent set use_mac_  0;# use link breakage feedback
> from MAC
> Agent/SPBMAgent set use_peri_ 0   ;# probe and use perimeters
> Agent/SPBMAgent set verbose_  0;#
> Agent/SPBMAgent set peri_proact_  1   ;# proactively generate peri
> probes
> Agent/SPBMAgent set use_implicit_beacon_ 0 ;# all packets act as beacons;
> promisc.
> Agent/SPBMAgent set use_planar_   0;# planarize graph
> Agent/SPBMAgent set use_loop_detect_ 0 ;# look for unexpected loops in
> peris
> Agent/SPBMAgent set use_timed_plnrz_ 0 ;# replanarize periodically
>   set opt(ragent) Agent/SPBMAgent
>   set opt(pos)  NONE   ;# Box or NONE
>   if { $opt(pos) == "Box" } {
>  puts "*** SPBM using Box configuration..."
> }
>   Agent instproc init args {
> eval $self next $args
> }
>   Agent/SPBMAgent instproc init args
>  {
>  eval $self next $args
>  }
>  proc create-spbm-routing-agent { node id } {
>  global ns_ ragent_ tracefd opt#  Create the Routing Agent and
> attach it to port 255.
> #
> 
> 
>  set ragent_($id) [new $opt(ragent)]
>  set ragent $ragent_($id)
> ## setup address (supports hier-addr) for spbm agent
>  ## and mobilenode
> 
>  set addr [$node node-addr]
>   $ragent node $node
> 
>  if [Simulator set mobile_ip_] {
>  $ragent port-dmux [$node set dmux_]
>  }
>   $node addr $addr
>   $node set ragent_ $ragent
> 
>   #$node attach $ragent 255
>   $node attach $ragent [Node set rtagent_port_]
> 
>   $ns_ at 0.0 "$ragent_($id) start-spbm" ;   # Drop Target (always on
> regardless of other tracing)
> #
> set drpT [cmu-trace Drop "RTR" $node]
> $ragent drop-target $drpT
> 
> # Log Target
>   set T [new Trace/Generic]
> $T target [$ns_ set nullAgent_]
> $T attach $tracefd
> $T set src_ $id
> $ragent tracetarget $T
>   # ifq
> $ragent add-ifq [$node set ifq_(0)]
> }
> 
> proc create-spbm-mobile-node { id args } {
> global ns ns_ chan prop topo tracefd opt node_
>   set ns_ [Simulator instance]
>   #if {[Simulator set EnableHierRt_]} {
> if [Simulator hier-addr?]
> {
>if [Simulator set mobile_ip_]
>  {
>  set node_($id) [new MobileNode/MIPMH $args]
>  }
>  #else
>  {
>  #set node_($id) [new Node/MobileNode/BaseStationNode $args]
>  }
> }
> else
> {
>  set node_($id) [new Node/MobileNode]
> }
> set node $node_($id)
> $node random-motion 0  ;# disable random motion
> $node topography $topo
> 
> # XXX Activate energy model so that we can use sleep, etc. But put on
> # a very large initial energy so it'll never run out of it.
> 
>if [info exists opt(energy)]{
>$node addenergymodel [new $opt(energy) $node 1000 0.5 0.2]
>  }
># This Trace Target is used to log changes in direction
> 
>  # and velocity for the mobile node.
>  #  set T [new Trace/Generic]
> 
>  $T target [$ns_ set nullAgent_]
>  $T attach $tracefd
> 
>  $T set src_ $id
>  $node log-target $T
> 
>  if ![info exist opt(err)]
>  {
>  set opt(err) ""
>  }
>  if ![info exist opt(outerr)] {
>  set opt(outerr) ""
>  }
>  if ![info exist opt(fec)] {
>  set opt(fec) ""
>  }
>  $node add-interface $chan $prop $opt(ll) $opt(mac) \
>$opt(ifq) $opt(ifqlen) $opt(netif) $opt(ant) $topo $opt(err)
> $opt(outerr) $opt(fec)
>   # Create a Routing Agent for the Node
> 
>  #  create-$opt(rp)-routing-agent $node $id
>if { $opt(pos) == "Box"

Re: [ns] A router (gateway) between two ad hoc networks

2006-09-29 Thread Pedro Vale Estrela



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of [EMAIL PROTECTED]
> Sent: quinta-feira, 28 de Setembro de 2006 9:44
> To: ns-users@ISI.EDU
> Subject: [ns] A router (gateway) between two ad hoc networks
> 
> 
> Hello,
> 
> I am trying to implement a router (gateway) between two ad hoc networks
> using hierarchical addressing and in two different domains. As an
> example:
> 
> MANET 1:
> 1.0.1
> 1.0.2
> 
> MANET 2:
> 2.0.1
> 2.0.2
> 2.0.3
> 
> A shortcut solution is to use two BaseStationNodes, i.e.:
> 
> BSNode1: 1.0.0
> BSNode2: 2.0.0
> 
> And linking them with a full duplex link. Since the characteristics of
> the wired link will interfere with the simulation, I do not like this
> solution.
This is a good point
To minimize it, i suggest you to make a simple wired link with
0.1 delay and "infinite" bandwidth 


> The better solution is to manipulate the ns-bsnode.tcl implementation
> for supporting two wireless interfaces in different domains.
This requires a manet protocol which is hierarchical-aware, which I don't
think the implemented Ns2 protocols support. The other solution has the
benefit of not requiring MANET protocols any changes.

> Could you provide me a solution for this, if anyone has a better one, or
> implemented one?
> 
> Regards,
> Majid
> 
> ***
> Majid Ghader
> Research Officer
> Centre for Communication Systems Research
> University of Surrey, Guildford, United Kingdom
> 
> http://www.ee.surrey.ac.uk/showstaff?M.Ghader
> 
> ***
> 
> 
> 





[ns] Filtering Columns from output trace file

2006-09-29 Thread Aleksandar Smolovic

Hi all,

I have a basic NS2 question. 

After executing tcl script, I have result files on my HDD. I have output trace 
file, let's say "out.tr". Now I want to draw some graphics. My out.tr files 
have 12 columns and I need only 2. How to do it ?

I saw that in documentation people mention "column.pl" perl script fajl, for 
this purpose, but I cannot find how to use it.

Can somebody help me with filtering 2 columns from trace file? 

Thanks.


Re: [ns] Filtering Columns from output trace file

2006-09-29 Thread Renata Vidal

cat  | awk '{ print $1 $2 }'

and so on

On 9/29/06, Aleksandar Smolovic <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I have a basic NS2 question.
>
> After executing tcl script, I have result files on my HDD. I have output 
> trace file, let's say "out.tr". Now I want to draw some graphics. My out.tr 
> files have 12 columns and I need only 2. How to do it ?
>
> I saw that in documentation people mention "column.pl" perl script fajl, for 
> this purpose, but I cannot find how to use it.
>
> Can somebody help me with filtering 2 columns from trace file?
>
> Thanks.
>


-- 
Renata Vidal
"Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
TSU – pg 102)"



Re: [ns] Filtering Columns from output trace file

2006-09-29 Thread Pedro Vale Estrela


Try

cat trace.tr | awk ' { print $2 $6 $8 } '


PS: Good subjects, as in this case, will get you the answers!

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Aleksandar Smolovic
> Sent: sexta-feira, 29 de Setembro de 2006 16:11
> To: NS-Users
> Subject: [ns] Filtering Columns from output trace file
> 
> 
> Hi all,
> 
> I have a basic NS2 question.
> 
> After executing tcl script, I have result files on my HDD. I have output
> trace file, let's say "out.tr". Now I want to draw some graphics. My
> out.tr files have 12 columns and I need only 2. How to do it ?
> 
> I saw that in documentation people mention "column.pl" perl script fajl,
> for this purpose, but I cannot find how to use it.
> 
> Can somebody help me with filtering 2 columns from trace file?
> 
> Thanks.




Re: [ns] generating topology

2006-09-29 Thread Sita S. Krishnakumar

Hi,
I want to thank the many people who replied to my query.

setdest with M=.001 did not give me the required topology. It does seem to
have motion even when the speed is miniscule, dont know why.

I decided to try brite and did generate a topology. nedase is a dos tool
and  i tried to convert from brite to ns, but that didnt work.
All the node locations seem to be 0. I know they are non-zero in brite.
You seem to be the creator of nedase - any reason why this is happening?
If you are interested, I can send my brite and generated ns file.

Thanks,
Sita

On Thu, September 28, 2006 12:05 pm, Muhammad Azizur Rahman wrote:
> U can use topology generator "brite" to create a topology and convert
> that topology into ns-2 (.ns) format using "nedase" tool.
>
>
> "Sita S. Krishnakumar" <[EMAIL PROTECTED]> wrote:
> Hi,
> I am interested in generating a random distribution of static nodes for my
>  simulation. How can I do this in ns-2? I am looking at around 200 nodes
> and do not want to hand-generate the topology. Thanks,
> Sita
>
>
>
>
>
>
>
> -
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
> countries) for 2¢/min or less.




[ns] trouble with error model over wired links

2006-09-29 Thread Abdul Jabbar

Hello,

I am having unusual trouble getting a simple error model to work over 
wired links in ns2.29. I have checked the mailing list archives and 
could not find a similar problem/solution. Below is my tcl script which 
represents a simple network topology of 3 nodes connected in a chain 
using duplex-links. I have a CBR/UDP flow between the nodes 0 and 3. The 
flow path is 0-1-2-3.

If I don't use any error on the links, everything works fine as is 
confirmed by the trace file and the nam visualization.

However, if I include a simple error model and attach it to each of the 
three links, the whole simulation goes awry. In the trace file I see 
packets going from node 0 to node 1. There is no data flow between node 
2 and node 3 and there is a data flow between nodes 2 and 3. Basically 
the packets disappear  on node 1 and magically reappear at node 2.  In 
nam visualization, it is even worse...there is just one flow between 
nodes 0 and 1thats it.no other data flows. Changing the error 
rate does not help.

When I have a more complex topology ( like a mesh topology of 8x8 nodes) 
the whole simulation goes so bizarre, that it is even hard to trace what 
is going wrong. That's why I am using this simple 3 node topology to 
illustrate the problem.

I am hoping that there is some fundamental mistake on my part. Please 
point in the right direction.

Thanks,
Abdul.

Here's the TCL script
--
set ns [new Simulator]
set tf [open simout.tr w]
$ns trace-all $tf
set nf [open simout.nam w]
$ns namtrace-all $nf
proc finish {} {
  global ns nf tf
  $ns flush-trace
  close $nf
  close $tf
  exec nam simout.nam &
  exit 0
}

for {set i 0} {$i < 4} {incr i} {
  set n($i) [$ns node]
}

$ns duplex-link $n(0) $n(1) 500Mb 10ms DropTail
$ns duplex-link $n(1) $n(2) 500Mb 10ms DropTail
$ns duplex-link $n(2) $n(3) 500Mb 10ms DropTail

set em [new ErrorModel]
$em unit pkt
$em set rate_ 0.01
$em ranvar [new RandomVariable/Uniform]
$em drop-target [new Agent/Null]

$ns link-lossmodel $em $n(0) $n(1)
$ns link-lossmodel $em $n(1) $n(2)
$ns link-lossmodel $em $n(2) $n(3)

set udp0 [new Agent/UDP]
$ns attach-agent $n(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 $n(3) $null0
$ns connect $udp0 $null0

$ns at 0.5 "$cbr0 start"
$ns at 4.5 "$cbr0 stop"
$ns at 5.0 "finish"

$ns run



Re: [ns] Filtering Columns from output trace file

2006-09-29 Thread Salvador Alcaraz Carrasco



another way:

cat trace.tr | perl column 1 5 7




/salva



On Fri, 29 Sep 2006, Pedro Vale Estrela wrote:




Try

cat trace.tr | awk ' { print $2 $6 $8 } '


PS: Good subjects, as in this case, will get you the answers!


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Aleksandar Smolovic
Sent: sexta-feira, 29 de Setembro de 2006 16:11
To: NS-Users
Subject: [ns] Filtering Columns from output trace file


Hi all,

I have a basic NS2 question.

After executing tcl script, I have result files on my HDD. I have output
trace file, let's say "out.tr". Now I want to draw some graphics. My
out.tr files have 12 columns and I need only 2. How to do it ?

I saw that in documentation people mention "column.pl" perl script fajl,
for this purpose, but I cannot find how to use it.

Can somebody help me with filtering 2 columns from trace file?

Thanks.






__
Salvador Alcaraz Carrasco  http://www.umh.es
Arquitectura y Tecnología de Computadores  http://obelix.umh.es
Dpto. Física y Arquitectura de Computadoressalcaraz[arroba]umh.es
Universidad Miguel Hernández   salcaraz[arroba]obelix.umh.es
Avda. de la universidad, s/n   Telf. +34 96 665 8495
Elche, Alicante (Spain)
__

Re: [ns] Filtering Columns from output trace file

2006-09-29 Thread Pedro Vale Estrela


cat trace.tr | awk ' { print "$2\t\t$8" } '


hint: check this small doc and associated tools to answer a lot of questions
"ns-2 for the impatient": http://icapeople.epfl.ch/aad/teaching/ns/

> -Original Message-
> From: Aleksandar Smolovic [mailto:[EMAIL PROTECTED]
> Sent: sexta-feira, 29 de Setembro de 2006 16:50
> To: [EMAIL PROTECTED]
> Subject: Re: [ns] Filtering Columns from output trace file
> 
> Thank you.
> 
> How to make delimiter between columns in new file. It should be done
> during
> creation of new file?
> 
> 
> - Original Message -
> From: "Pedro Vale Estrela" <[EMAIL PROTECTED]>
> To: "'Aleksandar Smolovic'" <[EMAIL PROTECTED]>; "'NS-Users'" 
> 
> Sent: Friday, September 29, 2006 5:42 PM
> Subject: RE: [ns] Filtering Columns from output trace file
> 
> 
> 
> Try
> 
> cat trace.tr | awk ' { print $2 $6 $8 } '
> 
> 
> PS: Good subjects, as in this case, will get you the answers!
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf
> > Of Aleksandar Smolovic
> > Sent: sexta-feira, 29 de Setembro de 2006 16:11
> > To: NS-Users
> > Subject: [ns] Filtering Columns from output trace file
> >
> >
> > Hi all,
> >
> > I have a basic NS2 question.
> >
> > After executing tcl script, I have result files on my HDD. I have output
> > trace file, let's say "out.tr". Now I want to draw some graphics. My
> > out.tr files have 12 columns and I need only 2. How to do it ?
> >
> > I saw that in documentation people mention "column.pl" perl script fajl,
> > for this purpose, but I cannot find how to use it.
> >
> > Can somebody help me with filtering 2 columns from trace file?
> >
> > Thanks.





[ns] LossMonitor - can't read, no such variable

2006-09-29 Thread Renata Vidal

Why I can't set a variable like this: SinkCBR($i) ?
Its got me crazy! If I set each variable like SinkCBR0, SinkCBR1 and
so on, its be OK, but if I try SinkCBR($i) or SinkCBR$i I see the
message "no such variable".
Whats is wrong?

-- Forwarded message --
From: Renata Vidal <[EMAIL PROTECTED]>
Date: Sep 28, 2006 2:47 PM
Subject: LossMonitor - can't read, no such variable
To: ns-users 


Hi,

I was trying to use the LossMonitor, but I see the message:
ns: record: can't read "sink(1)": no such variable
while executing
"$sink(1) set bytes_"
(procedure "record" line 12)
invoked from within "record"

This a peace of my code, I don't know whats is wrong:

(..)
set sink($i) [new Agent/LossMonitor]
$ns attach-agent $s($i) $tcp($i)
$ns attach-agent $r($i) $sink($i)
$ns connect $tcp($i) $sink($i)
(..)
proc record {} {
 puts stderr "recording"
 global sink(1) f0
 set ns [Simulator instance]
 set time 0.5
 set bw0 [$sink(1) set bytes_]
 set now [$ns now]
 puts $f0 "$now [expr $bw0]"
 $ns at [expr $now+$time] "record"
}

Any Clue?

--
Renata Vidal
"Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
TSU – pg 102)"


-- 
Renata Vidal
"Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
TSU – pg 102)"



Re: [ns] LossMonitor - can't read, no such variable

2006-09-29 Thread Pedro Vale Estrela

Ahh, the ever challenging TCL syntax...

a) Check Frequently Made Mistakes™ in Tcl
http://phaseit.net/claird/comp.lang.tcl/fmm.html

b) try like this:

> proc record {} {
>  puts stderr "recording"
>  global sink f0   ;#  <<< changed line
>  set ns [Simulator instance]
>  set time 0.5
>  set bw0 [$sink(1) set bytes_]
>  set now [$ns now]
>  puts $f0 "$now [expr $bw0]"
>  $ns at [expr $now+$time] "record"
> }




> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Renata Vidal
> Sent: sexta-feira, 29 de Setembro de 2006 19:54
> To: ns-users
> Subject: [ns] LossMonitor - can't read, no such variable
> 
> 
> Why I can't set a variable like this: SinkCBR($i) ?
> Its got me crazy! If I set each variable like SinkCBR0, SinkCBR1 and
> so on, its be OK, but if I try SinkCBR($i) or SinkCBR$i I see the
> message "no such variable".
> Whats is wrong?
> 
> -- Forwarded message --
> From: Renata Vidal <[EMAIL PROTECTED]>
> Date: Sep 28, 2006 2:47 PM
> Subject: LossMonitor - can't read, no such variable
> To: ns-users 
> 
> 
> Hi,
> 
> I was trying to use the LossMonitor, but I see the message:
> ns: record: can't read "sink(1)": no such variable
> while executing
> "$sink(1) set bytes_"
> (procedure "record" line 12)
> invoked from within "record"
> 
> This a peace of my code, I don't know whats is wrong:
> 
> (..)
> set sink($i) [new Agent/LossMonitor]
> $ns attach-agent $s($i) $tcp($i)
> $ns attach-agent $r($i) $sink($i)
> $ns connect $tcp($i) $sink($i)
> (..)
> proc record {} {
>  puts stderr "recording"
>  global sink(1) f0
>  set ns [Simulator instance]
>  set time 0.5
>  set bw0 [$sink(1) set bytes_]
>  set now [$ns now]
>  puts $f0 "$now [expr $bw0]"
>  $ns at [expr $now+$time] "record"
> }
> 
> Any Clue?
> 
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> TSU – pg 102)"
> 
> 
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> TSU – pg 102)"





Re: [ns] trouble with error model over wired links

2006-09-29 Thread Pedro Vale Estrela


Hi there,
This is another fine post to the ns-users mailing list. 
Good subject, good question overall == totally in line with
http://www.catb.org/~esr/faqs/smart-questions.html

the problem is that you are putting the loss-model in all 3 links; 
I report exactly the same tracea and NAM problems.

Instead, Try this:

#$ns link-lossmodel $em $n(0) $n(1)
$ns link-lossmodel $em $n(1) $n(2)
#$ns link-lossmodel $em $n(2) $n(3)


pedro vale estrela
http://tagus.inesc-id.pt/~pestrela/ns2/




> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Abdul Jabbar
> Sent: sexta-feira, 29 de Setembro de 2006 17:45
> To: ns-users@ISI.EDU
> Subject: [ns] trouble with error model over wired links
> 
> 
> Hello,
> 
> I am having unusual trouble getting a simple error model to work over
> wired links in ns2.29. I have checked the mailing list archives and
> could not find a similar problem/solution. Below is my tcl script which
> represents a simple network topology of 3 nodes connected in a chain
> using duplex-links. I have a CBR/UDP flow between the nodes 0 and 3. The
> flow path is 0-1-2-3.
> 
> If I don't use any error on the links, everything works fine as is
> confirmed by the trace file and the nam visualization.
> 
> However, if I include a simple error model and attach it to each of the
> three links, the whole simulation goes awry. In the trace file I see
> packets going from node 0 to node 1. There is no data flow between node
> 2 and node 3 and there is a data flow between nodes 2 and 3. Basically
> the packets disappear  on node 1 and magically reappear at node 2.  In
> nam visualization, it is even worse...there is just one flow between
> nodes 0 and 1thats it.no other data flows. Changing the error
> rate does not help.
> 
> When I have a more complex topology ( like a mesh topology of 8x8 nodes)
> the whole simulation goes so bizarre, that it is even hard to trace what
> is going wrong. That's why I am using this simple 3 node topology to
> illustrate the problem.
> 
> I am hoping that there is some fundamental mistake on my part. Please
> point in the right direction.
> 
> Thanks,
> Abdul.
> 
> Here's the TCL script
> --
> set ns [new Simulator]
> set tf [open simout.tr w]
> $ns trace-all $tf
> set nf [open simout.nam w]
> $ns namtrace-all $nf
> proc finish {} {
>   global ns nf tf
>   $ns flush-trace
>   close $nf
>   close $tf
>   exec nam simout.nam &
>   exit 0
> }
> 
> for {set i 0} {$i < 4} {incr i} {
>   set n($i) [$ns node]
> }
> 
> $ns duplex-link $n(0) $n(1) 500Mb 10ms DropTail
> $ns duplex-link $n(1) $n(2) 500Mb 10ms DropTail
> $ns duplex-link $n(2) $n(3) 500Mb 10ms DropTail
> 
> set em [new ErrorModel]
> $em unit pkt
> $em set rate_ 0.01
> $em ranvar [new RandomVariable/Uniform]
> $em drop-target [new Agent/Null]
> 
> $ns link-lossmodel $em $n(0) $n(1)
> $ns link-lossmodel $em $n(1) $n(2)
> $ns link-lossmodel $em $n(2) $n(3)
> 
> set udp0 [new Agent/UDP]
> $ns attach-agent $n(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 $n(3) $null0
> $ns connect $udp0 $null0
> 
> $ns at 0.5 "$cbr0 start"
> $ns at 4.5 "$cbr0 stop"
> $ns at 5.0 "finish"
> 
> $ns run





Re: [ns] LossMonitor - can't read, no such variable

2006-09-29 Thread Filippos Kolovos

-
Of course I can...! no worries there!

The problem with your code is in the "record" procedure
and specifically at the "global" command, which brings
into local scope the array "sink".

In particular, the error that you are making is that you are trying
to bring in local scope only one element of the array, i.e. sink(1)
which is not acceptable as a variable for tcl (although it is in reality
but with arrays it does not work this way).

In order for the code to work you are going to have to bring in local
scope the whole array and not only a single element.

I mean that the only thing you have to do is to change the command
from "global sink(1)" to "global sink" and you are good to go.

Have a nice weekend;-)

-Fk

On 9/29/06, Renata Vidal <[EMAIL PROTECTED]> wrote:
>
> Filippos,
>
> Can you help me?
>
> -- Forwarded message --
> From: Renata Vidal <[EMAIL PROTECTED]>
> Date: Sep 28, 2006 2:47 PM
> Subject: LossMonitor - can't read, no such variable
> To: ns-users 
>
>
> Hi,
>
> I was trying to use the LossMonitor, but I see the message:
> ns: record: can't read "sink(1)": no such variable
> while executing
> "$sink(1) set bytes_"
> (procedure "record" line 12)
> invoked from within "record"
>
> This a piece of my code, I don't know whats is wrong:
>
> (..)
> set sink($i) [new Agent/LossMonitor]
> $ns attach-agent $s($i) $tcp($i)
> $ns attach-agent $r($i) $sink($i)
> $ns connect $tcp($i) $sink($i)
> (..)
> proc record {} {
> puts stderr "recording"
> global sink(1) f0
> set ns [Simulator instance]
> set time 0.5
> set bw0 [$sink(1) set bytes_]
> set now [$ns now]
> puts $f0 "$now [expr $bw0]"
> $ns at [expr $now+$time] "record"
> }
>
> Any Clue?
>
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> TSU – pg 102)"
>
>
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> TSU – pg 102)"
>



-- 
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

E-Mail: [EMAIL PROTECTED],
   [EMAIL PROTECTED]
Phone: +30-2310-891-826
--


Re: [ns] LossMonitor - can't read, no such variable

2006-09-29 Thread Renata Vidal

My variables are called sink($i), the () is in the name of them. I
tried scape it but it not solve the problem. If I change for something
like sink$i I have errors on attach-agent command.
This example below don't works for me...
Any clue?

On 9/29/06, Pedro Vale Estrela <[EMAIL PROTECTED]> wrote:
> Ahh, the ever challenging TCL syntax...
>
> a) Check Frequently Made Mistakes™ in Tcl
> http://phaseit.net/claird/comp.lang.tcl/fmm.html
>
> b) try like this:
>
> > proc record {} {
> >  puts stderr "recording"
> >  global sink f0   ;#  <<< changed line
> >  set ns [Simulator instance]
> >  set time 0.5
> >  set bw0 [$sink(1) set bytes_]
> >  set now [$ns now]
> >  puts $f0 "$now [expr $bw0]"
> >  $ns at [expr $now+$time] "record"
> > }
>
>
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> > Of Renata Vidal
> > Sent: sexta-feira, 29 de Setembro de 2006 19:54
> > To: ns-users
> > Subject: [ns] LossMonitor - can't read, no such variable
> >
> >
> > Why I can't set a variable like this: SinkCBR($i) ?
> > Its got me crazy! If I set each variable like SinkCBR0, SinkCBR1 and
> > so on, its be OK, but if I try SinkCBR($i) or SinkCBR$i I see the
> > message "no such variable".
> > Whats is wrong?
> >
> > -- Forwarded message --
> > From: Renata Vidal <[EMAIL PROTECTED]>
> > Date: Sep 28, 2006 2:47 PM
> > Subject: LossMonitor - can't read, no such variable
> > To: ns-users 
> >
> >
> > Hi,
> >
> > I was trying to use the LossMonitor, but I see the message:
> > ns: record: can't read "sink(1)": no such variable
> > while executing
> > "$sink(1) set bytes_"
> > (procedure "record" line 12)
> > invoked from within "record"
> >
> > This a peace of my code, I don't know whats is wrong:
> >
> > (..)
> > set sink($i) [new Agent/LossMonitor]
> > $ns attach-agent $s($i) $tcp($i)
> > $ns attach-agent $r($i) $sink($i)
> > $ns connect $tcp($i) $sink($i)
> > (..)
> > proc record {} {
> >  puts stderr "recording"
> >  global sink(1) f0
> >  set ns [Simulator instance]
> >  set time 0.5
> >  set bw0 [$sink(1) set bytes_]
> >  set now [$ns now]
> >  puts $f0 "$now [expr $bw0]"
> >  $ns at [expr $now+$time] "record"
> > }
> >
> > Any Clue?
> >
> > --
> > Renata Vidal
> > "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> > ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> > TSU – pg 102)"
> >
> >
> > --
> > Renata Vidal
> > "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> > ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> > TSU – pg 102)"
>
>
>


-- 
Renata Vidal
"Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
TSU – pg 102)"



Re: [ns] LossMonitor - can't read, no such variable

2006-09-29 Thread Pedro Vale Estrela

Instead of that, define the sink as an array variable and use it as normal
http://wiki.tcl.tk/1032




set sink(1) [new Agent/TCPSink]

...

Proc something { }  {
global sink

...
set bw0 [$sink(1) set bytes_]

}

> -Original Message-
> From: Renata Vidal [mailto:[EMAIL PROTECTED]
> Sent: sexta-feira, 29 de Setembro de 2006 20:48
> To: [EMAIL PROTECTED]
> Cc: ns-users
> Subject: Re: [ns] LossMonitor - can't read, no such variable
> 
> My variables are called sink($i), the () is in the name of them. I
> tried scape it but it not solve the problem. If I change for something
> like sink$i I have errors on attach-agent command.
> This example below don't works for me...
> Any clue?
> 
> On 9/29/06, Pedro Vale Estrela <[EMAIL PROTECTED]> wrote:
> > Ahh, the ever challenging TCL syntax...
> >
> > a) Check Frequently Made Mistakes™ in Tcl
> > http://phaseit.net/claird/comp.lang.tcl/fmm.html
> >
> > b) try like this:
> >
> > > proc record {} {
> > >  puts stderr "recording"
> > >  global sink f0   ;#  <<< changed line
> > >  set ns [Simulator instance]
> > >  set time 0.5
> > >  set bw0 [$sink(1) set bytes_]
> > >  set now [$ns now]
> > >  puts $f0 "$now [expr $bw0]"
> > >  $ns at [expr $now+$time] "record"
> > > }
> >
> >
> >
> >
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf
> > > Of Renata Vidal
> > > Sent: sexta-feira, 29 de Setembro de 2006 19:54
> > > To: ns-users
> > > Subject: [ns] LossMonitor - can't read, no such variable
> > >
> > >
> > > Why I can't set a variable like this: SinkCBR($i) ?
> > > Its got me crazy! If I set each variable like SinkCBR0, SinkCBR1 and
> > > so on, its be OK, but if I try SinkCBR($i) or SinkCBR$i I see the
> > > message "no such variable".
> > > Whats is wrong?
> > >
> > > -- Forwarded message --
> > > From: Renata Vidal <[EMAIL PROTECTED]>
> > > Date: Sep 28, 2006 2:47 PM
> > > Subject: LossMonitor - can't read, no such variable
> > > To: ns-users 
> > >
> > >
> > > Hi,
> > >
> > > I was trying to use the LossMonitor, but I see the message:
> > > ns: record: can't read "sink(1)": no such variable
> > > while executing
> > > "$sink(1) set bytes_"
> > > (procedure "record" line 12)
> > > invoked from within "record"
> > >
> > > This a peace of my code, I don't know whats is wrong:
> > >
> > > (..)
> > > set sink($i) [new Agent/LossMonitor]
> > > $ns attach-agent $s($i) $tcp($i)
> > > $ns attach-agent $r($i) $sink($i)
> > > $ns connect $tcp($i) $sink($i)
> > > (..)
> > > proc record {} {
> > >  puts stderr "recording"
> > >  global sink(1) f0
> > >  set ns [Simulator instance]
> > >  set time 0.5
> > >  set bw0 [$sink(1) set bytes_]
> > >  set now [$ns now]
> > >  puts $f0 "$now [expr $bw0]"
> > >  $ns at [expr $now+$time] "record"
> > > }
> > >
> > > Any Clue?
> > >
> > > --
> > > Renata Vidal
> > > "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> > > ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> > > TSU – pg 102)"
> > >
> > >
> > > --
> > > Renata Vidal
> > > "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> > > ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> > > TSU – pg 102)"
> >
> >
> >
> 
> 
> --
> Renata Vidal
> "Triste é o destino de quem tenta vencer as batalhas e ter sucesso nos
> ataques sem cultivar o espírito da iniciativa (A Arte da Guerra – SUN
> TSU – pg 102)"




Re: [ns] trouble with error model over wired links

2006-09-29 Thread Abdul Jabbar

I was able to solve this problem. I would like to thank both Pedro and 
Alam for their response. The solution provided by Pedro: that is to 
apply the error to just one link does work. However, my intention was to 
simulate a network where every link has a certain error rate. The 
solution provided by Alam: that is to use a separate errorModel object 
for each link works exactly as I intended.

The mistake on my part was that after attaching the errorModel object to 
one link, I was trying to attach the same object to a second link. 
However, the response of ns was very confusing.

Thanks,
Abdul.


Abdul Jabbar wrote:
> Hello,
>
> I am having unusual trouble getting a simple error model to work over 
> wired links in ns2.29. I have checked the mailing list archives and 
> could not find a similar problem/solution. Below is my tcl script 
> which represents a simple network topology of 3 nodes connected in a 
> chain using duplex-links. I have a CBR/UDP flow between the nodes 0 
> and 3. The flow path is 0-1-2-3.
>
> If I don't use any error on the links, everything works fine as is 
> confirmed by the trace file and the nam visualization.
>
> However, if I include a simple error model and attach it to each of 
> the three links, the whole simulation goes awry. In the trace file I 
> see packets going from node 0 to node 1. There is no data flow between 
> node 2 and node 3 and there is a data flow between nodes 2 and 3. 
> Basically the packets disappear  on node 1 and magically reappear at 
> node 2.  In nam visualization, it is even worse...there is just one 
> flow between nodes 0 and 1thats it.no other data flows. 
> Changing the error rate does not help.
>
> When I have a more complex topology ( like a mesh topology of 8x8 
> nodes) the whole simulation goes so bizarre, that it is even hard to 
> trace what is going wrong. That's why I am using this simple 3 node 
> topology to illustrate the problem.
>
> I am hoping that there is some fundamental mistake on my part. Please 
> point in the right direction.
>
> Thanks,
> Abdul.
>
> Here's the TCL script
> --
> set ns [new Simulator]
> set tf [open simout.tr w]
> $ns trace-all $tf
> set nf [open simout.nam w]
> $ns namtrace-all $nf
> proc finish {} {
>  global ns nf tf
>  $ns flush-trace
>  close $nf
>  close $tf
>  exec nam simout.nam &
>  exit 0
> }
>
> for {set i 0} {$i < 4} {incr i} {
>  set n($i) [$ns node]
> }
>
> $ns duplex-link $n(0) $n(1) 500Mb 10ms DropTail
> $ns duplex-link $n(1) $n(2) 500Mb 10ms DropTail
> $ns duplex-link $n(2) $n(3) 500Mb 10ms DropTail
>
> set em [new ErrorModel]
> $em unit pkt
> $em set rate_ 0.01
> $em ranvar [new RandomVariable/Uniform]
> $em drop-target [new Agent/Null]
>
> $ns link-lossmodel $em $n(0) $n(1)
> $ns link-lossmodel $em $n(1) $n(2)
> $ns link-lossmodel $em $n(2) $n(3)
>
> set udp0 [new Agent/UDP]
> $ns attach-agent $n(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 $n(3) $null0
> $ns connect $udp0 $null0
>
> $ns at 0.5 "$cbr0 start"
> $ns at 4.5 "$cbr0 stop"
> $ns at 5.0 "finish"
>
> $ns run
>



[ns] queuing enque/deque calls

2006-09-29 Thread Larry Brigman

I have built a version of taildrop from the ns-by-example that
allows me to check to see how many copies of the class
have been created.

If I use this class on a duplex-link I get two classes created, as expected.

When passing traffic in both directions, only one of the two created classes
gets called.  Any reason why?  Can anybody give me a good place to
start looking in the code to troubleshoot this?

I am running ns2-2.29 from ns-allinone.



[ns] how to patch a new file to NS

2006-09-29 Thread Agila Rajendran

hi all 
  Iam new to  NS,LINUX and this user group.
   
  somebody plz tell me how to patch a new file to NS and run it
   
  path is set in Usr ,but iam currently working in ROOT.
  i tried ./patch 
  it showed some error in the directory path.
  plz tell me should i go to usr  mode and type ./patch.
   
  iam badly in need of this module.plz help me
   
  thank u 
  Agilandeswari Rajendiran




-
 Find out what India is talking about on  - Yahoo! Answers India 
 Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it 
NOW