Flow Class Reference

#include <flowmon.h>

Inheritance diagram for Flow:

EDQueueMonitor QueueMonitor TclObject RedPDFlow TaggerTBFlow TaggerTSWFlow Collaboration diagram for Flow:

Collaboration graph
[legend]

Detailed Description

Definition at line 53 of file flowmon.h.

Public Member Functions

int barrivals () const
int bdepartures () const
int bdrops () const
virtual int command (int argc, const char *const *argv)
virtual void drop (Packet *)
nsaddr_t dst () const
int ebdrops () const
void edrop (Packet *p)
int epdrops () const
double first_pkt () const
 Flow ()
int flowid () const
virtual void in (Packet *)
int mon_ebdrops () const
void mon_edrop (Packet *p)
int mon_epdrops () const
virtual void out (Packet *)
int parrivals () const
int pdepartures () const
int pdrops () const
int pkts () const
int pmarks () const
void printRTTs ()
void printSeqnos ()
void printStats ()
packet_t ptype () const
int qs_bytes () const
int qs_drops () const
int qs_pkts () const
void setfields (Packet *p)
int size () const
nsaddr_t src () const
virtual void tagging (Packet *)

Data Fields

int estimate_rate_
double estRate_
double k_
double prevTime_
double startTime_

Protected Member Functions

void estimateRate (Packet *p)
void keepRTTstats (Packet *p)
void keepSeqnoStats (Packet *p)

Protected Attributes

int barrivals_
int bdepartures_
int bdrops_
int binsPerSec_
IntegratorbytesInt_
Tcl_Channel channel1_
Tcl_Channel channel_
SamplesdelaySamp_
nsaddr_t dst_
int dstId_
int ebdrops_
int epdrops_
int fid_
double first_pkt_
int keepRTTstats_
int keepSeqnoStats_
double last_pkt_
int maxRTT_
int maxSeqno_
int mon_ebdrops_
int mon_epdrops_
int numRTTs_
int numSeqnos_
int parrivals_
int pdepartures_
int pdrops_
int pkts_
IntegratorpktsInt_
int pmarks_
int qs_bytes_
int qs_drops_
int qs_pkts_
int * RTTbins_
int * SeqnoBins_
int SeqnoBinSize_
int size_
nsaddr_t src_
int srcId_
int temp_size_
packet_t type_


Constructor & Destructor Documentation

Flow::Flow  )  [inline]
 

Definition at line 55 of file flowmon.h.

References dst_, fid_, and src_.

00055            : src_(-1), dst_(-1), fid_(-1), type_(PT_NTYPE) {  
00056 
00057         bind("src_", (int *) &src_);
00058         bind("dst_", (int *) &dst_);
00059         bind("flowid_", (int *) &fid_);
00060     }


Member Function Documentation

int QueueMonitor::barrivals  )  const [inline, inherited]
 

Definition at line 110 of file queue-monitor.h.

References QueueMonitor::barrivals_.

Referenced by FlowMon::fformat(), Tagger::fformat(), and PushbackQueue::timeout().

00110 { return (barrivals_); }

int QueueMonitor::bdepartures  )  const [inline, inherited]
 

Definition at line 112 of file queue-monitor.h.

References QueueMonitor::bdepartures_.

Referenced by PushbackQueue::timeout().

00112 { return (bdepartures_); }

int QueueMonitor::bdrops  )  const [inline, inherited]
 

Definition at line 116 of file queue-monitor.h.

References QueueMonitor::bdrops_.

Referenced by FlowMon::fformat(), Tagger::fformat(), and PushbackQueue::timeout().

00116 { return (bdrops_); }

int QueueMonitor::command int  argc,
const char *const *  argv
[virtual, inherited]
 

Reimplemented in Tagger, FlowMon, and QueueMonitorCompat.

Definition at line 44 of file queue-monitor.cc.

References QueueMonitor::bytesInt_, QueueMonitor::channel1_, QueueMonitor::channel_, QueueMonitor::delaySamp_, QueueMonitor::dstId_, QueueMonitor::keepRTTstats_, QueueMonitor::keepSeqnoStats_, QueueMonitor::pktsInt_, QueueMonitor::printRTTs(), QueueMonitor::printSeqnos(), and QueueMonitor::srcId_.

Referenced by QueueMonitorCompat::command(), FlowMon::command(), and Tagger::command().

00045 {
00046     Tcl& tcl = Tcl::instance();
00047 
00048     if (argc == 2) {
00049         if (strcmp(argv[1], "get-bytes-integrator") == 0) {
00050             if (bytesInt_)
00051                 tcl.resultf("%s", bytesInt_->name());
00052             else
00053                 tcl.resultf("");
00054             return (TCL_OK);
00055         }
00056         if (strcmp(argv[1], "get-pkts-integrator") == 0) {
00057             if (pktsInt_)
00058                 tcl.resultf("%s", pktsInt_->name());
00059             else
00060                 tcl.resultf("");
00061             return (TCL_OK);
00062         }
00063         if (strcmp(argv[1], "get-delay-samples") == 0) {
00064             if (delaySamp_)
00065                 tcl.resultf("%s", delaySamp_->name());
00066             else
00067                 tcl.resultf("");
00068             return (TCL_OK);
00069         }
00070         if (strcmp(argv[1], "printRTTs") == 0) {
00071             if (keepRTTstats_ && channel1_) {
00072                 printRTTs();
00073             } 
00074             return (TCL_OK);
00075         }
00076         if (strcmp(argv[1], "printSeqnos") == 0) {
00077             if (keepSeqnoStats_ && channel1_) {
00078                 printSeqnos();
00079             } 
00080             return (TCL_OK);
00081         }
00082     }
00083 
00084     if (argc == 3) {
00085         if (strcmp(argv[1], "set-bytes-integrator") == 0) {
00086             bytesInt_ = (Integrator *)
00087                 TclObject::lookup(argv[2]);
00088             if (bytesInt_ == NULL)
00089                 return (TCL_ERROR);
00090             return (TCL_OK);
00091         }
00092         if (strcmp(argv[1], "set-pkts-integrator") == 0) {
00093             pktsInt_ = (Integrator *)
00094                 TclObject::lookup(argv[2]);
00095             if (pktsInt_ == NULL)
00096                 return (TCL_ERROR);
00097             return (TCL_OK);
00098         }
00099         if (strcmp(argv[1], "set-delay-samples") == 0) {
00100             delaySamp_ = (Samples*)
00101                 TclObject::lookup(argv[2]);
00102             if (delaySamp_ == NULL)
00103                 return (TCL_ERROR);
00104             return (TCL_OK);
00105         }
00106         if (strcmp(argv[1], "trace") == 0) {
00107             // for printStats
00108             int mode;
00109             const char* id = argv[2];
00110             channel_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode);
00111                         if (channel_ == 0) {
00112                 tcl.resultf("trace: can't attach %s for writing", id);
00113                 return (TCL_ERROR);
00114             }
00115             return (TCL_OK);
00116         }
00117         if (strcmp(argv[1], "traceDist") == 0) {
00118             // for printRTTs and printSeqnos distributions
00119             int mode;
00120             const char* id = argv[2];
00121             channel1_ = Tcl_GetChannel(tcl.interp(), (char*)id, &mode);
00122                         if (channel1_ == 0) {
00123                 tcl.resultf("trace: can't attach %s for writing", id);
00124                 return (TCL_ERROR);
00125             }
00126             return (TCL_OK);
00127         }
00128     }
00129     if (argc == 4) {
00130         if (strcmp(argv[1], "set-src-dst") == 0) {
00131             srcId_ = atoi(argv[2]);
00132             dstId_ = atoi(argv[3]);
00133             return (TCL_OK);
00134         }
00135     }
00136     return TclObject::command(argc, argv);  // else control reaches end of
00137                         // non-void function, see? :-)
00138 }

Here is the call graph for this function:

void QueueMonitor::drop Packet  )  [virtual, inherited]
 

Reimplemented in FlowMon, and QueueMonitorCompat.

Definition at line 293 of file queue-monitor.cc.

References hdr_flags::access(), hdr_cmn::access(), QueueMonitor::bdrops_, QueueMonitor::bytesInt_, QueueMonitor::channel_, Scheduler::clock(), Scheduler::instance(), Integrator::newPoint(), QueueMonitor::pdrops_, QueueMonitor::pktsInt_, QueueMonitor::printStats(), hdr_flags::qs(), QueueMonitor::qs_drops_, and hdr_cmn::size().

Referenced by QueueMonitorCompat::drop(), FlowMon::drop(), EDQueueMonitor::edrop(), EDQueueMonitor::mon_edrop(), and SnoopQueueDrop::recv().

00294 {
00295     hdr_cmn* hdr = hdr_cmn::access(p);
00296     double now = Scheduler::instance().clock();
00297     int pktsz = hdr->size();
00298     hdr_flags* pf = hdr_flags::access(p);
00299 
00300     size_ -= pktsz;
00301     pkts_--;
00302     bdrops_ += pktsz;
00303     pdrops_++;
00304 
00305     if (pf->qs())
00306         qs_drops_++;
00307 
00308     if (bytesInt_)
00309         bytesInt_->newPoint(now, double(size_));
00310     if (pktsInt_)
00311         pktsInt_->newPoint(now, double(pkts_));
00312     if (channel_)
00313         printStats();
00314 }

Here is the call graph for this function:

nsaddr_t Flow::dst  )  const [inline]
 

Definition at line 62 of file flowmon.h.

References dst_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00062 { return (dst_); }

int EDQueueMonitor::ebdrops  )  const [inline, inherited]
 

Definition at line 288 of file queue-monitor.h.

References EDQueueMonitor::ebdrops_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00288 { return (ebdrops_); }

void EDQueueMonitor::edrop Packet p  )  [inline, virtual, inherited]
 

Reimplemented from QueueMonitor.

Reimplemented in FlowMon.

Definition at line 270 of file queue-monitor.h.

References hdr_cmn::access(), QueueMonitor::drop(), EDQueueMonitor::ebdrops_, EDQueueMonitor::epdrops_, and hdr_cmn::size().

Referenced by FlowMon::edrop().

00270                           {
00271         hdr_cmn* hdr = hdr_cmn::access(p);
00272         ebdrops_ += hdr->size();
00273         epdrops_++;
00274         // remove later - ratul
00275         // printf("My epdrops = %d\n",epdrops_);
00276         QueueMonitor::drop(p);
00277     }

Here is the call graph for this function:

int EDQueueMonitor::epdrops  )  const [inline, inherited]
 

Definition at line 287 of file queue-monitor.h.

References EDQueueMonitor::epdrops_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00287 { return (epdrops_); }

void QueueMonitor::estimateRate Packet p  )  [protected, inherited]
 

Definition at line 317 of file queue-monitor.cc.

References hdr_cmn::access(), Scheduler::clock(), QueueMonitor::estRate_, Scheduler::instance(), QueueMonitor::k_, QueueMonitor::prevTime_, hdr_cmn::size(), and QueueMonitor::temp_size_.

00317                                            {
00318     
00319     hdr_cmn* hdr  = hdr_cmn::access(pkt);
00320     int pktSize   = hdr->size() << 3; /* length of the packet in bits */
00321 
00322     double now = Scheduler::instance().clock();
00323     double timeGap = ( now - prevTime_);
00324 
00325     if (timeGap == 0) {
00326         temp_size_ += pktSize;
00327         return;
00328     }
00329     else {
00330         pktSize+= temp_size_;
00331         temp_size_ = 0;
00332     }
00333     
00334     prevTime_ = now;
00335     
00336     estRate_ = (1 - exp(-timeGap/k_))*((double)pktSize)/timeGap + exp(-timeGap/k_)*estRate_;
00337 }

Here is the call graph for this function:

double QueueMonitor::first_pkt  )  const [inline, inherited]
 

Definition at line 122 of file queue-monitor.h.

References QueueMonitor::first_pkt_.

00122 { return (first_pkt_); }

int Flow::flowid  )  const [inline]
 

Definition at line 63 of file flowmon.h.

References fid_.

Referenced by RedPDQueue::command(), FlowMon::fformat(), and Tagger::fformat().

00063 { return (fid_); }

void QueueMonitor::in Packet  )  [virtual, inherited]
 

Reimplemented in Tagger, FlowMon, and QueueMonitorCompat.

Definition at line 223 of file queue-monitor.cc.

References hdr_flags::access(), hdr_cmn::access(), Scheduler::clock(), QueueMonitor::first_pkt_, Scheduler::instance(), QueueMonitor::last_pkt_, QueueMonitor::parrivals_, hdr_flags::qs(), QueueMonitor::qs_bytes_, QueueMonitor::qs_pkts_, and hdr_cmn::size().

Referenced by QueueMonitorCompat::in(), FlowMon::in(), Tagger::in(), SnoopQueueTagger::recv(), and SnoopQueueIn::recv().

00224 {
00225     hdr_cmn* hdr = hdr_cmn::access(p);
00226     double now = Scheduler::instance().clock();
00227     int pktsz = hdr->size();
00228     hdr_flags* pf = hdr_flags::access(p);
00229 
00230     last_pkt_ = Scheduler::instance().clock();
00231     if (parrivals_ == 0) {
00232         first_pkt_ = last_pkt_;
00233     }
00234 
00235     if (pf->qs()) {
00236         qs_pkts_++;
00237         qs_bytes_ += pktsz;
00238     }
00239 
00240         //if enabled estimate rate now
00241     if (estimate_rate_) {
00242         estimateRate(p);
00243     }
00244     else {
00245         prevTime_ = now;
00246     }
00247 
00248     barrivals_ += pktsz;
00249     parrivals_++;
00250     size_ += pktsz;
00251     pkts_++;
00252     if (bytesInt_)
00253         bytesInt_->newPoint(now, double(size_));
00254     if (pktsInt_)
00255         pktsInt_->newPoint(now, double(pkts_));
00256     if (delaySamp_)
00257         hdr->timestamp() = now;
00258     if (channel_)
00259         printStats();
00260 
00261 }

Here is the call graph for this function:

void QueueMonitor::keepRTTstats Packet p  )  [protected, inherited]
 

Definition at line 340 of file queue-monitor.cc.

References hdr_tcp::access(), hdr_cmn::access(), QueueMonitor::binsPerSec_, hdr_tcp::last_rtt(), QueueMonitor::maxRTT_, QueueMonitor::numRTTs_, PT_FTP, PT_HTTP, PT_TCP, PT_TELNET, hdr_cmn::ptype(), and QueueMonitor::RTTbins_.

Referenced by QueueMonitor::out().

00340                                            {
00341         int i, j, topBin, rttInMs, MsPerBin;
00342     hdr_cmn* hdr  = hdr_cmn::access(pkt);
00343     packet_t t = hdr->ptype();
00344     if (t == PT_TCP || t == PT_HTTP || t == PT_FTP || t == PT_TELNET) {
00345         hdr_tcp *tcph = hdr_tcp::access(pkt);
00346         rttInMs = tcph->last_rtt(); 
00347         if (rttInMs < 0) rttInMs = 0;
00348         topBin = maxRTT_ * binsPerSec_;
00349         if (numRTTs_ == 0) {
00350             RTTbins_ = (int *)malloc(sizeof(int)*topBin);
00351             for (i = 0; i < topBin; i++) {
00352                 RTTbins_[i] = 0;
00353             }
00354         }
00355         MsPerBin = int(1000/binsPerSec_);
00356         j = (int)(rttInMs/MsPerBin);
00357         if (j < 0) j = 0;
00358         if (j >= topBin) j = topBin - 1;
00359         ++ RTTbins_[j];
00360         ++ numRTTs_;
00361     }
00362 }

Here is the call graph for this function:

void QueueMonitor::keepSeqnoStats Packet p  )  [protected, inherited]
 

Definition at line 365 of file queue-monitor.cc.

References hdr_tcp::access(), hdr_cmn::access(), QueueMonitor::maxSeqno_, QueueMonitor::numSeqnos_, PT_FTP, PT_HTTP, PT_TCP, PT_TELNET, hdr_cmn::ptype(), hdr_tcp::seqno(), QueueMonitor::SeqnoBins_, and QueueMonitor::SeqnoBinSize_.

Referenced by QueueMonitor::out().

00365                                              {
00366         int i, j, topBin, seqno; 
00367     hdr_cmn* hdr  = hdr_cmn::access(pkt);
00368     packet_t t = hdr->ptype();
00369     if (t == PT_TCP || t == PT_HTTP || t == PT_FTP || t == PT_TELNET) {
00370         hdr_tcp *tcph = hdr_tcp::access(pkt);
00371         seqno = tcph->seqno(); 
00372         if (seqno < 0) seqno = 0;
00373         topBin = int(maxSeqno_ / SeqnoBinSize_);
00374         if (numSeqnos_ == 0) {
00375             SeqnoBins_ = (int *)malloc(sizeof(int)*topBin);
00376             for (i = 0; i < topBin; i++) {
00377                 SeqnoBins_[i] = 0;
00378             }
00379         }
00380         j = (int)(seqno/SeqnoBinSize_);
00381         if (j < 0) j = 0;
00382         if (j >= topBin) j = topBin - 1;
00383         ++ SeqnoBins_[j];
00384         ++ numSeqnos_;
00385     }
00386 }

Here is the call graph for this function:

int EDQueueMonitor::mon_ebdrops  )  const [inline, inherited]
 

Definition at line 290 of file queue-monitor.h.

References EDQueueMonitor::mon_ebdrops_.

Referenced by PushbackQueue::timeout().

00290 { return (mon_ebdrops_); }

void EDQueueMonitor::mon_edrop Packet p  )  [inline, inherited]
 

Reimplemented in FlowMon.

Definition at line 279 of file queue-monitor.h.

References hdr_cmn::access(), QueueMonitor::drop(), EDQueueMonitor::mon_ebdrops_, EDQueueMonitor::mon_epdrops_, and hdr_cmn::size().

Referenced by PushbackQueue::enque(), and FlowMon::mon_edrop().

00279                               {
00280         hdr_cmn* hdr = hdr_cmn::access(p);
00281         mon_ebdrops_ += hdr->size();
00282         mon_epdrops_++;
00283     
00284         QueueMonitor::drop(p);
00285     }

Here is the call graph for this function:

int EDQueueMonitor::mon_epdrops  )  const [inline, inherited]
 

Definition at line 289 of file queue-monitor.h.

References EDQueueMonitor::mon_epdrops_.

00289 { return (mon_epdrops_); }

void QueueMonitor::out Packet  )  [virtual, inherited]
 

Reimplemented in FlowMon, and QueueMonitorCompat.

Definition at line 263 of file queue-monitor.cc.

References hdr_flags::access(), hdr_cmn::access(), QueueMonitor::bdepartures_, QueueMonitor::bytesInt_, hdr_flags::ce(), QueueMonitor::channel_, Scheduler::clock(), QueueMonitor::delaySamp_, hdr_flags::ect(), Scheduler::instance(), QueueMonitor::keepRTTstats(), QueueMonitor::keepRTTstats_, QueueMonitor::keepSeqnoStats(), QueueMonitor::keepSeqnoStats_, Samples::newPoint(), Integrator::newPoint(), QueueMonitor::pdepartures_, QueueMonitor::pktsInt_, QueueMonitor::pmarks_, QueueMonitor::printStats(), hdr_cmn::size(), and hdr_cmn::timestamp().

Referenced by QueueMonitorCompat::out(), FlowMon::out(), and SnoopQueueOut::recv().

00264 {
00265     hdr_cmn* hdr = hdr_cmn::access(p);
00266     hdr_flags* pf = hdr_flags::access(p);
00267     double now = Scheduler::instance().clock();
00268     int pktsz = hdr->size();
00269 
00270     if (pf->ce() && pf->ect()) 
00271         pmarks_++;
00272     size_ -= pktsz;
00273     pkts_--;
00274     bdepartures_ += pktsz;
00275     pdepartures_++;
00276     if (bytesInt_)
00277         bytesInt_->newPoint(now, double(size_));
00278     if (pktsInt_)
00279         pktsInt_->newPoint(now, double(pkts_));
00280     if (delaySamp_)
00281         delaySamp_->newPoint(now - hdr->timestamp());
00282 
00283         if (keepRTTstats_) {
00284         keepRTTstats(p);
00285     }
00286         if (keepSeqnoStats_) {
00287         keepSeqnoStats(p);
00288     }
00289     if (channel_)
00290         printStats();
00291 }

Here is the call graph for this function:

int QueueMonitor::parrivals  )  const [inline, inherited]
 

Definition at line 109 of file queue-monitor.h.

References QueueMonitor::parrivals_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00109 { return (parrivals_); }

int QueueMonitor::pdepartures  )  const [inline, inherited]
 

Definition at line 111 of file queue-monitor.h.

References QueueMonitor::pdepartures_.

00111 { return (pdepartures_); }

int QueueMonitor::pdrops  )  const [inline, inherited]
 

Definition at line 114 of file queue-monitor.h.

References QueueMonitor::pdrops_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00114 { return (pdrops_); }

int QueueMonitor::pkts  )  const [inline, inherited]
 

Definition at line 102 of file queue-monitor.h.

References QueueMonitor::pkts_.

Referenced by CBQClass::demand(), and CBQueue::toplevel_departure().

00102 { return (pkts_); }

int QueueMonitor::pmarks  )  const [inline, inherited]
 

Definition at line 115 of file queue-monitor.h.

References QueueMonitor::pmarks_.

Referenced by Tagger::fformat().

00115 { return (pmarks_); }

void QueueMonitor::printRTTs  )  [inherited]
 

Definition at line 150 of file queue-monitor.cc.

References QueueMonitor::binsPerSec_, QueueMonitor::channel1_, Scheduler::clock(), Scheduler::instance(), QueueMonitor::maxRTT_, QueueMonitor::numRTTs_, and QueueMonitor::RTTbins_.

Referenced by QueueMonitor::command().

00150                         {
00151     int i, n, topBin, MsPerBin;
00152     char wrk[500];
00153 
00154     topBin = maxRTT_ * binsPerSec_;
00155     MsPerBin = int(1000/binsPerSec_);
00156     double now = Scheduler::instance().clock();
00157     sprintf(wrk, "Distribution of RTTs, %d ms bins, time %4.2f\n", MsPerBin, now);
00158     n = strlen(wrk); wrk[n] = 0;
00159     (void)Tcl_Write(channel1_, wrk, n);
00160     for (i = 0; i < topBin; i++) {
00161         if (RTTbins_[i] > 0) {
00162             sprintf(wrk, "%d to %d ms: frac %5.3f num %d time %4.2f\n", 
00163               i*MsPerBin, (i+1)*MsPerBin, 
00164               (double)RTTbins_[i]/numRTTs_,
00165               RTTbins_[i], now); 
00166             n = strlen(wrk); wrk[n] = 0; 
00167             (void)Tcl_Write(channel1_, wrk, n);
00168         }
00169     }
00170     i = topBin - 1;
00171     if (RTTbins_[i] > 0) {
00172         sprintf(wrk, "The last bin might also contain RTTs >= %d ms.\n",
00173         (i+1)*MsPerBin);
00174         n = strlen(wrk); wrk[n] = 0;
00175         (void)Tcl_Write(channel1_, wrk, n);
00176     }
00177 }

Here is the call graph for this function:

void QueueMonitor::printSeqnos  )  [inherited]
 

Definition at line 180 of file queue-monitor.cc.

References QueueMonitor::channel1_, Scheduler::clock(), Scheduler::instance(), QueueMonitor::maxSeqno_, QueueMonitor::numSeqnos_, QueueMonitor::SeqnoBins_, and QueueMonitor::SeqnoBinSize_.

Referenced by QueueMonitor::command().

00180                           {
00181     int i, n, topBin; 
00182     char wrk[500];
00183 
00184     topBin = int(maxSeqno_ / SeqnoBinSize_);
00185     double now = Scheduler::instance().clock();
00186     sprintf(wrk, "Distribution of Seqnos, %d seqnos per bin, time %4.2f\n", 
00187        SeqnoBinSize_, now);
00188     n = strlen(wrk); wrk[n] = 0;
00189     (void)Tcl_Write(channel1_, wrk, n);
00190     for (i = 0; i < topBin; i++) {
00191         if (SeqnoBins_[i] > 0) {
00192             sprintf(wrk, "%d to %d seqnos: frac %5.3f num %d time %4.2f\n", 
00193               i*SeqnoBinSize_, (i+1)*SeqnoBinSize_ - 1, 
00194               (double)SeqnoBins_[i]/numSeqnos_,
00195               SeqnoBins_[i], now); 
00196             n = strlen(wrk); wrk[n] = 0;
00197             (void)Tcl_Write(channel1_, wrk, n);
00198         }
00199     }
00200     i = topBin - 1;
00201     if (SeqnoBins_[i] > 0) {
00202         sprintf(wrk, "The last bin might also contain Seqnos >= %d. \n",
00203         (i+1)*SeqnoBinSize_);
00204         n = strlen(wrk); wrk[n] = 0;
00205         (void)Tcl_Write(channel1_, wrk, n);
00206     }
00207 }

Here is the call graph for this function:

void QueueMonitor::printStats  )  [inherited]
 

Definition at line 210 of file queue-monitor.cc.

References QueueMonitor::channel_, Scheduler::clock(), QueueMonitor::dstId_, Scheduler::instance(), QueueMonitor::pkts_, QueueMonitor::size_, QueueMonitor::srcId_, and TIME_FORMAT.

Referenced by QueueMonitor::drop(), and QueueMonitor::out().

00210                          {
00211     char wrk[500];
00212     int n;
00213     double now = Scheduler::instance().clock();
00214     sprintf(wrk, "q -t "TIME_FORMAT" -s %d -d %d -l %d -p %d", now, srcId_, dstId_, size_, pkts_);
00215     n = strlen(wrk);
00216     wrk[n] = '\n';
00217     wrk[n+1] = 0;
00218     (void)Tcl_Write(channel_, wrk, n+1);
00219     wrk[n] = 0;
00220 }   

Here is the call graph for this function:

packet_t Flow::ptype  )  const [inline]
 

Definition at line 64 of file flowmon.h.

References type_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00064 { return (type_); }

int QueueMonitor::qs_bytes  )  const [inline, inherited]
 

Definition at line 119 of file queue-monitor.h.

References QueueMonitor::qs_bytes_.

Referenced by FlowMon::fformat().

00119 { return (qs_bytes_); }

int QueueMonitor::qs_drops  )  const [inline, inherited]
 

Definition at line 120 of file queue-monitor.h.

References QueueMonitor::qs_drops_.

Referenced by FlowMon::fformat().

00120 { return (qs_drops_); }

int QueueMonitor::qs_pkts  )  const [inline, inherited]
 

Definition at line 118 of file queue-monitor.h.

References QueueMonitor::qs_pkts_.

Referenced by FlowMon::fformat().

00118 { return (qs_pkts_); }

void Flow::setfields Packet p  )  [inline]
 

Definition at line 65 of file flowmon.h.

References hdr_cmn::access(), hdr_ip::access(), hdr_ip::daddr(), dst_, fid_, hdr_ip::flowid(), hdr_cmn::ptype(), hdr_ip::saddr(), src_, and type_.

Referenced by FlowMon::drop(), FlowMon::edrop(), FlowMon::in(), Tagger::in(), FlowMon::mon_edrop(), and FlowMon::out().

00065                               {
00066         hdr_ip* hdr = hdr_ip::access(p);
00067         hdr_cmn* chdr = hdr_cmn::access(p);
00068         src_ = hdr->saddr();
00069         dst_ = hdr->daddr();
00070         fid_ = hdr->flowid();
00071         type_ = chdr->ptype();
00072     }

Here is the call graph for this function:

int QueueMonitor::size  )  const [inline, inherited]
 

Definition at line 101 of file queue-monitor.h.

References QueueMonitor::size_.

00101 { return (size_); }

nsaddr_t Flow::src  )  const [inline]
 

Definition at line 61 of file flowmon.h.

References src_.

Referenced by FlowMon::fformat(), and Tagger::fformat().

00061 { return (src_); }

virtual void Flow::tagging Packet  )  [inline, virtual]
 

Reimplemented in TaggerTBFlow, and TaggerTSWFlow.

Definition at line 73 of file flowmon.h.

Referenced by Tagger::in().

00073 {}


Field Documentation

int QueueMonitor::barrivals_ [protected, inherited]
 

Definition at line 146 of file queue-monitor.h.

Referenced by QueueMonitor::barrivals(), and QueueMonitor::QueueMonitor().

int QueueMonitor::bdepartures_ [protected, inherited]
 

Definition at line 148 of file queue-monitor.h.

Referenced by QueueMonitor::bdepartures(), QueueMonitor::out(), and QueueMonitor::QueueMonitor().

int QueueMonitor::bdrops_ [protected, inherited]
 

Definition at line 152 of file queue-monitor.h.

Referenced by QueueMonitor::bdrops(), QueueMonitor::drop(), and QueueMonitor::QueueMonitor().

int QueueMonitor::binsPerSec_ [protected, inherited]
 

Definition at line 164 of file queue-monitor.h.

Referenced by QueueMonitor::keepRTTstats(), QueueMonitor::printRTTs(), and QueueMonitor::QueueMonitor().

Integrator* QueueMonitor::bytesInt_ [protected, inherited]
 

Definition at line 133 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::drop(), and QueueMonitor::out().

Tcl_Channel QueueMonitor::channel1_ [protected, inherited]
 

Definition at line 176 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::printRTTs(), and QueueMonitor::printSeqnos().

Tcl_Channel QueueMonitor::channel_ [protected, inherited]
 

Reimplemented in Tagger, and FlowMon.

Definition at line 175 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::drop(), QueueMonitor::out(), and QueueMonitor::printStats().

Samples* QueueMonitor::delaySamp_ [protected, inherited]
 

Definition at line 135 of file queue-monitor.h.

Referenced by QueueMonitor::command(), and QueueMonitor::out().

nsaddr_t Flow::dst_ [protected]
 

Definition at line 77 of file flowmon.h.

Referenced by dst(), Flow(), and setfields().

int QueueMonitor::dstId_ [protected, inherited]
 

Definition at line 174 of file queue-monitor.h.

Referenced by QueueMonitor::command(), and QueueMonitor::printStats().

int EDQueueMonitor::ebdrops_ [protected, inherited]
 

Definition at line 292 of file queue-monitor.h.

Referenced by EDQueueMonitor::ebdrops(), EDQueueMonitor::EDQueueMonitor(), and EDQueueMonitor::edrop().

int EDQueueMonitor::epdrops_ [protected, inherited]
 

Definition at line 293 of file queue-monitor.h.

Referenced by EDQueueMonitor::EDQueueMonitor(), EDQueueMonitor::edrop(), and EDQueueMonitor::epdrops().

int QueueMonitor::estimate_rate_ [inherited]
 

Definition at line 183 of file queue-monitor.h.

Referenced by RedPDQueue::command(), and QueueMonitor::QueueMonitor().

double QueueMonitor::estRate_ [inherited]
 

Definition at line 185 of file queue-monitor.h.

Referenced by RedPDQueue::command(), RedPDQueue::enque(), QueueMonitor::estimateRate(), and QueueMonitor::QueueMonitor().

int Flow::fid_ [protected]
 

Definition at line 78 of file flowmon.h.

Referenced by Flow(), flowid(), and setfields().

double QueueMonitor::first_pkt_ [protected, inherited]
 

Definition at line 158 of file queue-monitor.h.

Referenced by QueueMonitor::first_pkt(), QueueMonitor::in(), and QueueMonitor::QueueMonitor().

double QueueMonitor::k_ [inherited]
 

Definition at line 184 of file queue-monitor.h.

Referenced by QueueMonitor::estimateRate(), and QueueMonitor::QueueMonitor().

int QueueMonitor::keepRTTstats_ [protected, inherited]
 

Definition at line 161 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::out(), and QueueMonitor::QueueMonitor().

int QueueMonitor::keepSeqnoStats_ [protected, inherited]
 

Definition at line 167 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::out(), and QueueMonitor::QueueMonitor().

double QueueMonitor::last_pkt_ [protected, inherited]
 

Definition at line 159 of file queue-monitor.h.

Referenced by QueueMonitor::in(), and QueueMonitor::QueueMonitor().

int QueueMonitor::maxRTT_ [protected, inherited]
 

Definition at line 162 of file queue-monitor.h.

Referenced by QueueMonitor::keepRTTstats(), QueueMonitor::printRTTs(), and QueueMonitor::QueueMonitor().

int QueueMonitor::maxSeqno_ [protected, inherited]
 

Definition at line 168 of file queue-monitor.h.

Referenced by QueueMonitor::keepSeqnoStats(), QueueMonitor::printSeqnos(), and QueueMonitor::QueueMonitor().

int EDQueueMonitor::mon_ebdrops_ [protected, inherited]
 

Definition at line 294 of file queue-monitor.h.

Referenced by EDQueueMonitor::EDQueueMonitor(), EDQueueMonitor::mon_ebdrops(), and EDQueueMonitor::mon_edrop().

int EDQueueMonitor::mon_epdrops_ [protected, inherited]
 

Definition at line 295 of file queue-monitor.h.

Referenced by EDQueueMonitor::EDQueueMonitor(), EDQueueMonitor::mon_edrop(), and EDQueueMonitor::mon_epdrops().

int QueueMonitor::numRTTs_ [protected, inherited]
 

Definition at line 163 of file queue-monitor.h.

Referenced by QueueMonitor::keepRTTstats(), and QueueMonitor::printRTTs().

int QueueMonitor::numSeqnos_ [protected, inherited]
 

Definition at line 169 of file queue-monitor.h.

Referenced by QueueMonitor::keepSeqnoStats(), and QueueMonitor::printSeqnos().

int QueueMonitor::parrivals_ [protected, inherited]
 

Definition at line 145 of file queue-monitor.h.

Referenced by QueueMonitor::in(), QueueMonitor::parrivals(), and QueueMonitor::QueueMonitor().

int QueueMonitor::pdepartures_ [protected, inherited]
 

Definition at line 147 of file queue-monitor.h.

Referenced by QueueMonitor::out(), QueueMonitor::pdepartures(), and QueueMonitor::QueueMonitor().

int QueueMonitor::pdrops_ [protected, inherited]
 

Definition at line 150 of file queue-monitor.h.

Referenced by QueueMonitor::drop(), QueueMonitor::pdrops(), and QueueMonitor::QueueMonitor().

int QueueMonitor::pkts_ [protected, inherited]
 

Reimplemented in QueueMonitorCompat.

Definition at line 137 of file queue-monitor.h.

Referenced by QueueMonitor::pkts(), QueueMonitor::printStats(), and QueueMonitor::QueueMonitor().

Integrator* QueueMonitor::pktsInt_ [protected, inherited]
 

Definition at line 134 of file queue-monitor.h.

Referenced by QueueMonitor::command(), QueueMonitor::drop(), and QueueMonitor::out().

int QueueMonitor::pmarks_ [protected, inherited]
 

Definition at line 151 of file queue-monitor.h.

Referenced by QueueMonitor::out(), QueueMonitor::pmarks(), and QueueMonitor::QueueMonitor().

double QueueMonitor::prevTime_ [inherited]
 

Definition at line 186 of file queue-monitor.h.

Referenced by QueueMonitor::estimateRate(), and QueueMonitor::QueueMonitor().

int QueueMonitor::qs_bytes_ [protected, inherited]
 

Definition at line 155 of file queue-monitor.h.

Referenced by QueueMonitor::in(), QueueMonitor::qs_bytes(), and QueueMonitor::QueueMonitor().

int QueueMonitor::qs_drops_ [protected, inherited]
 

Definition at line 156 of file queue-monitor.h.

Referenced by QueueMonitor::drop(), QueueMonitor::qs_drops(), and QueueMonitor::QueueMonitor().

int QueueMonitor::qs_pkts_ [protected, inherited]
 

Definition at line 154 of file queue-monitor.h.

Referenced by QueueMonitor::in(), QueueMonitor::qs_pkts(), and QueueMonitor::QueueMonitor().

int* QueueMonitor::RTTbins_ [protected, inherited]
 

Definition at line 165 of file queue-monitor.h.

Referenced by QueueMonitor::keepRTTstats(), and QueueMonitor::printRTTs().

int* QueueMonitor::SeqnoBins_ [protected, inherited]
 

Definition at line 171 of file queue-monitor.h.

Referenced by QueueMonitor::keepSeqnoStats(), and QueueMonitor::printSeqnos().

int QueueMonitor::SeqnoBinSize_ [protected, inherited]
 

Definition at line 170 of file queue-monitor.h.

Referenced by QueueMonitor::keepSeqnoStats(), QueueMonitor::printSeqnos(), and QueueMonitor::QueueMonitor().

int QueueMonitor::size_ [protected, inherited]
 

Definition at line 136 of file queue-monitor.h.

Referenced by QueueMonitor::printStats(), QueueMonitor::QueueMonitor(), and QueueMonitor::size().

nsaddr_t Flow::src_ [protected]
 

Definition at line 76 of file flowmon.h.

Referenced by Flow(), setfields(), and src().

int QueueMonitor::srcId_ [protected, inherited]
 

Definition at line 173 of file queue-monitor.h.

Referenced by QueueMonitor::command(), and QueueMonitor::printStats().

double QueueMonitor::startTime_ [inherited]
 

Definition at line 187 of file queue-monitor.h.

Referenced by QueueMonitor::QueueMonitor().

int QueueMonitor::temp_size_ [protected, inherited]
 

Definition at line 190 of file queue-monitor.h.

Referenced by QueueMonitor::estimateRate().

packet_t Flow::type_ [protected]
 

Definition at line 79 of file flowmon.h.

Referenced by ptype(), and setfields().


The documentation for this class was generated from the following file:
Generated on Tue Mar 6 17:08:06 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6