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

problem to build a simple toppology...



Hi to everybody....

    I have a problem I concern the concepts to create a net topology....

First, I have to effect a simulation of an optic switcher and the type
of used protocol doesn't interest me having for hypothesis a sure mean
(absence of troubles)..
Now having to simulate 16 sources of packets from 1505 (as ATM) with 16
different generating exponential I have decided to use EXPOO_Traffic,
these generators will be connected to the switcher that is a node for me
(because I have to know the statistic of the packets lost by the
switcher that it has a droptail) and finally from this they will go in a
sink node.
The problem is that I have tried of to make a script that developed this
but unfortunately I think about having some problems on the concepts
that have been exposed on ns2 notes and Documentacion.
I would like to know the following things:

1. EXPOO_Traffic can be created, setted and connected to switch node or
is necessary to attach for strength an agent on the source, on the
switcher or on both...????

2. Does EXPOO_Traffic owe for strength to have climbed on an agent??

3. There is not a way to be able to send the packets produced by
EXPOO_Traffic to the switcher node and then from this to the sink node
without adding an agent of a protocol that to me it doesn't interest and
this change me the statistic... ?

4. Must I have  a DropTail in the switcher to calculate the statistic of
the packets arrived by the generating EXPOOs that are lost it goes well
as i'm written in the script??


Thanks....


I send my TCL script :


set ns [new Simulator]
puts "Creac�on de los ficheros de nam..."
set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf

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

set fuente1 [$ns node]           ;# sources Nodes
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]

set switch [$ns node]            ;# switch Node

set pozo [$ns node]              ;# sink Node

                           ;# Links entre los nodos

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

$ns simplex-link fuente1 switch 10000Mb 1ms DropTail     ;# source1
-------\
$ns simplex-link fuente2 switch 10000Mb 1us      ;# source2
-----------------\\
$ns simplex-link fuente3 switch 10000Mb 1us      ;#   ...
--------------------\\\
$ns simplex-link fuente4 switch 10000Mb 1us      ;#   ...
--------------------\\\\
$ns simplex-link fuente5 switch 10000Mb 1us      ;#   ...
--------------------\\\\\
$ns simplex-link fuente6 switch 10000Mb 1us      ;#   ...
--------------------\\\\\\
$ns simplex-link fuente7 switch 10000Mb 1us      ;#   ...
--------------------\\\\\\\

;#                                       ---------------
$ns simplex-link fuente8 switch 10000Mb 1us      ;#
...                      ------>|     switch       |
$ns simplex-link fuente9 switch 10000Mb 1us      ;#
...                      ------>|        +           | --------> sink

;#                                       | FIFO queue |

;#                                       ---------------
$ns simplex-link fuente10 switch 10000Mb 1us     ;#   ...
-------------------///////
$ns simplex-link fuente11 switch 10000Mb 1us     ;#   ...
-------------------//////
$ns simplex-link fuente12 switch 10000Mb 1us     ;#   ...
-------------------/////
$ns simplex-link fuente13 switch 10000Mb 1us     ;#   ...
-------------------////
$ns simplex-link fuente14 switch 10000Mb 1us     ;#   ...
-------------------///
$ns simplex-link fuente15 switch 10000Mb 1us     ;# source 15
----------------//
$ns simplex-link fuente16 switch 10000Mb 1us     ;# source 16
----------------/


$ns simplex-link switch pozo 10000Mb 1us DropTail

numero maximo de paquetes en la cola del switch
set null0 [new Agent/Null]
$ns queue-limit switch pozo 50

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

set exp_ON_OFF_1 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_1 attach-agent fuente1
$exp_ON_OFF_1 set packet_size_ 1505*8                     ;# para la
fuente1
$exp_ON_OFF_1 set burst_time_ 1.204us
$exp_ON_OFF_1 set idle_time_ 0,999998796s
$exp_ON_OFF_1 set rate 15.5M

set exp_ON_OFF_2 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_2 attach-agent fuente2
$exp_ON_OFF_2 set packet_size_ 1505*8                     ;# para la
fuente2
$exp_ON_OFF_2 set burst_time_ 1.204us
$exp_ON_OFF_2 set idle_time_ 0,999998796s
$exp_ON_OFF_2 set rate 15.5M

set exp_ON_OFF_3 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_3 attach-agent fuente3
$exp_ON_OFF_3 set packet_size_ 1505*8                     ;# para la
fuente3
$exp_ON_OFF_3 set burst_time_ 1.204us
$exp_ON_OFF_3 set idle_time_ 0,999998796s
$exp_ON_OFF_3 set rate 15.5M

set exp_ON_OFF_4 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_4  attach-agent fuente4
$exp_ON_OFF_4 set packet_size_ 1505*8                     ;# para la
fuente4
$exp_ON_OFF_4 set burst_time_ 1.204us
$exp_ON_OFF_4 set idle_time_ 0,999998796s
$exp_ON_OFF_4 set rate 15.5M

set exp_ON_OFF_5 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_5 attach-agent fuente5
$exp_ON_OFF_5 set packet_size_ 1505*8                     ;# para la
fuente5
$exp_ON_OFF_5 set burst_time_ 1.204us
$exp_ON_OFF_5 set idle_time_ 0,999998796s
$exp_ON_OFF_5 set rate 15.5M

set exp_ON_OFF_6 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_6 attach-agent fuente6
$exp_ON_OFF_6 set packet_size_ 1505*8                     ;# para la
fuente6
$exp_ON_OFF_6 set burst_time_ 1.204us
$exp_ON_OFF_6 set idle_time_ 0,999998796s
$exp_ON_OFF_6 set rate 15.5M

set exp_ON_OFF_7 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_7 attach-agent fuente7
$exp_ON_OFF_7 set packet_size_ 1505*8                     ;# para la
fuente7
$exp_ON_OFF_7 set burst_time_ 1.204us
$exp_ON_OFF_7 set idle_time_ 0,999998796s
$exp_ON_OFF_7 set rate 15.5M

set exp_ON_OFF_8 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_8 attach-agent fuente8
$exp_ON_OFF_8 set packet_size_ 1505*8                     ;# para la
fuente8
$exp_ON_OFF_8 set burst_time_ 1.204us
$exp_ON_OFF_8 set idle_time_ 0,999998796s
$exp_ON_OFF_8 set rate 15.5M

set exp_ON_OFF_9 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_9 attach-agent fuente9
$exp_ON_OFF_9 set packet_size_ 1505*8                     ;# para la
fuente9
$exp_ON_OFF_9 set burst_time_ 1.204us
$exp_ON_OFF_9 set idle_time_ 0,999998796s
$exp_ON_OFF_9 set rate 15.5M

set exp_ON_OFF_10 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_10 attach-agent fuente10
$exp_ON_OFF_10 set packet_size_ 1505*8                     ;# para la
fuente10
$exp_ON_OFF_10 set burst_time_ 1.204us
$exp_ON_OFF_10 set idle_time_ 0,999998796s
$exp_ON_OFF_10 set rate 15.5M

set exp_ON_OFF_11 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_11 attach-agent fuente11
$exp_ON_OFF_11 set packet_size_ 1505*8                     ;# para la
fuente11
$exp_ON_OFF_11 set burst_time_ 1.204us
$exp_ON_OFF_11 set idle_time_ 0,999998796s
$exp_ON_OFF_11 set rate 15.5M

set exp_ON_OFF_12 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_12 attach-agent fuente12
$exp_ON_OFF_12 set packet_size_ 1505*8                     ;# para la
fuente12
$exp_ON_OFF_12 set burst_time_ 1.204us
$exp_ON_OFF_12 set idle_time_ 0,999998796s
$exp_ON_OFF_12 set rate 15.5M

set exp_ON_OFF_13 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_13 attach-agent fuente13
$exp_ON_OFF_13 set packet_size_ 1505*8                     ;# para la
fuente13
$exp_ON_OFF_13 set burst_time_ 1.204us
$exp_ON_OFF_13 set idle_time_ 0,999998796s
$exp_ON_OFF_13 set rate 15.5M

set exp_ON_OFF_14 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_14 attach-agent fuente14
$exp_ON_OFF_14 set packet_size_ 1505*8                     ;# para la
fuente14
$exp_ON_OFF_14 set burst_time_ 1.204us
$exp_ON_OFF_14 set idle_time_ 0,999998796s
$exp_ON_OFF_14 set rate 15.5M

set exp_ON_OFF_15 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_15 attach-agent fuente15
$exp_ON_OFF_15 set packet_size_ 1505*8                     ;# para la
fuente15
$exp_ON_OFF_15 set burst_time_ 1.204us
$exp_ON_OFF_15 set idle_time_ 0,999998796s
$exp_ON_OFF_15 set rate 15.5M

set exp_ON_OFF_16 [new Application/Traffic/Exponential]    ;# generador
exponencial lambda = 0.1
$exp_ON_OFF_16 attach-agent fuente16
$exp_ON_OFF_16 set packet_size_ 1505*8                     ;# para la
fuente16
$exp_ON_OFF_16 set burst_time_ 1.204us
$exp_ON_OFF_16 set idle_time_ 0,999998796s
$exp_ON_OFF_16 set rate 15.5M

$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 attach-agent $pozo $null0



$ns at 5.0 "termina"  ;# la simulac�on se para despues 5 segundos
llamando el procedimiento termina
proc termina {} ;# Procedimiento che se ejecuta para acabar la
simulac�on
    {
     global ns f nf
     $ns flush-trace
     close $f
     close $nf

     puts "Ejecutando nam..."
     exec nam out.nam &
     exit(0)
    }
$ns run



ERROR SIMULATOR :

invalid command name "fuente1"
    while executing
"$n1 id"
    (procedure "_o3" line 3)
    (Simulator simplex-link line 3)
    invoked from within
"$ns simplex-link fuente1 switch 10000Mb 1ms DropTail     "
    (file "fifo_16_7_99.tcl" line 36)