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

Incredible...



Like it`s possible that a file nam it`s large 400 MB to make a stupid
simulation.......!!!!!!

My script it's this..... How can i do ?????

set ns [new Simulator]

puts "Creac�on de los ficheros de nam..."

set f [open ./output/out.tr w]
$ns trace-all $f
set nf [open ./output/out.nam w]
$ns namtrace-all $nf

puts "Generac�on de la topologia de la red..."

;# Nodos fuentes

set fuente1 [$ns node]
set fuente2 [$ns node]
set fuente3 [$ns node]
set fuente4 [$ns node]
set fuente5 [$ns node]
set fuente6 [$ns node]
set fuente7 [$ns node]
set fuente8 [$ns node]
set fuente9 [$ns node]
set fuente10 [$ns node]
set fuente11 [$ns node]
set fuente12 [$ns node]
set fuente13 [$ns node]
set fuente14 [$ns node]
set fuente15 [$ns node]
set fuente16 [$ns node]

;# Nodo switch

set switcher [$ns node]

;# Nodo pozo

set pozo [$ns node]



;# Links entre los nodos

;# fuente1   ------\
;# fuente2   ------\\
;#   ...     ------\\\
;#   ...     ------\\\\
;#   ...     ------\\\\\
;#   ...     ------\\\\\\
;#   ...     ------\\\\\\\
;#                -----------
;#   ...   ----->|  switch   |
;#   ...   ----->|     +     |---> pozo
;#               | cola FIFO |
;#                -----------
;#   ...     -------///////
;#   ...     -------//////
;#   ...     -------/////
;#   ...     -------////
;#   ...     -------///
;# fuente 15 -------//
;# fuente 16 -------/




puts "Creac�on de los links de la topologia..."

$ns duplex-link $fuente1 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente2 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente3 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente4 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente5 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente6 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente7 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente8 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente9 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente10 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente11 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente12 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente13 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente14 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente15 $switcher 10000Mb 1us DropTail
$ns duplex-link $fuente16 $switcher 10000Mb 1us DropTail
$ns duplex-link $switcher $pozo 10000Mb 1us DropTail


;# Protocolo de comunicaci�n UDP

set udp0 [new Agent/UDP]

;#set rho 1
;#set rate_generador [expr $rho*10000*1024*1024/1.6]

$ns attach-agent $fuente1 $udp0
$ns attach-agent $fuente2 $udp0
$ns attach-agent $fuente3 $udp0
$ns attach-agent $fuente4 $udp0
$ns attach-agent $fuente5 $udp0
$ns attach-agent $fuente6 $udp0
$ns attach-agent $fuente7 $udp0
$ns attach-agent $fuente8 $udp0
$ns attach-agent $fuente9 $udp0
$ns attach-agent $fuente10 $udp0
$ns attach-agent $fuente11 $udp0
$ns attach-agent $fuente12 $udp0
$ns attach-agent $fuente13 $udp0
$ns attach-agent $fuente14 $udp0
$ns attach-agent $fuente15 $udp0
$ns attach-agent $fuente16 $udp0
$ns attach-agent $switcher $udp0

puts "Creac�on de los generadores..."

;# generadores exponenciales con lambda = 0.1

set exp_ON_OFF_1 [new Application/Traffic/Exponential]
set exp_ON_OFF_2 [new Application/Traffic/Exponential]
set exp_ON_OFF_3 [new Application/Traffic/Exponential]
set exp_ON_OFF_4 [new Application/Traffic/Exponential]
set exp_ON_OFF_5 [new Application/Traffic/Exponential]
set exp_ON_OFF_6 [new Application/Traffic/Exponential]
set exp_ON_OFF_7 [new Application/Traffic/Exponential]
set exp_ON_OFF_8 [new Application/Traffic/Exponential]
set exp_ON_OFF_9 [new Application/Traffic/Exponential]
set exp_ON_OFF_10 [new Application/Traffic/Exponential]
set exp_ON_OFF_11 [new Application/Traffic/Exponential]
set exp_ON_OFF_12 [new Application/Traffic/Exponential]
set exp_ON_OFF_13 [new Application/Traffic/Exponential]
set exp_ON_OFF_14 [new Application/Traffic/Exponential]
set exp_ON_OFF_15 [new Application/Traffic/Exponential]
set exp_ON_OFF_16 [new Application/Traffic/Exponential]


puts "Conectendo los generadores exponencial al Agente UDP..."

$exp_ON_OFF_1 attach-agent $udp0
$exp_ON_OFF_2 attach-agent $udp0
$exp_ON_OFF_3 attach-agent $udp0
$exp_ON_OFF_4 attach-agent $udp0
$exp_ON_OFF_5 attach-agent $udp0
$exp_ON_OFF_6 attach-agent $udp0
$exp_ON_OFF_7 attach-agent $udp0
$exp_ON_OFF_8 attach-agent $udp0
$exp_ON_OFF_9 attach-agent $udp0
$exp_ON_OFF_10 attach-agent $udp0
$exp_ON_OFF_11 attach-agent $udp0
$exp_ON_OFF_12 attach-agent $udp0
$exp_ON_OFF_13 attach-agent $udp0
$exp_ON_OFF_14 attach-agent $udp0
$exp_ON_OFF_15 attach-agent $udp0
$exp_ON_OFF_16 attach-agent $udp0


;# para la fuente1

$exp_ON_OFF_1 set packet_size_ 1505
$exp_ON_OFF_1 set burst_time_ 0.1s
$exp_ON_OFF_1 set idle_time_ 0.9s
$exp_ON_OFF_1 set rate_ 10485760K


;# para la fuente2

$exp_ON_OFF_2 set packet_size_ 1505
$exp_ON_OFF_2 set burst_time_ 0.1s
$exp_ON_OFF_2 set idle_time_ 0.9s
$exp_ON_OFF_2 set rate_ 10485760K


;# para la fuente3

$exp_ON_OFF_3 set packet_size_ 1505
$exp_ON_OFF_3 set burst_time_ 0.1s
$exp_ON_OFF_3 set idle_time_ 0.9s
$exp_ON_OFF_3 set rate_ 10485760K


;# para la fuente4

$exp_ON_OFF_4 set packet_size_ 1505
$exp_ON_OFF_4 set burst_time_ 0.1s
$exp_ON_OFF_4 set idle_time_ 0.9s
$exp_ON_OFF_4 set rate_ 10485760K


;# para la fuente5

$exp_ON_OFF_5 set packet_size_ 1505
$exp_ON_OFF_5 set burst_time_ 0.1s
$exp_ON_OFF_5 set idle_time_ 0.9s
$exp_ON_OFF_5 set rate_ 10485760K


;# para la fuente6

$exp_ON_OFF_6 set packet_size_ 1505
$exp_ON_OFF_6 set burst_time_ 0.1s
$exp_ON_OFF_6 set idle_time_ 0.9s
$exp_ON_OFF_6 set rate_ 10485760K


;# para la fuente7

$exp_ON_OFF_7 set packet_size_ 1505
$exp_ON_OFF_7 set burst_time_ 0.1s
$exp_ON_OFF_7 set idle_time_ 0.9s
$exp_ON_OFF_7 set rate_ 10485760K


;# para la fuente8

$exp_ON_OFF_8 set packet_size_ 1505
$exp_ON_OFF_8 set burst_time_ 0.1s
$exp_ON_OFF_8 set idle_time_ 0.9s
$exp_ON_OFF_8 set rate_ 10485760K


;# para la fuente9

$exp_ON_OFF_9 set packet_size_ 1505
$exp_ON_OFF_9 set burst_time_ 0.1s
$exp_ON_OFF_9 set idle_time_ 0.9s
$exp_ON_OFF_9 set rate_ 10485760K


;# para la fuente10

$exp_ON_OFF_10 set packet_size_ 1505
$exp_ON_OFF_10 set burst_time_ 0.1s
$exp_ON_OFF_10 set idle_time_ 0.9s
$exp_ON_OFF_10 set rate_ 10485760K


;# para la fuente11

$exp_ON_OFF_11 set packet_size_ 1505
$exp_ON_OFF_11 set burst_time_ 0.1s
$exp_ON_OFF_11 set idle_time_ 0.9s
$exp_ON_OFF_11 set rate_ 10485760K


;# para la fuente12

$exp_ON_OFF_12 set packet_size_ 1505
$exp_ON_OFF_12 set burst_time_ 0.1s
$exp_ON_OFF_12 set idle_time_ 0.9s
$exp_ON_OFF_12 set rate_ 10485760K


;# para la fuente13

$exp_ON_OFF_13 set packet_size_ 1505
$exp_ON_OFF_13 set burst_time_ 0.1s
$exp_ON_OFF_13 set idle_time_ 0.9s
$exp_ON_OFF_13 set rate_ 10485760K


;# para la fuente14

$exp_ON_OFF_14 set packet_size_ 1505
$exp_ON_OFF_14 set burst_time_ 0.1s
$exp_ON_OFF_14 set idle_time_ 0.9s
$exp_ON_OFF_14 set rate_ 10485760K


;# para la fuente15

$exp_ON_OFF_15 set packet_size_ 1505
$exp_ON_OFF_15 set burst_time_ 0.1s
$exp_ON_OFF_15 set idle_time_ 0.9s
$exp_ON_OFF_15 set rate_ 10485760K


;# para la fuente16

$exp_ON_OFF_16 set packet_size_ 1505
$exp_ON_OFF_16 set burst_time_ 0.1s
$exp_ON_OFF_16 set idle_time_ 0.9s
$exp_ON_OFF_16 set rate_ 10485760K


;# numero maximo de paquetes en la cola del switch

puts "Limitacion de la cola switch-pozo a 30 pqts..."
$ns queue-limit $switcher $pozo 30

set null0 [new Agent/Null]
$ns attach-agent $pozo $null0
$ns connect $udp0 $null0


;# Se activan los generadores esponencial al tiempo 0

$ns at 0.0 "$exp_ON_OFF_1 start"
$ns at 0.0 "$exp_ON_OFF_2 start"
$ns at 0.0 "$exp_ON_OFF_3 start"
$ns at 0.0 "$exp_ON_OFF_4 start"
$ns at 0.0 "$exp_ON_OFF_5 start"
$ns at 0.0 "$exp_ON_OFF_6 start"
$ns at 0.0 "$exp_ON_OFF_7 start"
$ns at 0.0 "$exp_ON_OFF_8 start"
$ns at 0.0 "$exp_ON_OFF_9 start"
$ns at 0.0 "$exp_ON_OFF_10 start"
$ns at 0.0 "$exp_ON_OFF_11 start"
$ns at 0.0 "$exp_ON_OFF_12 start"
$ns at 0.0 "$exp_ON_OFF_13 start"
$ns at 0.0 "$exp_ON_OFF_14 start"
$ns at 0.0 "$exp_ON_OFF_15 start"
$ns at 0.0 "$exp_ON_OFF_16 start"

$ns at 1.204 "$exp_ON_OFF_1 stop"
$ns at 1.204 "$exp_ON_OFF_2 stop"
$ns at 1.204 "$exp_ON_OFF_3 stop"
$ns at 1.204 "$exp_ON_OFF_4 stop"
$ns at 1.204 "$exp_ON_OFF_5 stop"
$ns at 1.204 "$exp_ON_OFF_6 stop"
$ns at 1.204 "$exp_ON_OFF_7 stop"
$ns at 1.204 "$exp_ON_OFF_8 stop"
$ns at 1.204 "$exp_ON_OFF_9 stop"
$ns at 1.204 "$exp_ON_OFF_10 stop"
$ns at 1.204 "$exp_ON_OFF_11 stop"
$ns at 1.204 "$exp_ON_OFF_12 stop"
$ns at 1.204 "$exp_ON_OFF_13 stop"
$ns at 1.204 "$exp_ON_OFF_14 stop"
$ns at 1.204 "$exp_ON_OFF_15 stop"
$ns at 1.204 "$exp_ON_OFF_16 stop"



;# la simulac�on se para despues 1.204 segundos
;# (10^6 paquetes) llamando el procedimiento termina

$ns at 1.204 "termina"


;# Procedimiento che se ejecuta para acabar la simulac�on

proc termina {} {
     global ns f nf
     $ns flush-trace
     close $f
     close $nf

     puts "Ahora tiene que ejecutar nam ./output/out.nam &"
     exit 0
}

$ns run



Thanks for help.....

Vincenzo Mazzotta

([email protected])
begin:vcard 
n:Mazzotta;Vincenzo
tel;cell:+34-600831910
tel;home:+34-93-4430581
x-mozilla-html:FALSE
org:FIB - UPC (Catalunya Politecnic University) - Spain;Computer Arquitecture (AC)
adr:;;Calle Sancho Marraco 4 , 3� 2�;Barcelona;BCN;08004;Spain
version:2.1
email;internet:[email protected]
title:Carrer Final Project (Doble Tiulation)
fn:Vincenzo Mazzotta
end:vcard