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


Public Member Functions | |
| dsREDQueue () | |
| int | command (int argc, const char *const *argv) |
| 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 | length () |
| int | byteLength () |
| virtual double | utilization (void) |
| 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 | |
| void | reset () |
| void | edrop (Packet *p) |
| void | enque (Packet *pkt) |
| Packet * | deque (void) |
| int | getCodePt (Packet *p) |
| int | selectQueueToDeque () |
| void | lookupPHBTable (int codePt, int *queue, int *prec) |
| void | addPHBEntry (int codePt, int queue, int prec) |
| void | setNumPrec (int curPrec) |
| void | setMREDMode (const char *mode, const char *queue) |
| void | printStats () |
| double | getStat (int argc, const char *const *argv) |
| void | printPHBTable () |
| void | setSchedularMode (const char *schedtype) |
| void | addQueueWeights (int queueNum, int weight) |
| void | addQueueRate (int queueNum, int rate) |
| void | printWRRcount () |
| void | applyTSWMeter (int q_id, int pkt_size) |
| 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 | |
| redQueue | redq_ [MAX_QUEUES] |
| NsObject * | de_drop_ |
| statType | stats |
| int | qToDq |
| int | numQueues_ |
| int | numPrec |
| phbParam | phb_ [MAX_CP] |
| int | phbEntries |
| int | ecn_ |
| LinkDelay * | link_ |
| int | schedMode |
| int | queueWeight [MAX_QUEUES] |
| double | queueMaxRate [MAX_QUEUES] |
| double | queueAvgRate [MAX_QUEUES] |
| double | queueArrTime [MAX_QUEUES] |
| int | slicecount [MAX_QUEUES] |
| int | pktcount [MAX_QUEUES] |
| int | wirrTemp [MAX_QUEUES] |
| unsigned char | wirrqDone [MAX_QUEUES] |
| int | queuesDone |
| 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 67 of file dsred.cc. References ecn_, MAX_PREC, MAX_QUEUES, numPrec, numQueues_, phbEntries, queueMaxRate, queuesDone, queueWeight, reset(), 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 } |
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 371 of file dsred.cc. References MAX_CP, phb_, phbEntries, stats, and statType::valid_CP. Referenced by command().
00371 {
00372 if (phbEntries == MAX_CP) {
00373 printf("ERROR: PHB Table size limit exceeded.\n");
00374 } else {
00375 phb_[phbEntries].codePt_ = codePt;
00376 phb_[phbEntries].queue_ = queue;
00377 phb_[phbEntries].prec_ = prec;
00378 stats.valid_CP[codePt] = 1;
00379 phbEntries++;
00380 }
00381 }
|
|
||||||||||||
|
Definition at line 525 of file dsred.cc. References MAX_QUEUES, and queueMaxRate. Referenced by command().
00525 {
00526 if(queueNum < MAX_QUEUES){
00527 // Convert to BYTE/SECOND
00528 queueMaxRate[queueNum]=(double)rate/8.0;
00529 } else {
00530 printf("The queue number is out of range.\n");
00531 }
00532 }
|
|
||||||||||||
|
Definition at line 516 of file dsred.cc. References MAX_QUEUES, and queueWeight. Referenced by command().
00516 {
00517 if(queueNum < MAX_QUEUES){
00518 queueWeight[queueNum]=weight;
00519 } else {
00520 printf("The queue number is out of range.\n");
00521 }
00522 }
|
|
||||||||||||
|
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 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:

|
||||||||||||
|
Reimplemented from Connector. Reimplemented in coreQueue, and edgeQueue. Definition at line 538 of file dsred.cc. References addPHBEntry(), addQueueRate(), addQueueWeights(), Connector::command(), redQueue::config(), de_drop_, getStat(), link_, MAX_QUEUES, printPHBTable(), printStats(), printWRRcount(), redq_, redQueue::setMPS(), setMREDMode(), setNumPrec(), and setSchedularMode(). Referenced by edgeQueue::command(), and coreQueue::command().
00538 {
00539 if (strcmp(argv[1], "configQ") == 0) {
00540 // modification to set the parameter q_w by Thilo
00541 redq_[atoi(argv[2])].config(atoi(argv[3]), argc, argv);
00542 return(TCL_OK);
00543 }
00544 if (strcmp(argv[1], "addPHBEntry") == 0) {
00545 addPHBEntry(atoi(argv[2]), atoi(argv[3]), atoi(argv[4]));
00546 return (TCL_OK);
00547 }
00548 if (strcmp(argv[1], "meanPktSize") == 0) {
00549 for (int i = 0; i < MAX_QUEUES; i++)
00550 redq_[i].setMPS(atoi(argv[2]));
00551 return(TCL_OK);
00552 }
00553 if (strcmp(argv[1], "setNumPrec") == 0) {
00554 setNumPrec(atoi(argv[2]));
00555 return(TCL_OK);
00556 }
00557 if (strcmp(argv[1], "getAverage") == 0) {
00558 Tcl& tcl = Tcl::instance();
00559 tcl.resultf("%f", redq_[atoi(argv[2])].getWeightedLength());
00560 return(TCL_OK);
00561 }
00562 if (strcmp(argv[1], "getStat") == 0) {
00563 Tcl& tcl = Tcl::instance();
00564 tcl.resultf("%f", getStat(argc,argv));
00565 return(TCL_OK);
00566 }
00567 if (strcmp(argv[1], "getCurrent") == 0) {
00568 Tcl& tcl = Tcl::instance();
00569 tcl.resultf("%f", redq_[atoi(argv[2])].getRealLength()*1.0);
00570 return(TCL_OK);
00571 }
00572 if (strcmp(argv[1], "printStats") == 0) {
00573 printStats();
00574 return (TCL_OK);
00575 }
00576 if (strcmp(argv[1], "printWRRcount") == 0) {
00577 printWRRcount();
00578 return (TCL_OK);
00579 }
00580 if (strcmp(argv[1], "printPHBTable") == 0) {
00581 printPHBTable();
00582 return (TCL_OK);
00583 }
00584 if (strcmp(argv[1], "link") == 0) {
00585 Tcl& tcl = Tcl::instance();
00586 LinkDelay* del = (LinkDelay*) TclObject::lookup(argv[2]);
00587 if (del == 0) {
00588 tcl.resultf("RED: no LinkDelay object %s",
00589 argv[2]);
00590 return(TCL_ERROR);
00591 }
00592 link_ = del;
00593 return (TCL_OK);
00594 }
00595 if (strcmp(argv[1], "early-drop-target") == 0) {
00596 Tcl& tcl = Tcl::instance();
00597 NsObject* p = (NsObject*)TclObject::lookup(argv[2]);
00598 if (p == 0) {
00599 tcl.resultf("no object %s", argv[2]);
00600 return (TCL_ERROR);
00601 }
00602 de_drop_ = p;
00603 return (TCL_OK);
00604 }
00605 if (strcmp(argv[1], "setSchedularMode") == 0) {
00606 setSchedularMode(argv[2]);
00607 return(TCL_OK);
00608 }
00609 if (strcmp(argv[1], "setMREDMode") == 0) {
00610 if (argc == 3)
00611 setMREDMode(argv[2],0);
00612 else
00613 setMREDMode(argv[2],argv[3]);
00614 return(TCL_OK);
00615 }
00616 if (strcmp(argv[1], "addQueueWeights") == 0) {
00617 addQueueWeights(atoi(argv[2]), atoi(argv[3]));
00618 return(TCL_OK);
00619 }
00620 if (strcmp(argv[1], "addQueueRate") == 0) {
00621 addQueueRate(atoi(argv[2]), atoi(argv[3]));
00622 return(TCL_OK);
00623 }
00624 // Returns the weighted RED queue length for one virtual queue in packets
00625 // Added by Thilo
00626 if (strcmp(argv[1], "getAverageV") == 0) {
00627 Tcl& tcl = Tcl::instance();
00628 tcl.resultf("%f",
00629 redq_[atoi(argv[2])].getWeightedLength_v(atoi(argv[3])));
00630 return(TCL_OK);
00631 }
00632 // Returns the length of one virtual queue, in packets
00633 // Added by Thilo
00634 if (strcmp(argv[1], "getCurrentV") == 0) {
00635 Tcl& tcl = Tcl::instance();
00636 tcl.resultf("%f",
00637 redq_[atoi(argv[2])].getRealLength_v(atoi(argv[3]))*1.0);
00638 return(TCL_OK);
00639 }
00640
00641 return(Queue::command(argc, argv));
00642 }
|
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 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(), and Queue< T >::size().
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 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:

|
|
Definition at line 129 of file dsred.cc. References de_drop_, Connector::drop(), and NsObject::recv(). Referenced by enque().
|
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, redQueue::enque(), 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 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 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 411 of file mcache.h. References Queue< T >::head_. Referenced by MediaServer::find_prefinfo().
00411 { return head_; }
|
|
||||||||||||
|
Definition at line 388 of file dsred.cc. References statType::drops, statType::drops_CP, statType::edrops, statType::edrops_CP, statType::pkts, statType::pkts_CP, and stats. Referenced by command().
00388 {
00389
00390 if (argc == 3) {
00391 if (strcmp(argv[2], "drops") == 0)
00392 return (stats.drops*1.0);
00393 if (strcmp(argv[2], "edrops") == 0)
00394 return (stats.edrops*1.0);
00395 if (strcmp(argv[2], "pkts") == 0)
00396 return (stats.pkts*1.0);
00397 }
00398 if (argc == 4) {
00399 if (strcmp(argv[2], "drops") == 0)
00400 return (stats.drops_CP[atoi(argv[3])]*1.0);
00401 if (strcmp(argv[2], "edrops") == 0)
00402 return (stats.edrops_CP[atoi(argv[3])]*1.0);
00403 if (strcmp(argv[2], "pkts") == 0)
00404 return (stats.pkts_CP[atoi(argv[3])]*1.0);
00405 }
00406 return -1.0;
00407 }
|
|
|
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 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 in DRR, and SRR. Definition at line 133 of file queue.h. References PacketQueue::length(), and Queue< T >::pq_. Referenced by REMQueue::run_updaterule(), Snoop::snoop_data(), and JoBS::updateStats().
|
Here is the call graph for this function:

|
|||||||||
|
Definition at line 132 of file queue.h. References Queue< T >::qlim_. Referenced by reset(), and Snoop::snoop_data().
00132 { return qlim_; }
|
|
||||||||||||||||
|
Definition at line 355 of file dsred.cc. References phbParam::codePt_, phb_, phbEntries, and phbParam::queue_. 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 printf("ERROR: No match found for code point %d in PHB Table.\n", codePt);
00364 }
|
|
|
Definition at line 461 of file dsred.cc. References phb_, and phbEntries. Referenced by command().
00461 {
00462 printf("PHB Table:\n");
00463 for (int i = 0; i < phbEntries; i++)
00464 printf("Code Point %d is associated with Queue %d, Precedence %d\n", phb_[i].codePt_, phb_[i].queue_, phb_[i].prec_);
00465 printf("\n");
00466 }
|
|
|
Definition at line 473 of file dsred.cc. References statType::drops, statType::drops_CP, statType::edrops, statType::edrops_CP, MAX_CP, statType::pkts, statType::pkts_CP, and stats. Referenced by command().
00473 {
00474 printf("\nPackets Statistics\n");
00475 printf("=======================================\n");
00476 printf(" CP TotPkts TxPkts ldrops edrops\n");
00477 printf(" -- ------- ------ ------ ------\n");
00478 printf("All %8ld %8ld %8ld %8ld\n",stats.pkts,stats.pkts-stats.drops-stats.edrops,stats.drops,stats.edrops);
00479 for (int i = 0; i < MAX_CP; i++)
00480 if (stats.pkts_CP[i] != 0)
00481 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]);
00482
00483 }
|
|
|
Definition at line 486 of file dsred.cc. References numQueues_, pktcount, queueWeight, and slicecount. Referenced by command().
00486 {
00487 int i;
00488 for (i = 0; i < numQueues_; i++){
00489 printf("%d: %d %d %d.\n", i, slicecount[i],pktcount[i],queueWeight[i]);
00490 }
00491 }
|
|
||||||||||||
|
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 Queue< T >. Definition at line 87 of file dsred.cc. References LinkDelay::bandwidth(), statType::drops, statType::drops_CP, statType::edrops, statType::edrops_CP, Queue< T >::limit(), link_, MAX_CP, MAX_QUEUES, pktcount, statType::pkts, statType::pkts_CP, redQueue::qlim, qToDq, queueArrTime, queueAvgRate, redq_, Queue< T >::reset(), redQueue::setPTC(), slicecount, stats, wirrqDone, and wirrTemp. Referenced by dsREDQueue().
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 }
|
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:

|
|
Definition at line 269 of file dsred.cc. References redQueue::getRealLength(), numQueues_, qToDq, queueAvgRate, queueMaxRate, queuesDone, queueWeight, redq_, schedMode, schedModePRI, 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 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 432 of file dsred.cc. References dropTail, MAX_QUEUES, redQueue::mredMode, mredModeType, redq_, rio_c, rio_d, and wred. Referenced by command().
00432 {
00433 int i;
00434 mredModeType tempMode;
00435
00436 if (strcmp(mode, "RIO-C") == 0)
00437 tempMode = rio_c;
00438 else if (strcmp(mode, "RIO-D") == 0)
00439 tempMode = rio_d;
00440 else if (strcmp(mode, "WRED") == 0)
00441 tempMode = wred;
00442 else if (strcmp(mode, "DROP") == 0)
00443 tempMode = dropTail;
00444 else {
00445 printf("Error: MRED mode %s does not exist\n",mode);
00446 return;
00447 }
00448
00449 if (!queue)
00450 for (i = 0; i < MAX_QUEUES; i++)
00451 redq_[i].mredMode = tempMode;
00452 else
00453 redq_[atoi(queue)].mredMode = tempMode;
00454 }
|
|
|
Definition at line 415 of file dsred.cc. References MAX_PREC, MAX_QUEUES, redQueue::numPrec, numPrec, and redq_. Referenced by command().
|
|
|
Definition at line 498 of file dsred.cc. References schedMode, schedModePRI, schedModeRR, schedModeWIRR, and schedModeWRR. Referenced by command().
00498 {
00499 if (strcmp(schedtype, "RR") == 0)
00500 schedMode = schedModeRR;
00501 else if (strcmp(schedtype, "WRR") == 0)
00502 schedMode = schedModeWRR;
00503 else if (strcmp(schedtype, "WIRR") == 0)
00504 schedMode = schedModeWIRR;
00505 else if (strcmp(schedtype, "PRI") == 0)
00506 schedMode = schedModePRI;
00507 else
00508 printf("Error: Scheduler type %s does not exist\n",schedtype);
00509 }
|
|
|||||||||
|
Definition at line 413 of file mcache.h. References Queue< T >::size_. Referenced by JoBS::arvAccounting(), JoBS::assignRateDropsADC(), 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(). |
|
|
|
|
|
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 132 of file dsred.h. Referenced by dsREDQueue(), and enque(). |
|
|||||
|
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 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 155 of file queue.h. Referenced by Queue< T >::utilization(), and 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(), dsREDQueue(), lookupPHBTable(), and printPHBTable(). |
|
|
Definition at line 141 of file dsred.h. Referenced by deque(), printWRRcount(), and reset(). |
|
|||||
|
|||||
|
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 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(), reset(), and selectQueueToDeque(). |
|
|
Definition at line 137 of file dsred.h. Referenced by addQueueRate(), deque(), dsREDQueue(), and selectQueueToDeque(). |
|
|
Definition at line 144 of file dsred.h. Referenced by dsREDQueue(), and 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(), reset(), selectQueueToDeque(), setMREDMode(), and setNumPrec(). |
|
|
Definition at line 134 of file dsred.h. Referenced by deque(), dsREDQueue(), selectQueueToDeque(), and setSchedularMode(). |
|
|||||
|
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 140 of file dsred.h. Referenced by printWRRcount(), and reset(). |
|
|
Definition at line 126 of file dsred.h. Referenced by addPHBEntry(), enque(), getStat(), printStats(), and reset(). |
|
|||||
|
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(). |
|
|
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.3.3