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

Re: how to use xgraph for packet no. Vs time




I still can't understand your problem very well, but anyway here you have
the record procedure I use to plot the packet's seq. no. vs time and some
other variables in my scripts:

(ttcp0 is a tahoe TCP source)

------------------------------------------

# Record procedure
proc record {} {
         global ns ttcp0 qmon trace_cwnd trace_qsize trace_seqn 
         
         #Set the time after which the procedure should be called again
         set time 0.1
         
         #Get the variables of interest
         set curr_seqn [$ttcp0 set t_seqno_]
         set curr_qsize [$qmon set size_]
         set curr_cwnd [$ttcp0 set cwnd_]

         #Get the current time
         set now [$ns now]
         #Write the variables of interest vs. time
         puts $trace_seqn "$now $curr_seqn"
         puts $trace_qsize "$now $curr_qsize"
         puts $trace_cwnd "$now $curr_cwnd"
         #Re-schedule the procedure
         $ns at [expr $now+$time] "record"
}



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


On Thu, 22 Jul 1999, Rajesh Khetan wrote:

> Hi Imad AAD,
> 
> Thanks for ur reply. However, what typr of Agent is sink in ur code.
> 
> My problem is: 
> 
> I need to check TCP packets for a particular flow & if I use  a
> LossMonitor, TCPSink at the sender does not work & I get no throughput..
> 
> Please advice me on this.
> 
> thanks
> 
> bye
> 
> rajesh
> 
> On Thu, 22 Jul 1999, Imad AAD wrote:
> 
> > Rajesh Khetan wrote:
> > 
> > > Hi,
> > >
> > > I would really appreciate if somebody could tell me how to use xGraph for
> > > packet No. Vs time Plotting.
> > >
> > > Thank you very much
> > >
> > > rajesh
> > >
> > 
> > In your .tcl file do this:
> > 
> > proc record {} {
> >     global sink f0
> >     set ns2 [Simulator instance]
> >     set time 0.01
> >     set bytrec [expr [$sink set bytes_]/1000]
> >     set now [$ns2 now]
> >     puts $f0 "$now $bytrec"
> >     $sink set bytes_ 0
> >     $ns2 at [expr $now+$time] "record"
> > }
> > 
> > then run xgraph with the file represented by $f0
> > 
> > Good luck
> > 
> > 
> 
> --------------------------------------------------------------------------
> Rajesh Khetan
> University of Southern California
> 1194 W 30th Street, Apt.# 1
> LA, CA - 90007                      	Tel : (323) 737 3035
> --------------------------------------------------------------------------
> 
>