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

[ns] Expoo Traffic



Hello !

I'd like to understand something with an expoo traffic. It's said
that we have a burst time and an idle time. If I'm not wrong, it
means that during the burst time we determine, the expoo traffic
generates something; and during the idle time, we have nothing.

In my script (below) I put 'burst-time = 3s" and "idle-time = 1s". In
my trace-file, I don't obtain a burst-time of 3 s but of 12 s. Can
you explain me why, and where is my mistake ?
(the script below works, so you can try it to see what we obtain
after xgraph execution"

Thanks for your precious help, and have a nice day !

Sincerely
Leyla

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

set zini [open out0.tr w]
set zini1 [open out1.tr w]
$ns trace-all $zini1


set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

set rnd [new RNG]
$rnd seed 0


$ns duplex-link $n0 $n2 1000Kb 20ms DropTail
$ns duplex-link $n1 $n2 1000Kb 20ms DropTail
$ns duplex-link $n2 $n3 1000Kb 20ms DropTail
$ns duplex-link $n3 $n2 1000Kb 20ms DropTail

Queue set limit_ 10
set null0 [new Agent/LossMonitor]
$ns attach-agent $n2 $null0

set source [new Agent/CBR/UDP]
$ns attach-agent $n0 $source
set expoo [new Traffic/Expoo]
$expoo attach-agent $source
$expoo set burst-time 3s
$expoo set idle-time 1s
$expoo set packet-size 256
$expoo set rate 100k
#$expoo set shape 1.5

$ns connect $source $null0

proc record {} {
	global null0 zini
	set ns [Simulator instance]
	set time 0.1
	set bw0 [$null0 set npkts_]
	set now [$ns now]
	puts $zini "$now [expr $bw0]"
	$null0 set npkts_ 0
	$ns at [expr $now+$time] "record"
}

proc finish {} {
	global zini
	close $zini
	exec xgraph -bb -m -y nb(pkts/bytes) -x time out0.tr -geometry 1000x500 &
        exit 0
}


$ns at 0.0 "$expoo start"
$ns at 30.0 "$expoo stop"

$ns at 0.0 "record"
$ns at 30.0 "finish"

$ns run