

Public Member Functions | |
| CBQClass () | |
| int | command (int argc, const char *const *argv) |
| void | recv (Packet *, Handler *) |
| NsObject * | target () |
| virtual void | drop (Packet *p) |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | recvOnly (Packet *) |
| virtual void | delay_bind_init_all () |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| int | isdebug () const |
| virtual void | debug (const char *fmt,...) |
Protected Member Functions | |
| void | newallot (double) |
| void | update (Packet *, double) |
| void | delayed (double) |
| int | satisfied (double) |
| int | demand () |
| int | leaf () |
| int | ancestor (CBQClass *p) |
| int | desc_with_demand () |
| virtual void | drop (Packet *p, const char *s) |
| void | send (Packet *p, Handler *h) |
| virtual void | reset () |
| void | handle (Event *) |
Protected Attributes | |
| CBQueue * | cbq_ |
| CBQClass * | peer_ |
| CBQClass * | level_peer_ |
| CBQClass * | lender_ |
| Queue * | q_ |
| QueueMonitor * | qmon_ |
| double | allotment_ |
| double | maxidle_ |
| double | maxrate_ |
| double | extradelay_ |
| double | last_time_ |
| double | undertime_ |
| double | avgidle_ |
| int | pri_ |
| int | level_ |
| int | delayed_ |
| int | bytes_alloc_ |
| int | permit_borrowing_ |
| NsObject * | target_ |
| NsObject * | drop_ |
| int | debug_ |
Friends | |
| class | CBQueue |
| class | WRR_CBQueue |
|
|
Definition at line 805 of file cbq.cc. References abort(), extradelay_, level_, MAXLEVEL, MAXPRIO, permit_borrowing_, and pri_.
00805 : cbq_(0), peer_(0), level_peer_(0), lender_(0), 00806 q_(0), qmon_(0), allotment_(0.0), maxidle_(-1.0), maxrate_(0.0), 00807 extradelay_(0.0), last_time_(0.0), undertime_(0.0), avgidle_(0.0), 00808 pri_(-1), level_(-1), delayed_(0), bytes_alloc_(0), 00809 permit_borrowing_(1) 00810 { 00811 /* maxidle_ is no longer bound; it is now a method interface */ 00812 bind("priority_", &pri_); 00813 bind("level_", &level_); 00814 bind("extradelay_", &extradelay_); 00815 bind_bool("okborrow_", &permit_borrowing_); 00816 00817 if (pri_ < 0 || pri_ > (MAXPRIO-1)) 00818 abort(); 00819 00820 if (level_ <= 0 || level_ > MAXLEVEL) 00821 abort(); 00822 } |
Here is the call graph for this function:

|
|
Definition at line 956 of file cbq.cc. References lender_, and permit_borrowing_. Referenced by desc_with_demand().
00957 {
00958 if (!p->permit_borrowing_ || p->lender_ == NULL)
00959 return (0);
00960 else if (p->lender_ == this)
00961 return (1);
00962 return (ancestor(p->lender_));
00963 }
|
|
||||||||||||
|
Reimplemented from Connector. Definition at line 993 of file cbq.cc. References allotment_, cbq_, Connector::command(), lender_, maxidle_, newallot(), q_, and qmon_.
00994 {
00995 Tcl& tcl = Tcl::instance();
00996 if (argc == 2) {
00997 if (strcmp(argv[1], "allot") == 0) {
00998 tcl.resultf("%g", allotment_);
00999 return (TCL_OK);
01000 }
01001 if (strcmp(argv[1], "cbq") == 0) {
01002 if (cbq_ != NULL)
01003 tcl.resultf("%s", cbq_->name());
01004 else
01005 tcl.resultf("");
01006 return(TCL_OK);
01007 }
01008 if (strcmp(argv[1], "qdisc") == 0) {
01009 if (q_ != NULL)
01010 tcl.resultf("%s", q_->name());
01011 else
01012 tcl.resultf("");
01013 return (TCL_OK);
01014 }
01015 if (strcmp(argv[1], "qmon") == 0) {
01016 if (qmon_ != NULL)
01017 tcl.resultf("%s", qmon_->name());
01018 else
01019 tcl.resultf("");
01020 return (TCL_OK);
01021 }
01022 } else if (argc == 3) {
01023 // for now these are the same
01024 if ((strcmp(argv[1], "parent") == 0)) {
01025
01026 if (strcmp(argv[2], "none") == 0) {
01027 lender_ = NULL;
01028 return (TCL_OK);
01029 }
01030 lender_ = (CBQClass*)TclObject::lookup(argv[2]);
01031 if (lender_ != NULL)
01032 return (TCL_OK);
01033
01034 return (TCL_ERROR);
01035 }
01036 if (strcmp(argv[1], "qdisc") == 0) {
01037 q_ = (Queue*) TclObject::lookup(argv[2]);
01038 if (q_ != NULL)
01039 return (TCL_OK);
01040 tcl.resultf("couldn't find object %s",
01041 argv[2]);
01042 return (TCL_ERROR);
01043 }
01044 if (strcmp(argv[1], "qmon") == 0) {
01045 qmon_ = (QueueMonitor*) TclObject::lookup(argv[2]);
01046 if (qmon_ != NULL)
01047 return (TCL_OK);
01048 return (TCL_ERROR);
01049 }
01050 if (strcmp(argv[1], "allot") == 0) {
01051 double bw = atof(argv[2]);
01052 if (bw < 0.0)
01053 return (TCL_ERROR);
01054 if (allotment_ != 0.0) {
01055 tcl.resultf(" class %s already has allotment of %f!",
01056 name(), allotment_);
01057 return (TCL_ERROR);
01058 }
01059 allotment_ = bw;
01060 return (TCL_OK);
01061 }
01062 if (strcmp(argv[1], "newallot") == 0) {
01063 double bw = atof(argv[2]);
01064 if (bw < 0.0)
01065 return (TCL_ERROR);
01066 newallot(bw);
01067 return (TCL_OK);
01068 }
01069 if (strcmp(argv[1], "maxidle") == 0) {
01070 double m = atof(argv[2]);
01071 if (m < 0.0) {
01072 tcl.resultf("invalid maxidle value %s (must be non-negative)",
01073 argv[2]);
01074 return (TCL_ERROR);
01075 }
01076 maxidle_ = m;
01077 return (TCL_OK);
01078 }
01079 }
01080 return (Connector::command(argc, argv));
01081 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_.
00103 {
00104 if (!debug_)
00105 return;
00106 va_list ap;
00107 va_start(ap, fmt);
00108 vprintf(fmt, ap);
00109 }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 63 of file object.cc. References NsObject::debug_. Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch().
00064 {
00065 if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer))
00066 return TCL_OK;
00067 return TclObject::delay_bind_dispatch(varName, localName, tracer);
00068 }
|
|
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
00058 {
00059 delay_bind_init_one("debug_");
00060 }
|
|
|
Definition at line 941 of file cbq.cc. References avgidle_, delayed_, extradelay_, POWEROFTWO, and undertime_. Referenced by WRR_CBQueue::deque(), and CBQueue::deque().
00942 {
00943 double delay = undertime_ - now + extradelay_;
00944
00945 if (delay > 0 && !delayed_) {
00946 undertime_ += extradelay_;
00947 undertime_ -= (1-POWEROFTWO) * avgidle_;
00948 delayed_ = 1;
00949 }
00950 }
|
|
|
Definition at line 826 of file cbq.cc. References QueueMonitor::pkts(), and qmon_. Referenced by WRR_CBQueue::deque(), CBQueue::deque(), desc_with_demand(), and satisfied().
|
Here is the call graph for this function:

|
|
Definition at line 926 of file cbq.cc. References ancestor(), cbq_, demand(), LEAF_LEVEL, CBQueue::level(), and level_peer_. Referenced by satisfied().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 114 of file connector.cc. References Connector::drop_, Packet::free(), and NsObject::recv().
00115 {
00116 if (drop_ != 0)
00117 drop_->recv(p, s);
00118 else
00119 Packet::free(p);
00120 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Implements Handler. Reimplemented in LinkDelay, LL, AckRecons, and Snoop. Definition at line 91 of file object.cc. References NsObject::recv().
|
Here is the call graph for this function:

|
|
Definition at line 61 of file object.h. References NsObject::debug_.
00061 { return debug_; }
|
|
|
Definition at line 832 of file cbq.cc. References LEAF_LEVEL, and level_. Referenced by satisfied().
00833 {
00834 return (level_ == LEAF_LEVEL);
00835 }
|
|
|
Definition at line 969 of file cbq.cc. References CBQueue::addallot(), allotment_, LinkDelay::bandwidth(), cbq_, CBQueue::link(), maxrate_, and pri_. Referenced by command().
00970 {
00971 if (allotment_ < 0)
00972 allotment_ = 0;
00973 if (bw < 0)
00974 bw = 0;
00975 maxrate_ = bw * ( cbq_->link()->bandwidth() / 8.0 );
00976 double diff = bw - allotment_;
00977 allotment_ = bw;
00978 cbq_->addallot(pri_, diff);
00979 return;
00980 }
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented in CMUTrace. Definition at line 96 of file object.cc. References Packet::free().
00097 {
00098 Packet::free(p);
00099 }
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented from Connector. Definition at line 848 of file cbq.cc. References Queue< T >::blocked(), cbq_, Scheduler::clock(), Scheduler::instance(), CBQueue::sched(), Connector::send(), CBQueue::toplevel(), and CBQueue::toplevel_arrival().
|
Here is the call graph for this function:

|
|
Reimplemented in Agent, and Trace. Definition at line 56 of file object.h. Referenced by Trace::recvOnly().
00056 {};
|
|
|
Reimplemented in BayFullTcpAgent, HashClassifier, IvsSource, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, LinkDelay, CBQueue, DropTail, ErrorModel, PIQueue, Queue< T >, RedPDQueue, REDQueue, REMQueue, RIOQueue, Snoop, FackTcpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, Sack1TcpAgent, TcpSink, DelAckSink, TcpAgent, VegasTcpAgent, toraAgent, and Queue< T >. Definition at line 70 of file object.cc. Referenced by NsObject::command().
00071 {
00072 }
|
|
|
Definition at line 904 of file cbq.cc. References demand(), desc_with_demand(), leaf(), and undertime_. Referenced by CBQueue::eligible_formal().
00905 {
00906 if (leaf()) {
00907 /* leaf is unsat if underlimit with backlog */
00908 if (undertime_ < now && demand())
00909 return (0);
00910 else
00911 return (1);
00912 }
00913 if (undertime_ < now && desc_with_demand())
00914 return (0);
00915
00916 return (1);
00917 }
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented in Agent, and LinkDelay. Definition at line 54 of file connector.h. References NsObject::recv(), and Connector::target_. Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), DequeTrace::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), SatDequeTrace::recv(), SALink::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), recv(), and AddSR::recv().
|
Here is the call graph for this function:

|
|
Definition at line 48 of file connector.h. References Connector::target_. Referenced by JoBS::assignRateDropsADC(), FQ::deque(), QSAgent::recv(), and MIPMHAgent::reg().
00048 { return target_; }
|
|
||||||||||||
|
Definition at line 866 of file cbq.cc. References hdr_cmn::access(), allotment_, avgidle_, cbq_, last_time_, lender_, CBQueue::link(), maxidle_, maxrate_, POWEROFTWO, hdr_cmn::size(), LinkDelay::txtime(), and undertime_. Referenced by WRR_CBQueue::deque(), and CBQueue::deque().
00867 {
00868 double idle, avgidle;
00869
00870 hdr_cmn* hdr = hdr_cmn::access(p);
00871 int pktsize = hdr->size();
00872
00873 double tx_time = cbq_->link()->txtime(p);
00874 double fin_time = now + tx_time;
00875
00876 idle = (fin_time - last_time_) - (pktsize / maxrate_);
00877 avgidle = avgidle_;
00878 avgidle += (idle - avgidle) / POWEROFTWO;
00879 if (maxidle_ < 0) {
00880 fprintf(stderr,
00881 "CBQClass: warning: maxidle_ not configured!\n");
00882 } else if (avgidle > maxidle_)
00883 avgidle = maxidle_;
00884 avgidle_ = avgidle;
00885
00886 if (avgidle <= 0) {
00887 undertime_ = fin_time + tx_time *
00888 (1.0 / allotment_ - 1.0);
00889 undertime_ += (1-POWEROFTWO) * avgidle;
00890 }
00891 last_time_ = fin_time;
00892 // tail-recurse up to root of tree performing updates
00893 if (lender_)
00894 lender_->update(p, now);
00895
00896 return;
00897 }
|
Here is the call graph for this function:

|
|
|
|
|
|
|
|
Definition at line 121 of file cbq.cc. Referenced by command(), WRR_CBQueue::deque(), CBQueue::insert_class(), newallot(), and update(). |
|
|
|
|
|
Definition at line 131 of file cbq.cc. Referenced by WRR_CBQueue::deque(). |
|
|
Definition at line 112 of file cbq.cc. Referenced by command(), desc_with_demand(), CBQueue::insert_class(), newallot(), recv(), and update(). |
|
|
Reimplemented in FECModel, FloodAgent, and LandmarkAgent. Definition at line 66 of file object.h. Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), RedPDQueue::enque(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), and REDQueue::reset(). |
|
|
Definition at line 130 of file cbq.cc. Referenced by delayed(), and CBQueue::send_permitted(). |
|
|
Definition at line 57 of file connector.h. Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv(). |
|
|
Definition at line 124 of file cbq.cc. Referenced by CBQClass(), and delayed(). |
|
|
Definition at line 125 of file cbq.cc. Referenced by update(). |
|
|
Definition at line 116 of file cbq.cc. Referenced by ancestor(), command(), WRR_CBQueue::deque(), CBQueue::deque(), CBQueue::find_lender(), CBQueue::toplevel_arrival(), and update(). |
|
|
Definition at line 129 of file cbq.cc. Referenced by CBQClass(), CBQueue::eligible_formal(), CBQueue::eligible_toplevel(), CBQueue::find_lender(), CBQueue::insert_class(), leaf(), and CBQueue::toplevel_departure(). |
|
|
Definition at line 115 of file cbq.cc. Referenced by desc_with_demand(), CBQueue::eligible_formal(), and CBQueue::insert_class(). |
|
|
|
|
|
Definition at line 123 of file cbq.cc. Referenced by CBQueue::insert_class(), newallot(), and update(). |
|
|
Definition at line 114 of file cbq.cc. Referenced by WRR_CBQueue::deque(), CBQueue::deque(), and CBQueue::insert_class(). |
|
|
Definition at line 132 of file cbq.cc. Referenced by ancestor(), CBQClass(), WRR_CBQueue::deque(), CBQueue::deque(), CBQueue::find_lender(), CBQueue::send_permitted(), and CBQueue::toplevel_arrival(). |
|
|
Definition at line 128 of file cbq.cc. Referenced by CBQClass(), WRR_CBQueue::deque(), CBQueue::deque(), WRR_CBQueue::insert_class(), CBQueue::insert_class(), and newallot(). |
|
|
Definition at line 118 of file cbq.cc. Referenced by command(), WRR_CBQueue::deque(), CBQueue::deque(), and CBQueue::insert_class(). |
|
|
Definition at line 119 of file cbq.cc. Referenced by command(), demand(), and CBQueue::toplevel_departure(). |
|
|
|
Definition at line 126 of file cbq.cc. Referenced by delayed(), CBQueue::find_lender(), satisfied(), CBQueue::send_permitted(), CBQueue::toplevel_arrival(), CBQueue::toplevel_departure(), and update(). |
1.3.3