

Public Member Functions | |
| DRR () | |
| virtual int | command (int argc, const char *const *argv) |
| Packet * | deque (void) |
| void | enque (Packet *pkt) |
| int | hash (Packet *pkt) |
| void | clear () |
| int | length () |
| int | blength () |
| virtual void | recv (Packet *, Handler *) |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | updateStats (int queuesize) |
| void | resume () |
| int | blocked () const |
| void | unblock () |
| void | block () |
| int | limit () |
| int | byteLength () |
| virtual double | utilization (void) |
| virtual void | reset () |
| virtual void | destroy () |
| void | enqueue (QueueElem< T > *e) |
| QueueElem< T > * | dequeue () |
| void | detach (QueueElem< T > *e) |
| QueueElem< T > * | getHead () |
| int | is_empty () const |
| int | size () const |
| NsObject * | target () |
| virtual void | drop (Packet *p) |
| 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 | |
| PacketDRR * | getMaxflow (PacketDRR *curr) |
| void | reset () |
| void | utilUpdate (double int_begin, double int_end, int link_state) |
| virtual void | drop (Packet *p, const char *s) |
| void | send (Packet *p, Handler *h) |
| void | handle (Event *) |
Protected Attributes | |
| int | buckets_ |
| int | blimit_ |
| int | quantum_ |
| int | mask_ |
| int | bytecnt |
| int | pktcnt |
| int | flwcnt |
| PacketDRR * | curr |
| PacketDRR * | drr |
| int | qlim_ |
| int | blocked_ |
| int | unblock_on_resume_ |
| QueueHandler | qh_ |
| PacketQueue * | pq_ |
| double | true_ave_ |
| double | total_time_ |
| double | last_change_ |
| double | old_util_ |
| double | util_weight_ |
| QueueElem< T > * | head_ |
| QueueElem< T > * | tail_ |
| int | size_ |
| NsObject * | target_ |
| NsObject * | drop_ |
| int | debug_ |
|
|
Definition at line 123 of file drr.cc. References blimit_, buckets_, bytecnt, curr, drr, flwcnt, mask_, pktcnt, and quantum_.
|
|
|
Definition at line 110 of file drr.cc. References bytecnt.
00110 {
00111 return bytecnt;
00112 }
|
|
|||||||||
|
Definition at line 131 of file queue.h. References Queue< T >::blocked_.
00131 { blocked_ = 1; }
|
|
|||||||||
|
Definition at line 129 of file queue.h. References Queue< T >::blocked_. Referenced by CBQClass::recv().
00129 { return (blocked_ == 1); }
|
|
|||||||||
|
Definition at line 135 of file queue.h. References PacketQueue::byteLength(), and Queue< T >::pq_.
00135 { return pq_->byteLength(); } /* number of bytes *
|
Here is the call graph for this function:

|
|
Definition at line 235 of file drr.cc. References buckets_, drr, and PacketDRR::pkts. Referenced by command().
|
|
||||||||||||
|
Reimplemented from Connector. Definition at line 258 of file drr.cc. References blimit_, buckets_, bytecnt, clear(), Connector::command(), mask_, and quantum_.
00259 {
00260 if (argc==3) {
00261 if (strcmp(argv[1], "blimit") == 0) {
00262 blimit_ = atoi(argv[2]);
00263 if (bytecnt > blimit_)
00264 {
00265 fprintf (stderr,"More packets in buffer than the new limit");
00266 exit (1);
00267 }
00268 return (TCL_OK);
00269 }
00270 if (strcmp(argv[1], "buckets") == 0) {
00271 clear();
00272 buckets_ = atoi(argv[2]);
00273 return (TCL_OK);
00274 }
00275 if (strcmp(argv[1],"quantum") == 0) {
00276 quantum_ = atoi(argv[2]);
00277 return (TCL_OK);
00278 }
00279 if (strcmp(argv[1],"mask")==0) {
00280 mask_= atoi(argv[2]);
00281 return (TCL_OK);
00282 }
00283 }
00284 return (Queue::command(argc, argv));
00285 }
|
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 }
|
|
|
Implements Queue< T >. Definition at line 192 of file drr.cc. References hdr_ip::access(), hdr_cmn::access(), PacketDRR::bcount, bytecnt, curr, PacketDRR::deficitCounter, PacketQueue::deque(), flwcnt, PacketDRR::idle(), PacketQueue::lookup(), PacketDRR::next, pktcnt, PacketDRR::pkts, quantum_, hdr_cmn::size(), and PacketDRR::turn.
00193 {
00194 hdr_cmn *ch;
00195 hdr_ip *iph;
00196 Packet *pkt=0;
00197 if (bytecnt==0) {
00198 //fprintf (stderr,"No active flow\n");
00199 return(0);
00200 }
00201
00202 while (!pkt) {
00203 if (!curr->turn) {
00204 curr->deficitCounter+=quantum_;
00205 curr->turn=1;
00206 }
00207
00208 pkt=curr->lookup(0);
00209 ch=hdr_cmn::access(pkt);
00210 iph=hdr_ip::access(pkt);
00211 if (curr->deficitCounter >= ch->size()) {
00212 curr->deficitCounter -= ch->size();
00213 pkt=curr->deque();
00214 curr->bcount -= ch->size();
00215 --curr->pkts;
00216 --pktcnt;
00217 bytecnt -= ch->size();
00218 if (curr->pkts == 0) {
00219 curr->turn=0;
00220 --flwcnt;
00221 curr->deficitCounter=0;
00222 curr=curr->idle(curr);
00223 }
00224 return pkt;
00225 }
00226 else {
00227 curr->turn=0;
00228 curr=curr->next;
00229 pkt=0;
00230 }
00231 }
00232 return 0; // not reached
00233 }
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 378 of file mcache.h. References Queue< T >::head_, QueueElem< T >::next(), QueueElem< T >::next_, Queue< T >::size_, and Queue< T >::tail_. Referenced by Queue< T >::detach(), and MediaServer::get_next_segment().
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 358 of file mcache.h. References QueueElem< T >::data(), Queue< T >::head_, and QueueElem< T >::next().
00358 {
00359 QueueElem<T> *p = head_, *q;
00360 while (p != NULL) {
00361 q = p;
00362 p = p->next();
00363 delete q->data();
00364 delete q;
00365 }
00366 head_ = NULL;
00367 }
|
Here is the call graph for this function:

|
||||||||||
|
Definition at line 390 of file mcache.h. References Queue< T >::dequeue(), Queue< T >::head_, QueueElem< T >::next_, Queue< T >::size_, and Queue< T >::tail_. Referenced by MediaServer::command().
00390 {
00391 assert(head_ != 0);
00392 if (head_ == e) {
00393 dequeue();
00394 return;
00395 }
00396 QueueElem<T> *p = head_;
00397 while (p != NULL) {
00398 if (p->next_ != e)
00399 p = p->next_;
00400 else
00401 break;
00402 }
00403 assert(p != NULL);
00404 p->next_ = e->next_;
00405 if (tail_ == e)
00406 tail_ = p;
00407 size_--;
00408 if (size_ == 0)
00409 assert((head_ == 0) && (tail_ == 0));
00410 }
|
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 Queue< T >. Definition at line 139 of file drr.cc. References hdr_ip::access(), hdr_cmn::access(), PacketDRR::activate(), PacketDRR::bcount, blimit_, buckets_, bytecnt, compare(), curr, PacketDRR::deficitCounter, PacketQueue::deque(), Connector::drop(), drr, PacketQueue::enque(), flwcnt, getMaxflow(), hash(), PacketDRR::idle(), mask_, pktcnt, PacketDRR::pkts, hdr_ip::saddr(), hdr_cmn::size(), and PacketDRR::src.
00140 {
00141 PacketDRR *q,*remq;
00142 int which;
00143
00144 hdr_cmn *ch= hdr_cmn::access(pkt);
00145 hdr_ip *iph = hdr_ip::access(pkt);
00146 if (!drr)
00147 drr=new PacketDRR[buckets_];
00148 which= hash(pkt) % buckets_;
00149 q=&drr[which];
00150
00151 /*detect collisions here */
00152 int compare=(!mask_ ? ((int)iph->saddr()) : ((int)iph->saddr()&0xfff0));
00153 if (q->src ==-1)
00154 q->src=compare;
00155 else
00156 if (q->src != compare)
00157 fprintf(stderr,"Collisions between %d and %d src addresses\n",q->src,(int)iph->saddr());
00158
00159 q->enque(pkt);
00160 ++q->pkts;
00161 ++pktcnt;
00162 q->bcount += ch->size();
00163 bytecnt +=ch->size();
00164
00165
00166 if (q->pkts==1)
00167 {
00168 curr = q->activate(curr);
00169 q->deficitCounter=0;
00170 ++flwcnt;
00171 }
00172 while (bytecnt > blimit_) {
00173 Packet *p;
00174 hdr_cmn *remch;
00175 hdr_ip *remiph;
00176 remq=getMaxflow(curr);
00177 p=remq->deque();
00178 remch=hdr_cmn::access(p);
00179 remiph=hdr_ip::access(p);
00180 remq->bcount -= remch->size();
00181 bytecnt -= remch->size();
00182 drop(p);
00183 --remq->pkts;
00184 --pktcnt;
00185 if (remq->pkts==0) {
00186 curr=remq->idle(curr);
00187 --flwcnt;
00188 }
00189 }
00190 }
|
Here is the call graph for this function:

|
||||||||||
|
Definition at line 369 of file mcache.h. References QueueElem< T >::append(), Queue< T >::head_, Queue< T >::size_, and Queue< T >::tail_. Referenced by MediaServer::command(), and MediaServer::get_next_segment().
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 411 of file mcache.h. References Queue< T >::head_. Referenced by MediaServer::find_prefinfo().
00411 { return head_; }
|
|
|
Definition at line 92 of file drr.cc. References PacketDRR::bcount, and flwcnt. Referenced by enque().
|
|
|
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 287 of file drr.cc. References hdr_ip::access(), mask_, and hdr_ip::saddr(). Referenced by enque().
00288 {
00289 hdr_ip *iph=hdr_ip::access(pkt);
00290 int i;
00291 if (mask_)
00292 i = (int)iph->saddr() & (0xfff0);
00293 else
00294 i = (int)iph->saddr();
00295 return ((i + (i >> 8) + ~(i>>4)) % ((2<<23)-1))+1; // modulo a large prime
00296 }
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 412 of file mcache.h. References Queue< T >::size_. Referenced by MediaServer::command(), and MediaServer::get_next_segment().
00412 { return (size_ == 0); }
|
|
|
Definition at line 61 of file object.h. References NsObject::debug_.
00061 { return debug_; }
|
|
|
Reimplemented from Queue< T >. Definition at line 105 of file drr.cc. References pktcnt.
00105 {
00106 return pktcnt;
00107 }
|
|
|||||||||
|
Definition at line 132 of file queue.h. References Queue< T >::qlim_. Referenced by dsREDQueue::reset(), and Snoop::snoop_data().
00132 { return qlim_; }
|
|
||||||||||||
|
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. Reimplemented in CBQueue, FQ, and PriQueue. Definition at line 101 of file queue.cc. References Queue< T >::blocked_, Scheduler::clock(), Queue< T >::deque(), Queue< T >::enque(), Scheduler::instance(), Queue< T >::last_change_, Queue< T >::qh_, NsObject::recv(), Connector::target_, and Queue< T >::utilUpdate(). Referenced by PriQueue::recv().
00102 {
00103 double now = Scheduler::instance().clock();
00104 enque(p);
00105 if (!blocked_) {
00106 /*
00107 * We're not blocked. Get a packet and send it on.
00108 * We perform an extra check because the queue
00109 * might drop the packet even if it was
00110 * previously empty! (e.g., RED can do this.)
00111 */
00112 p = deque();
00113 if (p != 0) {
00114 utilUpdate(last_change_, now, blocked_);
00115 last_change_ = now;
00116 blocked_ = 1;
00117 target_->recv(p, &qh_);
00118 }
00119 }
00120 }
|
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 from NsObject. Reimplemented in dsREDQueue, CBQueue, DropTail, PIQueue, RedPDQueue, REDQueue, REMQueue, and RIOQueue. Definition at line 349 of file mcache.h. References Queue< T >::head_, and QueueElem< T >::next().
00349 {
00350 QueueElem<T> *p = head_, *q;
00351 while (p != NULL) {
00352 q = p;
00353 p = p->next();
00354 delete q;
00355 }
00356 head_ = NULL;
00357 }
|
Here is the call graph for this function:

|
|||||||||
|
Reimplemented from NsObject. Reimplemented in dsREDQueue, CBQueue, DropTail, PIQueue, RedPDQueue, REDQueue, REMQueue, and RIOQueue. Definition at line 174 of file queue.cc. References Queue< T >::deque(), Connector::drop(), Queue< T >::total_time_, and Queue< T >::true_ave_. Referenced by REDQueue::reset(), PIQueue::reset(), dsREDQueue::reset(), and DropTail::reset().
00175 {
00176 Packet* p;
00177 total_time_ = 0.0;
00178 true_ave_ = 0.0;
00179 while ((p = deque()) != 0)
00180 drop(p);
00181 }
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 154 of file queue.cc. References Queue< T >::blocked_, Scheduler::clock(), Queue< T >::deque(), Scheduler::instance(), Queue< T >::last_change_, Queue< T >::qh_, NsObject::recv(), Connector::target_, Queue< T >::unblock_on_resume_, and Queue< T >::utilUpdate(). Referenced by WRR_CBQueue::deque(), CBQueue::deque(), and QueueHandler::handle().
00155 {
00156 double now = Scheduler::instance().clock();
00157 Packet* p = deque();
00158 if (p != 0) {
00159 target_->recv(p, &qh_);
00160 } else {
00161 if (unblock_on_resume_) {
00162 utilUpdate(last_change_, now, blocked_);
00163 last_change_ = now;
00164 blocked_ = 0;
00165 }
00166 else {
00167 utilUpdate(last_change_, now, blocked_);
00168 last_change_ = now;
00169 blocked_ = 1;
00170 }
00171 }
00172 }
|
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(), CBQClass::recv(), and AddSR::recv().
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 413 of file mcache.h. References Queue< T >::size_. Referenced by JoBS::arvAccounting(), JoBS::assignRateDropsADC(), dsREDQueue::deque(), JoBS::dropFront(), JoBS::dropTail(), RedPDQueue::enque(), JoBS::enque(), MediaServer::get_next_segment(), JoBS::pickDroppedRLC(), and FQ::recv().
00413 { return size_; }
|
|
|
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 130 of file queue.h. References Queue< T >::blocked_.
00130 { blocked_ = 0; }
|
|
||||||||||
|
Definition at line 141 of file queue.cc. References Scheduler::clock(), Scheduler::instance(), Queue< T >::total_time_, and Queue< T >::true_ave_. Referenced by REDQueue::deque(), DropTail::deque(), REDQueue::enque(), and DropTail::enque().
00142 {
00143 double now = Scheduler::instance().clock();
00144 double newtime = now - total_time_;
00145 if (newtime > 0.0) {
00146 double oldave = true_ave_;
00147 double oldtime = total_time_;
00148 double newtime = now - total_time_;
00149 true_ave_ = (oldtime * oldave + newtime * queuesize) /now;
00150 total_time_ = now;
00151 }
00152 }
|
Here is the call graph for this function:

|
||||||||||
|
Definition at line 130 of file queue.cc. References Queue< T >::blocked_, Scheduler::clock(), Scheduler::instance(), Queue< T >::last_change_, Queue< T >::old_util_, and Queue< T >::utilUpdate(). Referenced by QSAgent::recv().
00131 {
00132 double now = Scheduler::instance().clock();
00133
00134 utilUpdate(last_change_, now, blocked_);
00135 last_change_ = now;
00136
00137 return old_util_;
00138
00139 }
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 122 of file queue.cc. References Queue< T >::old_util_, and Queue< T >::util_weight_. Referenced by Queue< T >::recv(), Queue< T >::resume(), and Queue< T >::utilization().
|
|
|
|
|
|||||
|
Definition at line 143 of file queue.h. Referenced by Queue< T >::block(), Queue< T >::blocked(), Queue< T >::Queue(), Queue< T >::recv(), FQ::recv(), CBQueue::recv(), PriQueue::recvHighPriority(), Queue< T >::resume(), CBQueue::sched(), Queue< T >::unblock(), and Queue< T >::utilization(). |
|
|
|
|
|
Definition at line 86 of file drr.cc. Referenced by blength(), command(), deque(), DRR(), and enque(). |
|
|
|
|
|
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 57 of file connector.h. Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv(). |
|
|
|
|
|
Definition at line 88 of file drr.cc. Referenced by deque(), DRR(), enque(), and getMaxflow(). |
|
|||||
|
Definition at line 416 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::destroy(), Queue< T >::detach(), Queue< T >::enqueue(), Queue< T >::getHead(), Queue< T >::Queue(), Queue< T >::reset(), and Queue< T >::~Queue(). |
|
|||||
|
Definition at line 154 of file queue.h. Referenced by Queue< T >::recv(), Queue< T >::resume(), and Queue< T >::utilization(). |
|
|
|
|
|||||
|
Definition at line 155 of file queue.h. Referenced by Queue< T >::utilization(), and Queue< T >::utilUpdate(). |
|
|
|
|
|||||
|
|||||
|
Definition at line 145 of file queue.h. Referenced by Queue< T >::recv(), FQ::recv(), PriQueue::recvHighPriority(), Queue< T >::resume(), and CBQueue::sched(). |
|
|||||
|
Definition at line 142 of file queue.h. Referenced by Vq::checkPacketForECN(), Vq::enque(), SRR::enque(), RIOQueue::enque(), REMQueue::enque(), REDQueue::enque(), PIQueue::enque(), Marker::enque(), JoBS::enque(), GK::enque(), DropTail::enque(), Demarker::enque(), Queue< T >::limit(), RIOQueue::print_edp(), REDQueue::print_edp(), Queue< T >::Queue(), and PriQueue::recvHighPriority(). |
|
|
|
|
|||||
|
Definition at line 417 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::detach(), Queue< T >::enqueue(), Queue< T >::is_empty(), Queue< T >::Queue(), and Queue< T >::size(). |
|
|||||
|
Definition at line 416 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::detach(), Queue< T >::enqueue(), and Queue< T >::Queue(). |
|
|
|||||
|
Definition at line 150 of file queue.h. Referenced by REDQueue::print_summarystats(), DropTail::print_summarystats(), Queue< T >::reset(), and Queue< T >::updateStats(). |
|
|||||
|
Definition at line 149 of file queue.h. Referenced by REDQueue::print_summarystats(), DropTail::print_summarystats(), Queue< T >::reset(), and Queue< T >::updateStats(). |
|
|||||
|
Definition at line 144 of file queue.h. Referenced by Queue< T >::Queue(), and Queue< T >::resume(). |
|
|||||
|
Definition at line 156 of file queue.h. Referenced by Queue< T >::Queue(), and Queue< T >::utilUpdate(). |
1.3.3