#include <dsred.h>
Inheritance diagram for dsREDQueue:


Definition at line 118 of file dsred.h.
Public Member Functions | |
| void | block () |
| int | blocked () const |
| int | byteLength () |
| int | command (int argc, const char *const *argv) |
| virtual void | debug (const char *fmt,...) |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | delay_bind_init_all () |
| QueueElem< T > * | dequeue () |
| virtual void | destroy () |
| void | detach (QueueElem< T > *e) |
| virtual void | drop (Packet *p) |
| dsREDQueue () | |
| void | enqueue (QueueElem< T > *e) |
| QueueElem< T > * | getHead () |
| int | is_empty () const |
| int | isdebug () const |
| int | length () |
| int | limit () |
| double | peak_utilization (void) |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | recv (Packet *, Handler *) |
| virtual void | recvOnly (Packet *) |
| void | resume () |
| void | setDropTarget (NsObject *dt) |
| int | size () const |
| void | target (NsObject *target) |
| NsObject * | target () |
| void | unblock () |
| virtual void | updateStats (int queuesize) |
| virtual double | utilization (void) |
Protected Member Functions | |
| void | addPHBEntry (int codePt, int queue, int prec) |
| void | addQueueRate (int queueNum, int rate) |
| void | addQueueWeights (int queueNum, int weight) |
| void | applyTSWMeter (int q_id, int pkt_size) |
| Packet * | deque (void) |
| virtual void | drop (Packet *p, const char *s) |
| void | edrop (Packet *p) |
| void | enque (Packet *pkt) |
| int | getCodePt (Packet *p) |
| double | getStat (int argc, const char *const *argv) |
| void | handle (Event *) |
| void | lookupPHBTable (int codePt, int *queue, int *prec) |
| void | printPHBTable () |
| void | printStats () |
| void | printWRRcount () |
| void | reset () |
| int | selectQueueToDeque () |
| void | send (Packet *p, Handler *h) |
| void | setMREDMode (const char *mode, const char *queue) |
| void | setNumPrec (int curPrec) |
| void | setSchedularMode (const char *schedtype) |
| void | utilUpdate (double int_begin, double int_end, int link_state) |
Protected Attributes | |
| int | blocked_ |
| int | buf_slot_ |
| double | cur_util_ |
| NsObject * | de_drop_ |
| int | debug_ |
| NsObject * | drop_ |
| int | ecn_ |
| QueueElem< T > * | head_ |
| double | last_change_ |
| LinkDelay * | link_ |
| int | numPrec |
| int | numQueues_ |
| double | old_util_ |
| double | period_begin_ |
| phbParam | phb_ [MAX_CP] |
| int | phbEntries |
| int | pktcount [MAX_QUEUES] |
| PacketQueue * | pq_ |
| QueueHandler | qh_ |
| int | qlim_ |
| int | qToDq |
| double | queueArrTime [MAX_QUEUES] |
| double | queueAvgRate [MAX_QUEUES] |
| double | queueMaxRate [MAX_QUEUES] |
| int | queuesDone |
| int | queueWeight [MAX_QUEUES] |
| redQueue | redq_ [MAX_QUEUES] |
| int | schedMode |
| int | size_ |
| int | slicecount [MAX_QUEUES] |
| statType | stats |
| QueueElem< T > * | tail_ |
| NsObject * | target_ |
| double | total_time_ |
| double | true_ave_ |
| int | unblock_on_resume_ |
| double * | util_buf_ |
| double | util_check_intv_ |
| int | util_records_ |
| double | util_weight_ |
| unsigned char | wirrqDone [MAX_QUEUES] |
| int | wirrTemp [MAX_QUEUES] |
|
|
Definition at line 67 of file dsred.cc. References ecn_, MAX_PREC, MAX_QUEUES, numPrec, numQueues_, queueMaxRate, queueWeight, schedMode, and schedModeRR. 00067 : de_drop_(NULL), link_(NULL) { 00068 bind("numQueues_", &numQueues_); 00069 bind_bool("ecn_", &ecn_); 00070 int i; 00071 00072 numPrec = MAX_PREC; 00073 schedMode = schedModeRR; 00074 00075 for(i=0;i<MAX_QUEUES;i++){ 00076 queueMaxRate[i] = 0; 00077 queueWeight[i]=1; 00078 } 00079 00080 queuesDone = MAX_QUEUES; 00081 phbEntries = 0; // Number of entries in PHB table 00082 00083 reset(); 00084 }
|
|
||||||||||||||||
|
Definition at line 375 of file dsred.cc. References phbParam::codePt_, MAX_CP, phb_, phbEntries, phbParam::prec_, phbParam::queue_, stats, and statType::valid_CP. Referenced by command(). 00375 { 00376 if (phbEntries == MAX_CP) { 00377 printf("ERROR: PHB Table size limit exceeded.\n"); 00378 } else { 00379 phb_[phbEntries].codePt_ = codePt; 00380 phb_[phbEntries].queue_ = queue; 00381 phb_[phbEntries].prec_ = prec; 00382 stats.valid_CP[codePt] = 1; 00383 phbEntries++; 00384 } 00385 }
|
|
||||||||||||
|
Definition at line 529 of file dsred.cc. References queueMaxRate. 00529 { 00530 if(queueNum < MAX_QUEUES){ 00531 // Convert to BYTE/SECOND 00532 queueMaxRate[queueNum]=(double)rate/8.0; 00533 } else { 00534 printf("The queue number is out of range.\n"); 00535 } 00536 }
|
|
||||||||||||
|
Definition at line 520 of file dsred.cc. References queueWeight. 00520 { 00521 if(queueNum < MAX_QUEUES){ 00522 queueWeight[queueNum]=weight; 00523 } else { 00524 printf("The queue number is out of range.\n"); 00525 } 00526 }
|
|
||||||||||||
|
Definition at line 150 of file dsred.cc. References Scheduler::clock(), Scheduler::instance(), queueArrTime, and queueAvgRate. Referenced by deque(). 00150 { 00151 double now, bytesInTSW, newBytes; 00152 double winLen = 1.0; 00153 00154 bytesInTSW = queueAvgRate[q_id] * winLen; 00155 00156 // Modified by xuanc(xuanc@isi.edu) Oct 18, 2001, 00157 // referring to the patch contributed by 00158 // Sergio Andreozzi <sergio.andreozzi@lut.fi> 00159 newBytes = bytesInTSW + pkt_size; 00160 00161 // Calculate the average rate (SW) 00162 now = Scheduler::instance().clock(); 00163 queueAvgRate[q_id] = newBytes / (now - queueArrTime[q_id] + winLen); 00164 queueArrTime[q_id] = now; 00165 }
Here is the call graph for this function: ![]() |
|
|||||||||
|
Definition at line 132 of file queue.h. References Queue< T >::blocked_. 00132 { blocked_ = 1; }
|
|
|||||||||
|
Definition at line 130 of file queue.h. References Queue< T >::blocked_. 00130 { return (blocked_ == 1); }
|
|
|||||||||
|
Definition at line 136 of file queue.h. References PacketQueue::byteLength(), and Queue< T >::pq_. Referenced by XCPQueue::deque(), and XCPQueue::Tq_timeout(). 00136 { return pq_->byteLength(); } /* number of bytes *
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented from Connector. Reimplemented in coreQueue, and edgeQueue. Definition at line 542 of file dsred.cc. References addPHBEntry(), redQueue::config(), redq_, and setNumPrec(). Referenced by edgeQueue::command(), and coreQueue::command(). 00542 { 00543 if (strcmp(argv[1], "configQ") == 0) { 00544 // modification to set the parameter q_w by Thilo 00545 redq_[atoi(argv[2])].config(atoi(argv[3]), argc, argv); 00546 return(TCL_OK); 00547 } 00548 if (strcmp(argv[1], "addPHBEntry") == 0) { 00549 addPHBEntry(atoi(argv[2]), atoi(argv[3]), atoi(argv[4])); 00550 return (TCL_OK); 00551 } 00552 if (strcmp(argv[1], "meanPktSize") == 0) { 00553 for (int i = 0; i < MAX_QUEUES; i++) 00554 redq_[i].setMPS(atoi(argv[2])); 00555 return(TCL_OK); 00556 } 00557 if (strcmp(argv[1], "setNumPrec") == 0) { 00558 setNumPrec(atoi(argv[2])); 00559 return(TCL_OK); 00560 } 00561 if (strcmp(argv[1], "getAverage") == 0) { 00562 Tcl& tcl = Tcl::instance(); 00563 tcl.resultf("%f", redq_[atoi(argv[2])].getWeightedLength()); 00564 return(TCL_OK); 00565 } 00566 if (strcmp(argv[1], "getStat") == 0) { 00567 Tcl& tcl = Tcl::instance(); 00568 tcl.resultf("%f", getStat(argc,argv)); 00569 return(TCL_OK); 00570 } 00571 if (strcmp(argv[1], "getCurrent") == 0) { 00572 Tcl& tcl = Tcl::instance(); 00573 tcl.resultf("%f", redq_[atoi(argv[2])].getRealLength()*1.0); 00574 return(TCL_OK); 00575 } 00576 if (strcmp(argv[1], "printStats") == 0) { 00577 printStats(); 00578 return (TCL_OK); 00579 } 00580 if (strcmp(argv[1], "printWRRcount") == 0) { 00581 printWRRcount(); 00582 return (TCL_OK); 00583 } 00584 if (strcmp(argv[1], "printPHBTable") == 0) { 00585 printPHBTable(); 00586 return (TCL_OK); 00587 } 00588 if (strcmp(argv[1], "link") == 0) { 00589 Tcl& tcl = Tcl::instance(); 00590 LinkDelay* del = (LinkDelay*) TclObject::lookup(argv[2]); 00591 if (del == 0) { 00592 tcl.resultf("RED: no LinkDelay object %s", 00593 argv[2]); 00594 return(TCL_ERROR); 00595 } 00596 link_ = del; 00597 return (TCL_OK); 00598 } 00599 if (strcmp(argv[1], "early-drop-target") == 0) { 00600 Tcl& tcl = Tcl::instance(); 00601 NsObject* p = (NsObject*)TclObject::lookup(argv[2]); 00602 if (p == 0) { 00603 tcl.resultf("no object %s", argv[2]); 00604 return (TCL_ERROR); 00605 } 00606 de_drop_ = p; 00607 return (TCL_OK); 00608 } 00609 if (strcmp(argv[1], "setSchedularMode") == 0) { 00610 setSchedularMode(argv[2]); 00611 return(TCL_OK); 00612 } 00613 if (strcmp(argv[1], "setMREDMode") == 0) { 00614 if (argc == 3) 00615 setMREDMode(argv[2],0); 00616 else 00617 setMREDMode(argv[2],argv[3]); 00618 return(TCL_OK); 00619 } 00620 if (strcmp(argv[1], "addQueueWeights") == 0) { 00621 addQueueWeights(atoi(argv[2]), atoi(argv[3])); 00622 return(TCL_OK); 00623 } 00624 if (strcmp(argv[1], "addQueueRate") == 0) { 00625 addQueueRate(atoi(argv[2]), atoi(argv[3])); 00626 return(TCL_OK); 00627 } 00628 // Returns the weighted RED queue length for one virtual queue in packets 00629 // Added by Thilo 00630 if (strcmp(argv[1], "getAverageV") == 0) { 00631 Tcl& tcl = Tcl::instance(); 00632 tcl.resultf("%f", 00633 redq_[atoi(argv[2])].getWeightedLength_v(atoi(argv[3]))); 00634 return(TCL_OK); 00635 } 00636 // Returns the length of one virtual queue, in packets 00637 // Added by Thilo 00638 if (strcmp(argv[1], "getCurrentV") == 0) { 00639 Tcl& tcl = Tcl::instance(); 00640 tcl.resultf("%f", 00641 redq_[atoi(argv[2])].getRealLength_v(atoi(argv[3]))*1.0); 00642 return(TCL_OK); 00643 } 00644 00645 return(Queue::command(argc, argv)); 00646 }
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, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. 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, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
|
|
|
Implements Queue< T >. Definition at line 216 of file dsred.cc. References hdr_cmn::access(), hdr_ip::access(), applyTSWMeter(), redQueue::deque(), hdr_ip::flowid(), getCodePt(), lookupPHBTable(), numQueues_, pktcount, queueMaxRate, redq_, schedMode, schedModePRI, selectQueueToDeque(), Queue< T >::size(), redQueue::updateREDStateVar(), and redQueue::updateVREDLen(). 00216 { 00217 Packet *p = NULL; 00218 int queue, prec; 00219 hdr_ip* iph; 00220 int fid; 00221 int dq_id; 00222 00223 // Select queue to deque under the scheduling scheme specified. 00224 dq_id = selectQueueToDeque(); 00225 00226 // Dequeue a packet from the underlying queue: 00227 if (dq_id < numQueues_) 00228 p = redq_[dq_id].deque(); 00229 00230 if (p) { 00231 iph= hdr_ip::access(p); 00232 fid = iph->flowid()/32; 00233 pktcount[dq_id]+=1; 00234 00235 // update the average rate for pri-queue 00236 // Modified by xuanc(xuanc@isi.edu) Oct 18, 2001, 00237 // referring to the patch contributed by 00238 // Sergio Andreozzi <sergio.andreozzi@lut.fi> 00239 // When there is a packet dequeued, 00240 // update the average rate of each queue () 00241 if (schedMode==schedModePRI) 00242 for (int i=0;i<numQueues_;i++) 00243 if (queueMaxRate[i]) 00244 applyTSWMeter(i, (i == dq_id) ? hdr_cmn::access(p)->size() : 0); 00245 00246 // Get the precedence level (or virtual queue id) 00247 // for the packet dequeued. 00248 lookupPHBTable(getCodePt(p), &queue, &prec); 00249 00250 // decrement virtual queue length 00251 // Previously in updateREDStateVar, moved by xuanc (12/03/01) 00252 //redq_[dq_id].qParam_[prec].qlen--; 00253 redq_[dq_id].updateVREDLen(prec); 00254 // update state variables for that "virtual" queue 00255 redq_[dq_id].updateREDStateVar(prec); 00256 } 00257 00258 // Return the dequed packet: 00259 return(p); 00260 }
Here is the call graph for this function: ![]() |
|
|||||||||
|
Definition at line 400 of file mcache.h. References Queue< T >::head_, QueueElem< T >::next_, Queue< T >::size_, and Queue< T >::tail_. Referenced by Queue< T >::detach(), and MediaServer::get_next_segment(). 00400 { 00401 QueueElem<T> *p = head_; 00402 if (head_ != 0) 00403 head_ = head_->next(); 00404 if (head_ == 0) 00405 tail_ = 0; 00406 p->next_ = 0; 00407 size_--; 00408 if (size_ == 0) 00409 assert((head_ == 0) && (tail_ == 0)); 00410 return p; 00411 }
|
|
|||||||||
|
Definition at line 380 of file mcache.h. References Queue< T >::head_, and QueueElem< T >::next(). 00380 { 00381 QueueElem<T> *p = head_, *q; 00382 while (p != NULL) { 00383 q = p; 00384 p = p->next(); 00385 delete q->data(); 00386 delete q; 00387 } 00388 head_ = NULL; 00389 }
Here is the call graph for this function: ![]() |
|
||||||||||
|
Definition at line 412 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(). 00412 { 00413 assert(head_ != 0); 00414 if (head_ == e) { 00415 dequeue(); 00416 return; 00417 } 00418 QueueElem<T> *p = head_; 00419 while (p != NULL) { 00420 if (p->next_ != e) 00421 p = p->next_; 00422 else 00423 break; 00424 } 00425 assert(p != NULL); 00426 p->next_ = e->next_; 00427 if (tail_ == e) 00428 tail_ = p; 00429 size_--; 00430 if (size_ == 0) 00431 assert((head_ == 0) && (tail_ == 0)); 00432 }
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: ![]() |
|
|
|
Definition at line 129 of file dsred.cc. References de_drop_, Connector::drop(), and NsObject::recv(). Referenced by enque(). 00130 { 00131 00132 if (de_drop_ != 0){ 00133 de_drop_->recv(p); 00134 } 00135 else { 00136 drop(p); 00137 } 00138 }
Here is the call graph for this function: ![]() |
|
|
Implements Queue< T >. Reimplemented in edgeQueue. Definition at line 174 of file dsred.cc. References hdr_flags::access(), hdr_ip::access(), hdr_flags::ce(), Connector::drop(), statType::drops, statType::drops_CP, ecn_, hdr_flags::ect(), edrop(), statType::edrops, statType::edrops_CP, lookupPHBTable(), PKT_DROPPED, PKT_EDROPPED, PKT_ENQUEUED, PKT_MARKED, statType::pkts, statType::pkts_CP, hdr_ip::prio(), redq_, and stats. Referenced by edgeQueue::enque(). 00174 { 00175 int codePt, eq_id, prec; 00176 hdr_ip* iph = hdr_ip::access(pkt); 00177 //extracting the marking done by the edge router 00178 codePt = iph->prio(); 00179 int ecn = 0; 00180 00181 //looking up queue and prec numbers for that codept 00182 lookupPHBTable(codePt, &eq_id, &prec); 00183 00184 // code added for ECN support 00185 //hdr_flags* hf = (hdr_flags*)(pkt->access(off_flags_)); 00186 // Changed for the latest version instead of 2.1b6 00187 hdr_flags* hf = hdr_flags::access(pkt); 00188 00189 if (ecn_ && hf->ect()) ecn = 1; 00190 00191 stats.pkts_CP[codePt]++; 00192 stats.pkts++; 00193 00194 switch(redq_[eq_id].enque(pkt, prec, ecn)) { 00195 case PKT_ENQUEUED: 00196 break; 00197 case PKT_DROPPED: 00198 stats.drops_CP[codePt]++; 00199 stats.drops++; 00200 drop(pkt); 00201 break; 00202 case PKT_EDROPPED: 00203 stats.edrops_CP[codePt]++; 00204 stats.edrops++; 00205 edrop(pkt); 00206 break; 00207 case PKT_MARKED: 00208 hf->ce() = 1; // mark Congestion Experienced bit 00209 break; 00210 default: 00211 break; 00212 } 00213 }
Here is the call graph for this function: ![]() |
|
||||||||||
|
Definition at line 391 of file mcache.h. References Queue< T >::head_, Queue< T >::size_, and Queue< T >::tail_. Referenced by MediaServer::get_next_segment(). 00391 { 00392 if (tail_ == 0) 00393 head_ = tail_ = e; 00394 else { 00395 tail_->append(e); 00396 tail_ = e; 00397 } 00398 size_++; 00399 }
|
|
|
Definition at line 263 of file dsred.cc. References hdr_ip::access(), and hdr_ip::prio(). Referenced by deque(). 00263 { 00264 hdr_ip* iph = hdr_ip::access(p); 00265 return(iph->prio()); 00266 }
Here is the call graph for this function: ![]() |
|
|||||||||
|
Definition at line 433 of file mcache.h. References Queue< T >::head_. Referenced by MediaServer::find_prefinfo(). 00433 { return head_; }
|
|
||||||||||||
|
Definition at line 392 of file dsred.cc. References statType::drops, statType::drops_CP, statType::edrops, statType::edrops_CP, statType::pkts, statType::pkts_CP, and stats. 00392 { 00393 00394 if (argc == 3) { 00395 if (strcmp(argv[2], "drops") == 0) 00396 return (stats.drops*1.0); 00397 if (strcmp(argv[2], "edrops") == 0) 00398 return (stats.edrops*1.0); 00399 if (strcmp(argv[2], "pkts") == 0) 00400 return (stats.pkts*1.0); 00401 } 00402 if (argc == 4) { 00403 if (strcmp(argv[2], "drops") == 0) 00404 return (stats.drops_CP[atoi(argv[3])]*1.0); 00405 if (strcmp(argv[2], "edrops") == 0) 00406 return (stats.edrops_CP[atoi(argv[3])]*1.0); 00407 if (strcmp(argv[2], "pkts") == 0) 00408 return (stats.pkts_CP[atoi(argv[3])]*1.0); 00409 } 00410 return -1.0; 00411 }
|
|
|
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 434 of file mcache.h. References Queue< T >::size_. Referenced by MediaServer::command(), and MediaServer::get_next_segment(). 00434 { return (size_ == 0); }
|
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
|||||||||
|
Reimplemented in DRR, and SRR. Definition at line 134 of file queue.h. References PacketQueue::length(), and Queue< T >::pq_. Referenced by XCPQueue::deque(), SimpleIntServ::deque(), XCPQueue::enque(), SimpleIntServ::enque(), XCPQueue::everyRTT(), PriQueue::filter(), XCPQueue::init_vars(), XCPWrapQ::queueToDeque(), REMQueue::run_updaterule(), and Snoop::snoop_data().
Here is the call graph for this function: ![]() |
|
|||||||||
|
Definition at line 133 of file queue.h. References Queue< T >::qlim_. Referenced by Snoop::snoop_data(). 00133 { return qlim_; }
|
|
||||||||||||||||
|
Definition at line 355 of file dsred.cc. References phb_, phbEntries, and phbParam::prec_. Referenced by deque(), and enque(). 00355 { 00356 for (int i = 0; i < phbEntries; i++) { 00357 if (phb_[i].codePt_ == codePt) { 00358 *queue = phb_[i].queue_; 00359 *prec = phb_[i].prec_; 00360 return; 00361 } 00362 } 00363 // quiet the compiler 00364 *queue = 0; 00365 *prec = 0; 00366 printf("ERROR: No match found for code point %d in PHB Table.\n", codePt); 00367 assert (false); 00368 }
|
|
||||||||||
|
Definition at line 176 of file queue.cc. References Queue< T >::blocked_, Scheduler::clock(), Scheduler::instance(), Queue< T >::last_change_, Queue< T >::util_buf_, Queue< T >::util_records_, Queue< T >::utilization(), and Queue< T >::utilUpdate(). Referenced by QSAgent::process(). 00177 { 00178 double now = Scheduler::instance().clock(); 00179 double peak = 0; 00180 int i; 00181 00182 // PS: if peak_utilization tracking is disabled, 00183 // return the weighed avg instead 00184 if (util_records_ == 0) 00185 return utilization(); 00186 00187 utilUpdate(last_change_, now, blocked_); 00188 last_change_ = now; 00189 00190 for (i = 0; i < util_records_; i++) { 00191 if (util_buf_[i] > peak) 00192 peak = util_buf_[i]; 00193 } 00194 return peak; 00195 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 465 of file dsred.cc. References phb_, and phbEntries. 00465 { 00466 printf("PHB Table:\n"); 00467 for (int i = 0; i < phbEntries; i++) 00468 printf("Code Point %d is associated with Queue %d, Precedence %d\n", phb_[i].codePt_, phb_[i].queue_, phb_[i].prec_); 00469 printf("\n"); 00470 }
|
|
|
Definition at line 477 of file dsred.cc. References statType::drops, statType::drops_CP, statType::edrops, statType::edrops_CP, MAX_CP, statType::pkts, statType::pkts_CP, and stats. 00477 { 00478 printf("\nPackets Statistics\n"); 00479 printf("=======================================\n"); 00480 printf(" CP TotPkts TxPkts ldrops edrops\n"); 00481 printf(" -- ------- ------ ------ ------\n"); 00482 printf("All %8ld %8ld %8ld %8ld\n",stats.pkts,stats.pkts-stats.drops-stats.edrops,stats.drops,stats.edrops); 00483 for (int i = 0; i < MAX_CP; i++) 00484 if (stats.pkts_CP[i] != 0) 00485 printf("%3d %8ld %8ld %8ld %8ld\n",i,stats.pkts_CP[i],stats.pkts_CP[i]-stats.drops_CP[i]-stats.edrops_CP[i],stats.drops_CP[i],stats.edrops_CP[i]); 00486 00487 }
|
|
|
Definition at line 490 of file dsred.cc. References numQueues_, pktcount, queueWeight, and slicecount. 00490 { 00491 int i; 00492 for (i = 0; i < numQueues_; i++){ 00493 printf("%d: %d %d %d.\n", i, slicecount[i],pktcount[i],queueWeight[i]); 00494 } 00495 }
|
|
||||||||||||
|
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, PriQueue, and XCPWrapQ. Definition at line 116 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 XCPWrapQ::recv(), and PriQueue::recv(). 00117 { 00118 double now = Scheduler::instance().clock(); 00119 enque(p); 00120 if (!blocked_) { 00121 /* 00122 * We're not blocked. Get a packet and send it on. 00123 * We perform an extra check because the queue 00124 * might drop the packet even if it was 00125 * previously empty! (e.g., RED can do this.) 00126 */ 00127 p = deque(); 00128 if (p != 0) { 00129 utilUpdate(last_change_, now, blocked_); 00130 last_change_ = now; 00131 blocked_ = 1; 00132 target_->recv(p, &qh_); 00133 } 00134 } 00135 }
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().
|
|
|
Reimplemented from Queue< T >. Definition at line 87 of file dsred.cc. References MAX_QUEUES, pktcount, qToDq, queueArrTime, queueAvgRate, slicecount, wirrqDone, and wirrTemp. 00087 { 00088 int i; 00089 00090 qToDq = 0; // q to be dequed, initialized to 0 00091 00092 for(i=0;i<MAX_QUEUES;i++){ 00093 queueAvgRate[i] = 0.0; 00094 queueArrTime[i] = 0.0; 00095 slicecount[i]=0; 00096 pktcount[i]=0; 00097 wirrTemp[i]=0; 00098 wirrqDone[i]=0; 00099 } 00100 00101 stats.drops = 0; 00102 stats.edrops = 0; 00103 stats.pkts = 0; 00104 00105 for(i=0;i<MAX_CP;i++){ 00106 stats.drops_CP[i]=0; 00107 stats.edrops_CP[i]=0; 00108 stats.pkts_CP[i]=0; 00109 } 00110 00111 for (i = 0; i < MAX_QUEUES; i++) 00112 redq_[i].qlim = limit(); 00113 00114 // Compute the "packet time constant" if we know the 00115 // link bandwidth. The ptc is the max number of (avg sized) 00116 // pkts per second which can be placed on the link. 00117 if (link_) 00118 for (int i = 0; i < MAX_QUEUES; i++) 00119 redq_[i].setPTC(link_->bandwidth()); 00120 00121 Queue::reset(); 00122 }
|
|
|||||||||
|
Definition at line 210 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 QueueHandler::handle(). 00211 { 00212 double now = Scheduler::instance().clock(); 00213 Packet* p = deque(); 00214 if (p != 0) { 00215 target_->recv(p, &qh_); 00216 } else { 00217 if (unblock_on_resume_) { 00218 utilUpdate(last_change_, now, blocked_); 00219 last_change_ = now; 00220 blocked_ = 0; 00221 } 00222 else { 00223 utilUpdate(last_change_, now, blocked_); 00224 last_change_ = now; 00225 blocked_ = 1; 00226 } 00227 } 00228 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 269 of file dsred.cc. References redQueue::getRealLength(), numQueues_, qToDq, queuesDone, queueWeight, redq_, schedMode, schedModeRR, schedModeWIRR, schedModeWRR, wirrqDone, and wirrTemp. Referenced by deque(). 00269 { 00270 // If the queue to be dequed has no elements, 00271 // look for the next queue in line 00272 int i = 0; 00273 00274 // Round-Robin 00275 if(schedMode==schedModeRR){ 00276 //printf("RR\n"); 00277 qToDq = ((qToDq + 1) % numQueues_); 00278 while ((i < numQueues_) && (redq_[qToDq].getRealLength() == 0)) { 00279 qToDq = ((qToDq + 1) % numQueues_); 00280 i++; 00281 } 00282 } else if (schedMode==schedModeWRR) { // Weighted Round Robin 00283 if(wirrTemp[qToDq]<=0){ 00284 qToDq = ((qToDq + 1) % numQueues_); 00285 wirrTemp[qToDq] = queueWeight[qToDq] - 1; 00286 } else { 00287 wirrTemp[qToDq] = wirrTemp[qToDq] -1; 00288 } 00289 while ((i < numQueues_) && (redq_[qToDq].getRealLength() == 0)) { 00290 wirrTemp[qToDq] = 0; 00291 qToDq = ((qToDq + 1) % numQueues_); 00292 wirrTemp[qToDq] = queueWeight[qToDq] - 1; 00293 i++; 00294 } 00295 } else if (schedMode==schedModeWIRR) { 00296 qToDq = ((qToDq + 1) % numQueues_); 00297 while ((i<numQueues_) && ((redq_[qToDq].getRealLength()==0) || (wirrqDone[qToDq]))) { 00298 if (!wirrqDone[qToDq]) { 00299 queuesDone++; 00300 wirrqDone[qToDq]=1; 00301 } 00302 qToDq = ((qToDq + 1) % numQueues_); 00303 i++; 00304 } 00305 00306 if (wirrTemp[qToDq] == 1) { 00307 queuesDone +=1; 00308 wirrqDone[qToDq]=1; 00309 } 00310 wirrTemp[qToDq]-=1; 00311 if(queuesDone >= numQueues_) { 00312 queuesDone = 0; 00313 for(i=0;i<numQueues_;i++) { 00314 wirrTemp[i] = queueWeight[i]; 00315 wirrqDone[i]=0; 00316 } 00317 } 00318 } else if (schedMode==schedModePRI) { 00319 // Find the queue with highest priority, which satisfies: 00320 // 1. nozero queue length; and either 00321 // 2.1. has no MaxRate specified; or 00322 // 2.2. has MaxRate specified and 00323 // its average rate is not beyond that limit. 00324 i = 0; 00325 while (i < numQueues_ && 00326 (redq_[i].getRealLength() == 0 || 00327 (queueMaxRate[i] && queueAvgRate[i]>queueMaxRate[i]))){ 00328 i++; 00329 } 00330 qToDq = i; 00331 00332 // If no queue satisfies the condition above, 00333 // find the Queue with highest priority, 00334 // which has packet to dequeue. 00335 // NOTE: the high priority queue can still have its packet dequeued 00336 // even if its average rate has beyond the MAX rate specified! 00337 // Ideally, a NO_PACKET_TO_DEQUEUE should be returned. 00338 if (i == numQueues_) { 00339 i = qToDq = 0; 00340 while ((i < numQueues_) && (redq_[qToDq].getRealLength() == 0)) { 00341 qToDq = ((qToDq + 1) % numQueues_); 00342 i++; 00343 } 00344 } 00345 } 00346 return(qToDq); 00347 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Reimplemented in Agent, and LinkDelay. Definition at line 56 of file connector.h. References NsObject::recv(), and Connector::target_. Referenced by SessionTTLChecker::recv(), TTLChecker::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), SnoopQueueEDrop::recv(), SnoopQueueTagger::recv(), SnoopQueueDrop::recv(), SnoopQueueOut::recv(), SnoopQueueIn::recv(), PktCounter::recv(), NetworkInterface::recv(), MeasureMod::recv(), Filter::recv(), Connector::recv(), CMUTrace::recv(), and AddSR::recv().
Here is the call graph for this function: ![]() |
|
|
Definition at line 51 of file connector.h. References Connector::drop_. Referenced by XCPWrapQ::command(). 00051 {drop_ = dt; }
|
|
||||||||||||
|
Definition at line 436 of file dsred.cc. References dropTail, redQueue::mredMode, redq_, rio_c, rio_d, and wred. 00436 { 00437 int i; 00438 mredModeType tempMode; 00439 00440 if (strcmp(mode, "RIO-C") == 0) 00441 tempMode = rio_c; 00442 else if (strcmp(mode, "RIO-D") == 0) 00443 tempMode = rio_d; 00444 else if (strcmp(mode, "WRED") == 0) 00445 tempMode = wred; 00446 else if (strcmp(mode, "DROP") == 0) 00447 tempMode = dropTail; 00448 else { 00449 printf("Error: MRED mode %s does not exist\n",mode); 00450 return; 00451 } 00452 00453 if (!queue) 00454 for (i = 0; i < MAX_QUEUES; i++) 00455 redq_[i].mredMode = tempMode; 00456 else 00457 redq_[atoi(queue)].mredMode = tempMode; 00458 }
|
|
|
Definition at line 419 of file dsred.cc. References MAX_PREC, numPrec, and redq_. Referenced by command(). 00419 { 00420 int i; 00421 00422 if (prec > MAX_PREC) { 00423 printf("ERROR: Cannot declare more than %d prcedence levels (as defined by MAX_PREC)\n",MAX_PREC); 00424 } else { 00425 numPrec = prec; 00426 00427 for (i = 0; i < MAX_QUEUES; i++) 00428 redq_[i].numPrec = numPrec; 00429 } 00430 }
|
|
|
Definition at line 502 of file dsred.cc. References schedMode, schedModePRI, schedModeRR, schedModeWIRR, and schedModeWRR. 00502 { 00503 if (strcmp(schedtype, "RR") == 0) 00504 schedMode = schedModeRR; 00505 else if (strcmp(schedtype, "WRR") == 0) 00506 schedMode = schedModeWRR; 00507 else if (strcmp(schedtype, "WIRR") == 0) 00508 schedMode = schedModeWIRR; 00509 else if (strcmp(schedtype, "PRI") == 0) 00510 schedMode = schedModePRI; 00511 else 00512 printf("Error: Scheduler type %s does not exist\n",schedtype); 00513 }
|
|
|||||||||
|
Definition at line 435 of file mcache.h. References Queue< T >::size_. Referenced by JoBS::arvAccounting(), REMQueue::deque(), deque(), XCPQueue::do_before_packet_departure(), XCPQueue::do_on_packet_arrival(), JoBS::dropFront(), JoBS::dropTail(), MediaServer::get_next_segment(), and FQ::recv(). 00435 { return size_; }
|
|
|
Definition at line 49 of file connector.h. References Connector::target(), and Connector::target_.
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(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), and Connector::target(). 00048 { return target_; }
|
|
|||||||||
|
Definition at line 131 of file queue.h. References Queue< T >::blocked_. 00131 { blocked_ = 0; }
|
|
||||||||||
|
Definition at line 197 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(). 00198 { 00199 double now = Scheduler::instance().clock(); 00200 double newtime = now - total_time_; 00201 if (newtime > 0.0) { 00202 double oldave = true_ave_; 00203 double oldtime = total_time_; 00204 double newtime = now - total_time_; 00205 true_ave_ = (oldtime * oldave + newtime * queuesize) /now; 00206 total_time_ = now; 00207 } 00208 }
Here is the call graph for this function: ![]() |
|
||||||||||
|
Definition at line 165 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 Queue< T >::peak_utilization(), and QSAgent::process(). 00166 { 00167 double now = Scheduler::instance().clock(); 00168 00169 utilUpdate(last_change_, now, blocked_); 00170 last_change_ = now; 00171 00172 return old_util_; 00173 00174 }
Here is the call graph for this function: ![]() |
|
||||||||||||||||||||
|
Definition at line 137 of file queue.cc. References Queue< T >::buf_slot_, Queue< T >::cur_util_, Queue< T >::old_util_, Queue< T >::period_begin_, Queue< T >::util_buf_, Queue< T >::util_check_intv_, Queue< T >::util_records_, and Queue< T >::util_weight_. Referenced by Queue< T >::peak_utilization(), Queue< T >::recv(), Queue< T >::resume(), and Queue< T >::utilization(). 00137 { 00138 double decay; 00139 00140 decay = exp(-util_weight_ * (int_end - int_begin)); 00141 old_util_ = link_state + (old_util_ - link_state) * decay; 00142 00143 // PS: measuring peak utilization 00144 if (util_records_ == 0) 00145 return; // We don't track peak utilization 00146 00147 double intv = int_end - int_begin; 00148 double tot_intv = int_begin - period_begin_; 00149 if (intv || tot_intv) { 00150 int guard = 0; // for protecting against long while loops 00151 cur_util_ = (link_state * intv + cur_util_ * tot_intv) / 00152 (intv + tot_intv); 00153 while (tot_intv + intv > util_check_intv_ && 00154 guard++ < util_records_) { 00155 00156 period_begin_ = int_end; 00157 util_buf_[buf_slot_] = cur_util_; 00158 buf_slot_ = (buf_slot_ + 1) % util_records_; 00159 cur_util_ = link_state; 00160 intv -= util_check_intv_; 00161 } 00162 } 00163 }
|
|
|||||
|
Definition at line 149 of file queue.h. Referenced by Queue< T >::block(), Queue< T >::blocked(), Queue< T >::peak_utilization(), Queue< T >::Queue(), Queue< T >::recv(), FQ::recv(), CBQueue::recv(), Queue< T >::resume(), CBQueue::sched(), Queue< T >::unblock(), and Queue< T >::utilization(). |
|
|||||
|
Definition at line 168 of file queue.h. Referenced by Queue< T >::utilUpdate(). |
|
|||||
|
Definition at line 167 of file queue.h. Referenced by Queue< T >::utilUpdate(). |
|
|
Definition at line 125 of file dsred.h. Referenced by edrop(). |
|
|
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(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), SctpAgent::Reset(), REDQueue::reset(), DropTail::shrink_queue(), and Delayer::try_send(). |
|
|
Definition at line 59 of file connector.h. Referenced by XCPWrapQ::command(), Connector::command(), Connector::drop(), ErrorModel::recv(), and Connector::setDropTarget(). |
|
|
Definition at line 132 of file dsred.h. Referenced by dsREDQueue(), and enque(). |
|
|||||
|
Definition at line 438 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::destroy(), Queue< T >::detach(), Queue< T >::enqueue(), Queue< T >::getHead(), Queue< T >::reset(), and Queue< T >::~Queue(). |
|
|||||
|
Definition at line 160 of file queue.h. Referenced by Queue< T >::peak_utilization(), Queue< T >::recv(), Queue< T >::resume(), and Queue< T >::utilization(). |
|
|
|
|
|
Definition at line 129 of file dsred.h. Referenced by dsREDQueue(), and setNumPrec(). |
|
|
Definition at line 128 of file dsred.h. Referenced by deque(), dsREDQueue(), printWRRcount(), and selectQueueToDeque(). |
|
|||||
|
Definition at line 161 of file queue.h. Referenced by Queue< T >::utilization(), and Queue< T >::utilUpdate(). |
|
|||||
|
Definition at line 165 of file queue.h. Referenced by Queue< T >::utilUpdate(). |
|
|
Definition at line 130 of file dsred.h. Referenced by addPHBEntry(), lookupPHBTable(), and printPHBTable(). |
|
|
Definition at line 131 of file dsred.h. Referenced by addPHBEntry(), lookupPHBTable(), and printPHBTable(). |
|
|
Definition at line 141 of file dsred.h. Referenced by deque(), printWRRcount(), and reset(). |
|
|||||
|
|||||
|
Definition at line 151 of file queue.h. Referenced by Queue< T >::recv(), FQ::recv(), Queue< T >::resume(), and CBQueue::sched(). |
|
|||||
|
Definition at line 148 of file queue.h. Referenced by Vq::checkPacketForECN(), Vq::enque(), SRR::enque(), RIOQueue::enque(), REMQueue::enque(), REDQueue::enque(), PIQueue::enque(), Marker::enque(), GK::enque(), DropTail::enque(), Demarker::enque(), XCPQueue::limit(), Queue< T >::limit(), RIOQueue::print_edp(), REDQueue::print_edp(), Queue< T >::Queue(), PriQueue::recvHighPriority(), and DropTail::shrink_queue(). |
|
|
Definition at line 127 of file dsred.h. Referenced by reset(), and selectQueueToDeque(). |
|
|
Definition at line 139 of file dsred.h. Referenced by applyTSWMeter(), and reset(). |
|
|
Definition at line 138 of file dsred.h. Referenced by applyTSWMeter(), and reset(). |
|
|
Definition at line 137 of file dsred.h. Referenced by addQueueRate(), deque(), and dsREDQueue(). |
|
|
Definition at line 144 of file dsred.h. Referenced by selectQueueToDeque(). |
|
|
Definition at line 136 of file dsred.h. Referenced by addQueueWeights(), dsREDQueue(), printWRRcount(), and selectQueueToDeque(). |
|
|
Definition at line 124 of file dsred.h. Referenced by command(), deque(), enque(), selectQueueToDeque(), setMREDMode(), and setNumPrec(). |
|
|
Definition at line 134 of file dsred.h. Referenced by deque(), dsREDQueue(), selectQueueToDeque(), and setSchedularMode(). |
|
|||||
|
Definition at line 439 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::detach(), Queue< T >::enqueue(), Queue< T >::is_empty(), and Queue< T >::size(). |
|
|
Definition at line 140 of file dsred.h. Referenced by printWRRcount(), and reset(). |
|
|
Definition at line 126 of file dsred.h. Referenced by addPHBEntry(), enque(), getStat(), and printStats(). |
|
|||||
|
Definition at line 438 of file mcache.h. Referenced by Queue< T >::dequeue(), Queue< T >::detach(), and Queue< T >::enqueue(). |
|
|
|||||
|
Definition at line 156 of file queue.h. Referenced by REDQueue::print_summarystats(), DropTail::print_summarystats(), Queue< T >::reset(), and Queue< T >::updateStats(). |
|
|||||
|
Definition at line 155 of file queue.h. Referenced by REDQueue::print_summarystats(), DropTail::print_summarystats(), Queue< T >::reset(), and Queue< T >::updateStats(). |
|
|||||
|
Definition at line 150 of file queue.h. Referenced by Queue< T >::Queue(), and Queue< T >::resume(). |
|
|||||
|
Definition at line 169 of file queue.h. Referenced by Queue< T >::peak_utilization(), Queue< T >::Queue(), and Queue< T >::utilUpdate(). |
|
|||||
|
Definition at line 163 of file queue.h. Referenced by Queue< T >::Queue(), and Queue< T >::utilUpdate(). |
|
|||||
|
Definition at line 170 of file queue.h. Referenced by Queue< T >::peak_utilization(), Queue< T >::Queue(), and Queue< T >::utilUpdate(). |
|
|||||
|
Definition at line 162 of file queue.h. Referenced by Queue< T >::Queue(), and Queue< T >::utilUpdate(). |
|
|
Definition at line 143 of file dsred.h. Referenced by reset(), and selectQueueToDeque(). |
|
|
Definition at line 142 of file dsred.h. Referenced by reset(), and selectQueueToDeque(). |
1.4.6