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

[ns] TFRC problem



Hello,

We more or less successfully transferred the ns TFRC code to real life (as
part of an adaptive multimedia app). Now that it should work, we stumbled
upon a problem with the original simulator code (and, thus, our converted
one   :(   ) ...

Please take a look at the attached tcl file (I am copying the code into the
body of this message as well); if you look at the generated file "out.tr",
you will notice that TFRC fails to increase its rate after a certain period
of loss.

We used the code included in the 2.1b7 release of ns.

Please help!

Best regards,
Michael Welzl


------------------------------------------------------------------------
copied tcl code:


#Create a simulator object
set ns [new Simulator]

#Open the nam trace file
set nf [open out.nam w]
#$ns namtrace-all $nf

#Open the output files
set f [open out.tr w]

#Define a 'finish' procedure
proc finish {} {
        global ns nf f
        $ns flush-trace
	#Close the trace files
        close $nf
        close $f
	#Execute nam on the trace file
#        exec nam out.nam &
        exit 0
}

set oldtraffic 0
proc record {} {

        global f tfrc0 ns oldtraffic

	set now [$ns now]
        puts $f "$now [expr [$tfrc0 set ndatapack_]-$oldtraffic]"
	set oldtraffic [$tfrc0 set ndatapack_]

        $ns at [expr $now + 0.1] "record"
}


# Insert your own code for topology creation
# and agent definitions, etc. here

# Topologie:

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

$ns duplex-link $n0 $n1 1Mb 10ms DropTail

# Agent:

set tfrc0 [new Agent/TFRC]
$ns attach-agent $n0 $tfrc0

set tfrcsink0 [new Agent/TFRCSink]
$ns attach-agent $n1 $tfrcsink0

$ns connect $tfrc0 $tfrcsink0




#schedule events
$ns at 0.0 "record"

$ns at 0.5 "$tfrc0 start"

$ns rtmodel-at 8.0 down $n0 $n1
$ns rtmodel-at 9.0 up $n0 $n1
# no problem for 8.0 - 8.5 ... but 1 sec seems to long for TFRC

$ns at 54.5 "$tfrc0 stop"

$ns at 55.0 "finish"

#Run the simulation
$ns run

tfrc-test.tcl