[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: PROBLEM with queu-monitor and NAM



it's seems you have a problem with your "termina" procedure: you have to declare 
"fifo"  global in order to close it. You should be getting an error when you run 
you script?

> X-Authentication-Warning: mash.CS.Berkeley.EDU: majrdomo set sender to 
[email protected] using -f
> Date: Wed, 18 Aug 1999 12:25:07 +0200
> From: Vincenzo Mazzota <[email protected]>
> X-Accept-Language: es,it,en-US,en-GB
> MIME-Version: 1.0
> To: "ns-2, Mailing List" <[email protected]>, "Yu, Haobo" 
<[email protected]>
> Subject: PROBLEM with queu-monitor and NAM
> 
> Hi to everybody,
> 
> 1. Continuous to have a problem related to queu-monitor:
>     After having simulated my network topology I go to see the file
> trace where theoretically
>     the queue information should have been record in the
>     link switcher <---->pozo but I see that this file it is empty I
> don't understand the reason.....
>     observing simulation with the nam I see that the tail loses packets
> being his maximum length of
>     30 packets, therefore because in the file "fifo.tr" there is not
> absolutely anything???
> 
> 2. I have problems related to nam, in the sense that the nam doesn't
> visualize me the packets that go from the nodes
>     where I have climbed on the exponential generators of packets, I
> have tried to add the different colors
>     for every source but there has been no anything from to do.... Which
> is the cause???
> 
> This is the code of the network topology:
> 
> set ns [new Simulator]
> 
> set bw [expr 10000*1024*1024]
> set avgpktSize [expr 1505*8] ;# en bits
> set buffer 30
> set starttime 0.0
> set stoptime 1.204
> 
> puts "Creac�on de los ficheros de nam..."
> 
> set fifo [open ./output/fifo.tr w]
> ;#$ns trace-all $fifo
> 
> ;#set nf [open ./output/fifo.nam w]
> ;#$ns namtrace-all $nf
> 
> 
> ;# Procedimiento che se ejecuta para acabar la simulac�on
> 
> proc termina {} {
>      global ns f ;#nf
>      $ns flush-trace
>      close $fifo
>      ;#close $nf
>      puts "-------------------------------------------"
>      puts "Ahora tiene que ejecutar nam ./output/out.nam &"
>      exit 0
> }
> 
>    ;# Colores del fluso de datos
> 
> $ns color 1 Blue
> $ns color 2 Red
> $ns color 3 Chocolate
> $ns color 4 Brown
> $ns color 5 Tan
> $ns color 6 Gold
> $ns color 7 Black
> $ns color 8 White
> $ns color 9 Green
> $ns color 10 Yellow
> $ns color 11 Purple
> $ns color 12 Bisque
> $ns color 13 Khaki
> $ns color 14 Goldenrod
> $ns color 15 Sienna
> $ns color 16 HotPink
> 
> puts "Generac�on de la topologia de la red..."
> 
> ;# Nodo switch
> 
> set switcher [$ns node]
> puts switcher=[$switcher id]
> 
> ;# Nodo pozo
> 
> set pozo [$ns node]
> puts pozo=[$pozo id]
> ;# Protocolo de comunicaci�n UDP
> 
> set udp0 [new Agent/UDP]
> 
> ;#set rho 1
> ;#set rate_generador [expr $rho*10000*1024*1024/1.6]
> 
> 
> puts "Creac�on de los links de la topologia..."
> 
> for {set i 2} {$i < 18} {incr i} {
> 
> ;# Nodos fuentes
> 
>     set n($i) [$ns node]
>     puts n($i)=[$n($i) id]
> 
> ;# Links entre los nodos
> 
> ;# fuente1   ------\
> ;# fuente2   ------\\
> ;#   ...          ------\\\
> ;#   ...          ------\\\\
> ;#   ...          ------\\\\\
> ;#   ...          ------\\\\\\
> ;#   ...          ------\\\\\\\
> ;#                        -----------
> ;#   ...        ----->|  switch      |
> ;#   ...        ----->|     +          |---> pozo
> ;#                       | cola FIFO |
> ;#                        -----------
> ;#   ...          -------///////
> ;#   ...          -------//////
> ;#   ...          -------/////
> ;#   ...          -------////
> ;#   ...          -------///
> ;# fuente 15 -------//
> ;# fuente 16 -------/
> 
>     $ns duplex-link $n($i) $switcher $bw 1us DropTail
>     $ns attach-agent $n($i) $udp0
>   }
> 
> $ns duplex-link $switcher $pozo 10000Mb 1us DropTail
> $ns attach-agent $switcher $udp0
> 
> puts "Creac�on de los generadores..."
> 
> ;# generadores exponenciales con lambda = 0.1
> 
> puts "Conectando los generadores exponencial al Agente UDP..."
> for {set i 1} {$i < 18} {incr i} {
>    set exp_ON_OFF_($i) [new Application/Traffic/Exponential]
>    $exp_ON_OFF_($i) attach-agent $udp0
> 
>    ;# parametros de la fuente i
> 
>    $exp_ON_OFF_($i) set packet_size_ 1505
>    $exp_ON_OFF_($i) set burst_time_ 0.1s
>    $exp_ON_OFF_($i) set idle_time_ 0.9s
>    $exp_ON_OFF_($i) set rate_ 10485760K
> 
>    ;# cada fujo de datos de cada fuente tiene un colore
> 
>    $exp_ON_OFF_($i) set fid_ ($i)
> }
> 
> 
> ;# numero maximo de paquetes en la cola del switch
> 
> puts "Limitacion de la cola switch-pozo a 30 pqts..."
> $ns queue-limit $switcher $pozo $buffer
> 
> 
> set null0 [new Agent/Null]
> $ns attach-agent $pozo $null0
> $ns connect $udp0 $null0
> 
> 
> 
> ;# monitorando los datos de la cola cada medio segundo
> 
> set cola_monitor [$ns monitor-queue $switcher $pozo $fifo]
> $cola_monitor set-pkts-integrator [new Integrator]
> set ave [expr [[$cola_monitor get-pkts-integrator] set sum_
> ]*$avgpktSize/$stoptime/$bw*1000]
> $ns duplex-link-op $switcher $pozo queuePos 0.5
> 
> ;# Se activan los generadores esponencial al tiempo 0
> ;# y se paran al tiempo 1.204
> 
> for {set i 1} {$i < 18} {incr i} {
>    $ns at $starttime "$exp_ON_OFF_($i) start"
>    $ns at $stoptime "$exp_ON_OFF_($i) stop"
> }
> 
> set x [[$cola_monitor get-pkts-integrator] set lastx_]
> set y [[$cola_monitor get-pkts-integrator] set lasty_]
> $ns at $stoptime [puts $fifo "$x $y"]
> $ns at $stoptime [puts $fifo "$stoptime $ave"]
> 
> ;# la simulac�on se para despues 1.204 segundos
> ;# (10^6 paquetes) llamando el procedimiento termina
> 
> $ns at $stoptime "termina"
> $ns run
> 
> 
> Waiting for your news...
> Vincenzo Mazzotta
> 
> ([email protected])

Tarik