[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem to simulation...
Hi to everybody.....,
I would like to know how I have to do for connect more exponential
generators to a node (switcher in my case) without being forced to use
an agent of protocol but using a simple connection without delays but
with bandwidth.
Waiting for one answer I thank you
Vincenzo Mazzotta
([email protected])
The script that I have written is the following:
set ns [new Simulator]
puts "Creation nam files..."
set f [open out.tr w]
$ns trace-all $f
set nf [open out.nam w]
$ns namtrace-all $nf
puts "Generacion of the red topology..."
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 switcher [$ns node] ;# Switcher Node
set pozo [new Agent/Null] ;# Sink Node
set null0 [new Agent/Null]
$ns attach-agent $pozo $null0
;# Nodes Links
$ns simplex-link fuente1 switcher 10000Mb 1us ;# source1 --------\
$ns simplex-link fuente2 switcher 10000Mb 1us ;# source2
---------\\
$ns simplex-link fuente3 switcher 10000Mb 1us ;# ...
----------\\\
$ns simplex-link fuente4 switcher 10000Mb 1us ;# ...
-----------\\\\
$ns simplex-link fuente5 switcher 10000Mb 1us ;# ...
------------\\\\\
$ns simplex-link fuente6 switcher 10000Mb 1us ;# ...
-------------\\\\\\
$ns simplex-link fuente7 switcher 10000Mb 1us ;# ...
--------------\\\\\\\
;# --------------
$ns simplex-link fuente8 switcher 10000Mb 1us ;# ...
----------->| switcher |
$ns simplex-link fuente9 switcher 10000Mb 1us ;# ...
----------->| + |--------> sink
;# | FIFO queue|
;# --------------
$ns simplex-link fuente10 switcher 10000Mb 1us ;# ...
------------///////
$ns simplex-link fuente11 switcher 10000Mb 1us ;# ...
-----------//////
$ns simplex-link fuente12 switcher 10000Mb 1us ;# ...
----------/////
$ns simplex-link fuente13 switcher 10000Mb 1us ;# ...
---------////
$ns simplex-link fuente14 switcher 10000Mb 1us ;# ...
--------///
$ns simplex-link fuente15 switcher 10000Mb 1us ;# source 15
-------//
$ns simplex-link fuente16 switcher 10000Mb 1us ;# source 16 -------/
$ns simplex-link switcher pozo 10000Mb 1us DropTail
;# Max packet number in the switcher queue
$ns queue-limit switcher pozo 50
set exp_ON_OFF_1 [New Application/Traffic/Exponential] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_1 attach-agent fuente1
$exp_ON_OFF_1 set packet_size_ 1505*8 ;# for source1
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_2 attach-agent fuente2
$exp_ON_OFF_2 set packet_size_ 1505*8 ;# for source2
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_3 attach-agent fuente3
$exp_ON_OFF_3 set packet_size_ 1505*8 ;# for source3
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_4 attach-agent fuente4
$exp_ON_OFF_4 set packet_size_ 1505*8 ;# for source4
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_5 attach-agent fuente5
$exp_ON_OFF_5 set packet_size_ 1505*8 ;# for source5
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_6 attach-agent fuente6
$exp_ON_OFF_6 set packet_size_ 1505*8 ;# for source6
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_7 attach-agent fuente7
$exp_ON_OFF_7 set packet_size_ 1505*8 ;# for source7
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_8 attach-agent fuente8
$exp_ON_OFF_8 set packet_size_ 1505*8 ;# for source8
$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] ;# exponential
generator lambda = 0.1
$exp_ON_OFF_9 attach-agent fuente9
$exp_ON_OFF_9 set packet_size_ 1505*8 ;# for source9
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_10 attach-agent fuente10
$exp_ON_OFF_10 set packet_size_ 1505*8 ;# for
source10
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_11 attach-agent fuente11
$exp_ON_OFF_11 set packet_size_ 1505*8 ;# for
source11
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_12 attach-agent fuente12
$exp_ON_OFF_12 set packet_size_ 1505*8 ;# for
source12
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_13 attach-agent fuente13
$exp_ON_OFF_13 set packet_size_ 1505*8 ;# for
source13
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_14 attach-agent fuente14
$exp_ON_OFF_14 set packet_size_ 1505*8 ;# for
source14
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_15 attach-agent fuente15
$exp_ON_OFF_15 set packet_size_ 1505*8 ;# for
source15
$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] ;#
exponential generator lambda = 0.1
$exp_ON_OFF_16 attach-agent fuente16
$exp_ON_OFF_16 set packet_size_ 1505*8 ;# for
source16
$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 5.0 "termina" ;# the simulation runs for 5 seconds
proc termina {} ;# Procedure to end the simulation
{
global ns f nf
$ns flush-trace
close $f
close $nf
puts "Executing nam..."
exec nam out.nam &
exit(0)
}
$ns run