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

[Q] Error on FTP flow



Dear sir.
 
I am a graduate student in korea.
I want  to get the sender/receiver's throughtput for the FTP application
over TCP agent, without trace file.
 
Luckily, I found the source.
 
but, I have a some problem. It occurs error. error message is
 
    can't read "traceapp" : no such variable
    while executing "$ns at 0.1 "$traceapp start"
 
I can't solve this problem... Please, help me..
 
It is partical code for getting the throuthput of FTP.
-----------------------------------------------------------------------------------------------------
......
set n0 [$ns node]
set n1 [$ns node]
......
set tcp0 [new Agent/TCP]
$ns attach-agent $n0 $tcp0
 
Class TraceApp  -superclass Application    # subclass created....
 
TraceApp instproc init {args} {
 $self set bytes_ 0
 eval $self next $args
}
 
TraceApp instproc recv {byte} {
 $self instvar bytes_
 set bytes_ [expr $bytes_ + $byte]
 return $bytes_
}
 
set sink1 [new Agent/TCPSink]
TraceApp traceapp
traceapp attach-agent $sink1
$ns attach-agent $n1 $sink1
 
set ftp0 [new Application/FTP] 
$ftp0 attach-agent $tcp0
 
$ns connect $tcp0 $sink1
 
$ns at 0.1 "$traceapp start"                # error occurs .... ------------------
$ns at 0.2 "$ftp0 start"
$ns at 1.0 "$ftp0 stop"
#puts "Traffic volumn = [$traceapp set bytes_]"
$ns at 1.1 "finish"
...
 
Please, Help me....