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

[ns] Programming problem



Hi all

I am having a programming problem wasting my time. Could some one help
?.

The program I am writing is to simulate the aggregation of "N = 100"
homogeneous On-Off Sources into one equivalent On-Off Source. Each
source has On time of 0.35 second and Off time of .65 second in a source
period of 1 second at a rate of 167 packets per second. I modified
example4.tcl of the ns example included in the ns-allinone package
please find attached (I hope it is readable).

The basics is I take a record at 0.01 second steps and plot in "f0".
Compare whether the calculated rate is above link bandwidth in packets
per second. If so then put it as Ron else it is Roff. Then average out
for the total time in the on state and the total time in the off state
up to one source period. The average is the aggregate rate to plot in
"f1".

The problem is I cannot plot the "f1".  If  I put the puts statement
outside the if loop in the program I get zero for the "f1" and inside
the if loop I get the error: " problem with input data".

I would appreciate help, suggestions or clues. Thank you.



OnOffSrc4.tcl