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

[ns] Traceapp question



Hi 

I also have a question for which I need an immediate answer. I am using the


traceapp class in the code to determine the throughput of the TCP session.
Actually I don't know what is happening! PELASE HELP. Here is the code. I
would like it if someone can explain what happens with this code...Also..do


I have to do anythign extra to get the throughput? I have very little
experience with NS and would appreciate the help. And where willt he output

be displayed?

 Class TraceApp -superclass Application

						     TraceApp instproc init


args} {
							     $self set
bytes_ 0
							     $self set
totbytes_ 0
							     eval $self
next $args
						     }

						     TraceApp instproc recv


{byte} {
							     $self instvar
bytes_
							     $self instvar
totbytes_
							     set bytes_
[expr $bytes_ + $byte]
							     set totbytes_
[expr $totbytes_ + $byte]
							     return
$totbytes_
						     }


						     #Define a 'finish'
procedure
						     proc finish {sim_time
bw} {
							     global ns nf
qmon tf traceapp
							     $ns
flush-trace
							     #puts "[expr
8.0*[$qmon set bdepartures_]/$sim_time/$bw]"
							     puts "[expr
8.0*[$traceapp set bytes_]/$sim_time/$bw]"

Thank You.
Vishnu.