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

Re: [Q] Error on FTP flow




I have a good new for you. And a bad one.

The good one is that you can solve the problem you have simply changing
the lines:

----
TraceApp traceapp
traceapp attach-agent $sink1
----

to

----
set traceapp [ new TraceApp ]
$traceapp attach-agent $sink1
----

Now, it should work. The bad new is that the bytes_ variable inside
traceapp is not recording anything, at least in the examples I have
tested... 

Any idea? (I hope any NS guru is reading this ;-)


/FCD

----------------------------------------------------------------------
Fernando Cela
email: [email protected]                     phone: +46 31 772 1709


On Thu, 29 Jul 1999, HoKun Chung wrote:

> 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.
> http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9904/0200.html
> http://www-mash.cs.berkeley.edu/dist/archive/ns-users/9904/0116.html
>  
> 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....
>