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

[ns] Random flows



Hi all !
I have a problem to simulate a network. I would like to simulate a network
with TCP/FTP and RTP or UDP flows, but the constraint i have is that I HAVE
TO simulate non-deterministic flows : with that, I mean that I want to have
flows which can start at random times, finish at random times, and which
have random parameters ( different number of packets  for two TCP/FTP
sources, different max_pkts, etc...)  I've seen that we can have heuristic
flows, but I don't know how to use that.
For example, in the following code, HOWand WHERE can I specify the heuristic
behavior ?

I REALLY NEED YOUR HELP !!! THANKS A LOT IN ADVANCE ....WISHING YOU BEST
TIMES !
Sincerely,
Leyla

**************************************
set ns [new Simulator]

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n6 [$ns node]

Queue set limit_ 5

$ns duplex-link $n0 $n2 10Mb 20ms DropTail
$ns duplex-link $n1 $n2 10Mb 20ms DropTail
$ns duplex-link $n6 $n2 10Mb 20ms DropTail

$ns duplex-link $n2 $n3 1Mb 70ms RED
$ns duplex-link $n3 $n2 1Mb 70ms RED

$ns duplex-link $n3 $n4 10Mb 20ms DropTail
$ns duplex-link $n3 $n5 10Mb 20ms DropTail

set udp0 [new Agent/RTP]
$ns attach-agent $n0 $udp0
$udp0 set classe 1
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
set null0 [new Agent/Null]
$ns attach-agent $n4 $null0
$ns connect $udp0 $null0
$ns at 0.0 "$cbr0 start"


set tcp0 [new Agent/TCP]
set sink [new Agent/TCPSink]
$ns attach-agent $n1 $tcp0
$ns attach-agent $n5 $sink
$tcp0 set classe 2
$ns connect $tcp0 $sink
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
$ns at 0.0 "$ftp0 start"

set tcp1 [new Agent/TCP]
$ns attach-agent $n6 $tcp1
$tcp1 set classe 3
$ns connect $tcp1 $sink
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
$ns at 0.0 "$ftp1 start"

$ns at 5.0 "finish"