#include <pushback.h>
Inheritance diagram for PushbackAgent:


Public Member Functions | |
| PushbackAgent () | |
| int | command (int argc, const char *const *argv) |
| void | reportDrop (int qid, Packet *p) |
| void | timeout (PushbackEvent *event) |
| void | identifyAggregate (int qid, double arrRate, double linkBW) |
| void | resetDropLog (int qid) |
| void | recv (Packet *p, Handler *) |
| void | calculateLowerBound (int qid, double arrRate) |
| void | printMsg (char *msg, int msgLevel) |
| virtual void | recv (Packet *p, const char *s) |
| void | recvOnly (Packet *) |
| void | send (Packet *p, Handler *h) |
| virtual void | send (int sz, AppData *data) |
| virtual void | send (int nbytes) |
| virtual void | timeout (int tno) |
| virtual void | sendmsg (int sz, AppData *, const char *flags=0) |
| virtual void | sendmsg (int nbytes, const char *flags=0) |
| virtual void | sendto (int sz, AppData *, const char *flags, nsaddr_t dst) |
| virtual void | sendto (int nbytes, const char *flags, nsaddr_t dst) |
| virtual void | connect (nsaddr_t dst) |
| virtual void | close () |
| virtual void | listen () |
| virtual void | attachApp (Application *app) |
| virtual int & | size () |
| nsaddr_t & | addr () |
| nsaddr_t & | port () |
| nsaddr_t & | daddr () |
| nsaddr_t & | dport () |
| void | set_pkttype (packet_t pkttype) |
| packet_t | get_pkttype () |
| NsObject * | target () |
| virtual void | drop (Packet *p) |
| int | isdebug () const |
| virtual void | debug (const char *fmt,...) |
Static Public Member Functions | |
| int | mergerAccept (int count, int bits, int bitsDiff) |
Public Attributes | |
| int | last_index_ |
| int | verbose_ |
| int | intResult_ |
| int | debugLevel |
| char | prnMsg [500] |
| Node * | node_ |
Protected Member Functions | |
| void | initialUpdate (RateLimitSession *rls) |
| void | pushbackCheck (RateLimitSession *rls) |
| void | pushbackStatus (RateLimitSession *rls) |
| void | pushbackRefresh (int qid) |
| void | pushbackCancel (RateLimitSession *rls) |
| void | processPushbackRequest (PushbackRequestMessage *msg) |
| void | processPushbackStatus (PushbackStatusMessage *msg) |
| void | processPushbackRefresh (PushbackRefreshMessage *msg) |
| void | processPushbackCancel (PushbackCancelMessage *msg) |
| void | refreshUpstreamLimits (RateLimitSession *rls) |
| int | getQID (int sender) |
| int | checkQID (int qid) |
| void | sendMsg (PushbackMessage *msg) |
| virtual void | delay_bind_init_all () |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | recvBytes (int bytes) |
| virtual void | idle () |
| Packet * | allocpkt () const |
| Packet * | allocpkt (int) const |
| void | initpkt (Packet *) const |
| virtual void | trace (TracedVar *v) |
| void | deleteAgentTrace () |
| void | addAgentTrace (const char *name) |
| void | monitorAgentTrace () |
| OldValue * | lookupOldValue (TracedVar *v) |
| void | insertOldValue (TracedVar *v, const char *value) |
| void | dumpTracedVars () |
| virtual void | trace_event (char *eventtype) |
| virtual void | drop (Packet *p, const char *s) |
| virtual void | reset () |
| void | handle (Event *) |
Protected Attributes | |
| int | enable_pushback_ |
| queue_rec | queue_list_ [MAX_QUEUES] |
| double | requiredLimit_ |
| RouteLogic * | rtLogic_ |
| PushbackTimer * | timer_ |
| ns_addr_t | here_ |
| ns_addr_t | dst_ |
| int | size_ |
| packet_t | type_ |
| int | fid_ |
| int | prio_ |
| int | flags_ |
| int | defttl_ |
| Tcl_Channel | channel_ |
| char * | traceName_ |
| OldValue * | oldValueList_ |
| Application * | app_ |
| EventTrace * | et_ |
| NsObject * | target_ |
| NsObject * | drop_ |
| int | debug_ |
Static Protected Attributes | |
| int | uidcnt_ |
|
|
Definition at line 65 of file pushback.cc. References debugLevel, enable_pushback_, intResult_, last_index_, PT_PUSHBACK, timer_, and verbose_.
00065 : Agent(PT_PUSHBACK), last_index_(0), intResult_(-1) { 00066 00067 bind("last_index_", &last_index_); 00068 bind("intResult_", &intResult_); 00069 bind_bool("enable_pushback_", &enable_pushback_); 00070 bind_bool("verbose_", &verbose_); 00071 timer_ = new PushbackTimer(this); 00072 debugLevel = 3; 00073 // debugLevel = 0; 00074 } |
|
|
Definition at line 326 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Scheduler::clock(), Agent::dst_, Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command().
00327 {
00328 char wrk[256];
00329 int n;
00330 double curTime = (&Scheduler::instance() == NULL ? 0 :
00331 Scheduler::instance().clock());
00332
00333 sprintf(wrk, "a -t "TIME_FORMAT" -s %d -d %d -n %s",
00334 curTime, here_.addr_, dst_.addr_, name);
00335 n = strlen(wrk);
00336 wrk[n] = '\n';
00337 wrk[n+1] = 0;
00338 if (channel_)
00339 (void)Tcl_Write(channel_, wrk, n+1);
00340 // keep agent trace name
00341 if (traceName_ != NULL)
00342 delete[] traceName_;
00343 traceName_ = new char[strlen(name)+1];
00344 strcpy(traceName_, name);
00345 }
|
Here is the call graph for this function:

|
|
|
Definition at line 517 of file agent.cc. References Packet::allocdata(), and Agent::allocpkt().
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Definition at line 372 of file agent.cc. References Agent::app_. Referenced by HttpMInvalCache::command(), Application::command(), TcpApp::TcpApp(), and TcpApp::~TcpApp().
00373 {
00374 app_ = app;
00375 }
|
|
||||||||||||
|
Definition at line 144 of file pushback.cc. References cluster::bits_, IdentStruct::calculateLowerBound(), checkQID(), AggReturn::clusterList_, cluster::count_, AggReturn::finalIndex_, queue_rec::idTree_, node_, Node::nodeid(), cluster::prefix_, printMsg(), prnMsg, queue_list_, and AggReturn::totalCount_. Referenced by PushbackQueue::timeout().
00144 {
00145
00146 if (!checkQID(qid)) {
00147 sprintf(prnMsg, "Got invalid id from queue in identifyAggregate\n");
00148 printMsg(prnMsg,0);
00149 exit(-1);
00150 }
00151
00152 AggReturn * aggReturn = queue_list_[qid].idTree_->calculateLowerBound();
00153 if (aggReturn == NULL) {
00154 //not sure what to do here.
00155 //maybe lower bound should be left as it is
00156
00157 return;
00158 }
00159
00160 double lowerBound = 0;
00161 int i = 0;
00162 for (; i <= aggReturn->finalIndex_; i++) {
00163 cluster currCluster = aggReturn->clusterList_[i];
00164 AggSpec * aggSpec = new AggSpec(1, currCluster.prefix_, currCluster.bits_);
00165 RateLimitSession * rls1 =
00166 queue_list_[qid].pbq_->rlsList_->containsLocalAggSpec(aggSpec, node_->nodeid());
00167 if (rls1 !=NULL) continue;
00168 lowerBound = (currCluster.count_)*(arrRate/aggReturn->totalCount_);
00169 sprintf(prnMsg, "LB: count: %d totalCount_: %d arrRate: %g\n", currCluster.count_, aggReturn->totalCount_, arrRate);
00170 printMsg(prnMsg,0);
00171 break;
00172 }
00173
00174 if (i == aggReturn->finalIndex_+1) {
00175 sprintf(prnMsg, "Warning: All clusters being rate limited\n");
00176 printMsg(prnMsg,0);
00177 //exit(-1);
00178 }
00179
00180 queue_list_[qid].idTree_->setLowerBound(lowerBound, 1);
00181
00182 delete(aggReturn);
00183 }
|
Here is the call graph for this function:

|
|
Definition at line 976 of file pushback.cc. References last_index_. Referenced by calculateLowerBound(), identifyAggregate(), processPushbackStatus(), reportDrop(), and resetDropLog().
00976 {
00977 if (qid < 0 || qid >= last_index_)
00978 return 0;
00979 else
00980 return 1;
00981 }
|
|
|
Reimplemented in FullTcpAgent. Definition at line 377 of file agent.cc. Referenced by Agent::command().
00378 {
00379 }
|
|
||||||||||||
|
Reimplemented from Agent. Definition at line 77 of file pushback.cc. References Node::address(), Agent::command(), queue_rec::idTree_, last_index_, MAX_QUEUES, node_, Node::nodeid(), queue_rec::pbq_, printMsg(), prnMsg, queue_list_, rtLogic_, and verbose_.
00077 {
00078
00079 Tcl& tcl = Tcl::instance();
00080 if (argc == 4 ) {
00081 if (strcmp(argv[1], "initialize") == 0) {
00082 //get the node and routeLogic object
00083 node_ = (Node *)TclObject::lookup(argv[2]);
00084 rtLogic_ = (RouteLogic *)TclObject::lookup(argv[3]);
00085
00086 if (node_ == NULL || rtLogic_ == NULL) {
00087 if (verbose_) printf("Improper Initialization for Pushback Agent\n");
00088 return(TCL_ERROR);
00089 }
00090
00091 sprintf(prnMsg, "node=%s rtLogic=%s id=%d address=%d\n", node_->name(),
00092 rtLogic_->name(), node_->nodeid(), node_->address());
00093 printMsg(prnMsg,0);
00094
00095 return(TCL_OK);
00096 }
00097 }
00098 else if (argc == 3) {
00099 //$pba add-queue $queue
00100 if (strcmp(argv[1], "add-queue") == 0) {
00101 if (last_index_==MAX_QUEUES) {
00102 printf("queue list size exhausted - recompile with a bigger MAX_QUEUES\n");
00103 exit(-1);
00104 }
00105 PushbackQueue * queue = (PushbackQueue *) TclObject::lookup(argv[2]);
00106 if (queue == NULL) {
00107 printf("NULL queue passed \n");
00108 exit(-1);
00109 }
00110
00111 int index = last_index_++;
00112 queue_list_[index].pbq_ = queue;
00113 queue_list_[index].idTree_ = new IdentStruct();
00114
00115 tcl.resultf("%d", index);
00116 return (TCL_OK);
00117 }
00118 }
00119 return (Agent::command(argc, argv));
00120 }
|
Here is the call graph for this function:

|
|
Definition at line 389 of file agent.cc. Referenced by Agent::command().
00390 {
00391 /*
00392 dst_ = dst;
00393 */
00394 }
|
|
|
||||||||||||
|
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 from NsObject. Reimplemented in BayFullTcpAgent, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 93 of file agent.cc. References ns_addr_t::addr_, Agent::defttl_, NsObject::delay_bind_dispatch(), Agent::dst_, Agent::fid_, Agent::flags_, Agent::here_, ns_addr_t::port_, and Agent::prio_. Referenced by TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), and LDPAgent::delay_bind_dispatch().
00094 {
00095 if (delay_bind(varName, localName, "agent_addr_", (int*)&(here_.addr_), tracer)) return TCL_OK;
00096 if (delay_bind(varName, localName, "agent_port_", (int*)&(here_.port_), tracer)) return TCL_OK;
00097 if (delay_bind(varName, localName, "dst_addr_", (int*)&(dst_.addr_), tracer)) return TCL_OK;
00098 if (delay_bind(varName, localName, "dst_port_", (int*)&(dst_.port_), tracer)) return TCL_OK;
00099 if (delay_bind(varName, localName, "fid_", (int*)&fid_, tracer)) return TCL_OK;
00100 if (delay_bind(varName, localName, "prio_", (int*)&prio_, tracer)) return TCL_OK;
00101 if (delay_bind(varName, localName, "flags_", (int*)&flags_, tracer)) return TCL_OK;
00102 if (delay_bind(varName, localName, "ttl_", &defttl_, tracer)) return TCL_OK;
00103 if (delay_bind(varName, localName, "class_", (int*)&fid_, tracer)) return TCL_OK;
00104 return Connector::delay_bind_dispatch(varName, localName, tracer);
00105 }
|
Here is the call graph for this function:

|
|
Reimplemented from NsObject. Reimplemented in BayFullTcpAgent, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 78 of file agent.cc. References NsObject::delay_bind_init_all(). Referenced by TcpAgent::delay_bind_init_all(), TcpSink::delay_bind_init_all(), and LDPAgent::delay_bind_init_all().
00079 {
00080 delay_bind_init_one("agent_addr_");
00081 delay_bind_init_one("agent_port_");
00082 delay_bind_init_one("dst_addr_");
00083 delay_bind_init_one("dst_port_");
00084 delay_bind_init_one("fid_");
00085 delay_bind_init_one("prio_");
00086 delay_bind_init_one("flags_");
00087 delay_bind_init_one("ttl_");
00088 delay_bind_init_one("class_");
00089 Connector::delay_bind_init_all();
00090 }
|
Here is the call graph for this function:

|
|
Definition at line 222 of file agent.cc. References ns_addr_t::addr_, Agent::dst_, Agent::flushAVar(), Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command().
00223 {
00224 char wrk[256];
00225
00226 // XXX we don't know InstVar outside of Tcl! Is there any
00227 // tracedvars hidden in InstVar? If so, shall we have a tclclInt.h?
00228 TracedVar* var = tracedvar_;
00229 for ( ; var != 0; var = var->next_)
00230 flushAVar(var);
00231
00232 // we need to flush all var values to trace file,
00233 // so nam can do backtracing
00234 sprintf(wrk, "a -t "TIME_FORMAT" -s %d -d %d -n %s -x",
00235 Scheduler::instance().clock(), here_.addr_,
00236 dst_.addr_, traceName_);
00237 if (traceName_ != NULL)
00238 delete[] traceName_;
00239 traceName_ = NULL;
00240 }
|
Here is the call graph for this function:

|
|
Definition at line 99 of file agent.h. References Agent::dst_, nsaddr_t, and ns_addr_t::port_. Referenced by DSDV_Agent::lost_link(), TcpAsymSink::recv(), CtrMcastEncap::recv(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), rtProtoDV::sendpkt(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().
|
|
||||||||||||
|
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 101 of file agent.h. References packet_t, and Agent::type_. Referenced by CBR_Traffic::init().
00101 { return type_; }
|
|
|
Definition at line 920 of file pushback.cc. References intResult_, last_index_, node_, Node::nodeid(), queue_rec::pbq_, printMsg(), prnMsg, and queue_list_. Referenced by processPushbackCancel(), processPushbackRefresh(), and processPushbackRequest().
00920 {
00921
00922 Tcl& tcl = Tcl::instance();
00923 intResult_ = -1;
00924 int index = 0;
00925 // there gotta be better ways of doing this; todoLater.
00926 // like make Tcl call you back and set a variable using command.
00927 for (; index <last_index_; index++) {
00928 tcl.evalf("%s set intResult_ [%s check-queue %d %d %s]", name(), name(),
00929 node_->nodeid(), sender , queue_list_[index].pbq_->name());
00930 if (intResult_ == 1) break;
00931 }
00932
00933 if (index == last_index_) {
00934 sprintf(prnMsg, " right queue not found\n");
00935 printMsg(prnMsg,0);
00936 exit(-1);
00937 }
00938
00939 return index;
00940 }
|
Here is the call graph for this function:

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

|
||||||||||||||||
|
Definition at line 186 of file pushback.cc. References cluster::bits_, checkQID(), AggReturn::clusterList_, PushbackTimer::containsRefresh(), cluster::count_, AggReturn::finalIndex_, queue_rec::idTree_, INITIAL_UPDATE_EVENT, INITIAL_UPDATE_TIME, PushbackTimer::insert(), AggReturn::limit_, RateLimitSession::lowerBound_, MAX_SESSIONS, node_, Node::nodeid(), RateLimitSessionList::noMySessions(), queue_rec::pbq_, cluster::prefix_, AggSpec::print(), printMsg(), prnMsg, PUSHBACK_CYCLE_TIME, PUSHBACK_REFRESH_EVENT, queue_list_, RATE_LIMIT_TIME_DEFAULT, RateLimitSession::refreshed(), PushbackQueue::rlsList_, rtLogic_, timer_, AggReturn::totalCount_, IdentStruct::traverse(), and verbose_. Referenced by PushbackQueue::timeout().
00186 {
00187
00188 //set up refresh timer for this queue, if this is the firstime you come here.
00189 if (!timer_->containsRefresh(qid)) {
00190 PushbackEvent * event = new PushbackEvent(PUSHBACK_CYCLE_TIME, PUSHBACK_REFRESH_EVENT, qid);
00191 timer_->insert(event);
00192 }
00193
00194 // if (debug_)
00195 sprintf(prnMsg, "identifyAggregate for %d\n", qid);
00196 printMsg(prnMsg,0);
00197
00198 if (!checkQID(qid)) {
00199 sprintf(prnMsg, "Got invalid id from queue in identifyAggregate\n");
00200 printMsg(prnMsg,0);
00201 exit(-1);
00202 }
00203 if (verbose_) queue_list_[qid].idTree_->traverse();
00204
00205 //this is a quick way of achieving this.
00206 //but it can be justified on some grounds. will do a check with Sally later.
00207 int noSessions = queue_list_[qid].pbq_->rlsList_->noMySessions(node_->nodeid());
00208 // if (noSessions >= MAX_SESSIONS) {
00209 // sprintf(prnMsg, "My hands are full\n");
00210 // printMsg(prnMsg,0);
00211 // return;
00212 // }
00213
00214 AggReturn * aggReturn = queue_list_[qid].idTree_->identifyAggregate(arrRate, linkBW);
00215 if (aggReturn == NULL) return;
00216
00217 for (int i=0; i<=aggReturn->finalIndex_; i++) {
00218 cluster currCluster = aggReturn->clusterList_[i];
00219 AggSpec * aggSpec = new AggSpec(1, currCluster.prefix_, currCluster.bits_);
00220
00221 //don't insert the same aggregate again.
00222 RateLimitSession * rls1 =
00223 queue_list_[qid].pbq_->rlsList_->containsLocalAggSpec(aggSpec, node_->nodeid());
00224 if (rls1 != NULL) {
00225 sprintf(prnMsg, "got subset aggregate. Lowerbound = %g. agg = ", aggReturn->limit_);
00226 printMsg(prnMsg,0);
00227 aggSpec->print(); fflush(stdout);
00228 delete(aggSpec);
00229 //this could keep the lowerbound unnecessarily down.
00230 //but don't be sympathetic with aggregates, which have been identified again.
00231 if (aggReturn->limit_ < rls1->lowerBound_) {
00232 rls1->lowerBound_ = aggReturn->limit_;
00233 }
00234 //set the last misbehavior signal.
00235 rls1->refreshed();
00236 continue;
00237 }
00238
00239 double estimate = (currCluster.count_)*(arrRate/aggReturn->totalCount_);
00240
00241 if (noSessions >= MAX_SESSIONS) {
00242 int rank = queue_list_[qid].pbq_->rlsList_->rankRate(node_->nodeid(), estimate);
00243 if (rank >= MAX_SESSIONS) {
00244 sprintf(prnMsg, "got rate <= minRate. agg = ");
00245 printMsg(prnMsg,0);aggSpec->print(); fflush(stdout);
00246 delete(aggSpec);
00247 continue;
00248 }
00249 }
00250
00251 sprintf(prnMsg, "starting rate-limiting lower=%g estimate=%g agg ",
00252 aggReturn->limit_, estimate);
00253 printMsg(prnMsg,0);
00254 aggSpec->print(); fflush(stdout);
00255
00256 double initialLimit = estimate; //*(1 - ambientDropRate);
00257 RateLimitSession * rls = new RateLimitSession(aggSpec, estimate, 1, initialLimit,
00258 node_->nodeid(), qid,
00259 RATE_LIMIT_TIME_DEFAULT, aggReturn->limit_,
00260 node_, rtLogic_);
00261 queue_list_[qid].pbq_->rlsList_->insert(rls);
00262
00263 PushbackEvent * event = new PushbackEvent(INITIAL_UPDATE_TIME, INITIAL_UPDATE_EVENT, rls);
00264 timer_->insert(event);
00265 // }
00266
00267 noSessions++;
00268 }
00269
00270 queue_list_[qid].idTree_->setLowerBound(aggReturn->limit_, 0);
00271 delete(aggReturn);
00272 }
|
Here is the call graph for this function:

|
|
Definition at line 363 of file agent.cc. References Agent::app_, and Application::resume(). Referenced by FullTcpAgent::foutput(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), UdpAgent::sendmsg(), SA_Agent::sendmsg(), and RTPAgent::sendmsg().
|
Here is the call graph for this function:

|
|
Definition at line 310 of file pushback.cc. References Scheduler::clock(), LoggingDataStruct::count_, enable_pushback_, RateLimitSession::getArrivalRateForStatus(), RateLimitSession::getDropRate(), INITIAL_UPDATE_EVENT, INITIAL_UPDATE_TIME, RateLimitSession::initialPhase_, PushbackTimer::insert(), Scheduler::instance(), RateLimitSession::localQID_, RateLimitSession::logData_, RateLimitSession::lowerBound_, printMsg(), prnMsg, PUSHBACK_CHECK_EVENT, PUSHBACK_CHECK_TIME, pushbackCancel(), queue_list_, RateLimitSession::rlStrategy_, RateLimitSession::setLimit(), RateLimitStrategy::target_rate_, and timer_. Referenced by timeout().
00310 {
00311
00312 if ( !rls->initialPhase_ ) {
00313 sprintf(prnMsg, " Error: Update when not in initialphase\n");
00314 printMsg(prnMsg,0);
00315 exit(-1);
00316 }
00317
00318 double qdrop = queue_list_[rls->localQID_].pbq_->getDropRate();
00319 double dropRate = rls->getDropRate();
00320 double arrRate = rls->getArrivalRateForStatus();
00321 double newLimit = arrRate*(1 - 2*(dropRate+qdrop));
00322
00323 sprintf(prnMsg,"Initial-Update: qdrop=%g dr=%g newL=%g oldTarget=%g lowerBound=%g arr=%g\n",
00324 qdrop, dropRate, newLimit, rls->rlStrategy_->target_rate_, rls->lowerBound_, arrRate);
00325 printMsg(prnMsg,0);
00326
00327 //cancel right now, if arrRate is significantly less than lower bound.
00328 if (arrRate < 0.75*rls->lowerBound_) {
00329 #ifdef DEBUG
00330 double now = Scheduler::instance().clock();
00331 printf("Cancel pushback A time: %5.3f\n", now);
00332 #endif
00333 pushbackCancel(rls);
00334 return;
00335 }
00336
00337 if (newLimit > rls->lowerBound_) {
00338 rls->setLimit(newLimit);
00339
00340 PushbackEvent * event = new PushbackEvent(INITIAL_UPDATE_TIME, INITIAL_UPDATE_EVENT, rls);
00341 timer_->insert(event);
00342 }
00343 else {
00344 rls->setLimit(rls->lowerBound_);
00345 rls->initialPhase_ = 0;
00346
00347 if (rls->logData_->count_!=0 && enable_pushback_) {
00348 PushbackEvent * event = new PushbackEvent(PUSHBACK_CHECK_TIME, PUSHBACK_CHECK_EVENT, rls);
00349 timer_->insert(event);
00350 }
00351 }
00352 }
|
Here is the call graph for this function:

|
|
Definition at line 446 of file agent.cc. References hdr_nv::access(), hdr_flags::access(), hdr_ip::access(), hdr_cmn::access(), ns_addr_t::addr_, Scheduler::clock(), hdr_flags::cong_action_, hdr_ip::daddr(), Agent::defttl_, hdr_cmn::direction(), hdr_ip::dport(), Agent::dst_, hdr_flags::ecn_, hdr_flags::ecn_capable_, hdr_flags::ecn_to_echo_, hdr_flags::eln_, hdr_cmn::error(), Agent::fid_, hdr_ip::flowid(), hdr_flags::fs_, NixNode::GetNixVector(), NixNode::GetNodeObject(), hdr_nv::h_used, Agent::here_, hdr_cmn::iface(), Scheduler::instance(), hdr_flags::no_ts_, hdr_cmn::NONE, hdr_nv::nv(), hdr_ip::offset(), hdr_nv::offset(), ns_addr_t::port_, hdr_flags::pri_, hdr_ip::prio(), Agent::prio_, hdr_cmn::ptype(), NixVec::Reset(), hdr_ip::saddr(), hdr_cmn::size(), Agent::size_, hdr_ip::sport(), hdr_cmn::timestamp(), hdr_ip::ttl(), Agent::type_, hdr_cmn::uid(), and Agent::uidcnt_. Referenced by Agent::allocpkt(), and PingResponder::recv().
00447 {
00448 hdr_cmn* ch = hdr_cmn::access(p);
00449 ch->uid() = uidcnt_++;
00450 ch->ptype() = type_;
00451 ch->size() = size_;
00452 ch->timestamp() = Scheduler::instance().clock();
00453 ch->iface() = UNKN_IFACE.value(); // from packet.h (agent is local)
00454 ch->direction() = hdr_cmn::NONE;
00455
00456 ch->error() = 0; /* pkt not corrupt to start with */
00457
00458 hdr_ip* iph = hdr_ip::access(p);
00459 iph->saddr() = here_.addr_;
00460 iph->sport() = here_.port_;
00461 iph->daddr() = dst_.addr_;
00462 iph->dport() = dst_.port_;
00463
00464 //DEBUG
00465 //if (dst_ != -1)
00466 // printf("pl break\n");
00467
00468 iph->flowid() = fid_;
00469 iph->prio() = prio_;
00470 iph->ttl() = defttl_;
00471
00472 hdr_flags* hf = hdr_flags::access(p);
00473 hf->ecn_capable_ = 0;
00474 hf->ecn_ = 0;
00475 hf->eln_ = 0;
00476 hf->ecn_to_echo_ = 0;
00477 hf->fs_ = 0;
00478 hf->no_ts_ = 0;
00479 hf->pri_ = 0;
00480 hf->cong_action_ = 0;
00481 #ifdef HAVE_STL
00482
00483 hdr_nv* nv = hdr_nv::access(p);
00484 if (0)
00485 printf("Off hdr_nv %d, ip_hdr %d myaddr %ld\n",
00486 hdr_nv::offset(), hdr_ip::offset(), here_.addr_);
00487 NixNode* pNixNode = NixNode::GetNodeObject(here_.addr_);
00488 if (0)
00489 printf("Node Object %p\n", pNixNode);
00490 if (pNixNode) {
00491 // If we get non-null, indicates nixvector routing in use
00492 // Delete any left over nv in the packet
00493 // Get a nixvector to the target (may create new)
00494 NixVec* pNv = pNixNode->GetNixVector(dst_.addr_);
00495 pNv->Reset();
00496 nv->nv() = pNv; // And set the nixvec in the packet
00497 nv->h_used = 0; // And reset used portion to 0
00498 }
00499 #endif //HAVE_STL
00500 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 250 of file agent.cc. References min, OldValue::next_, Agent::oldValueList_, TRACEVAR_MAXVALUELENGTH, OldValue::val_, and OldValue::var_. Referenced by Agent::trace().
00251 {
00252 OldValue *p = new OldValue;
00253 assert(p != NULL);
00254 strncpy(p->val_, value, min(strlen(value)+1, TRACEVAR_MAXVALUELENGTH));
00255 p->var_ = v;
00256 p->next_ = NULL;
00257 if (oldValueList_ == NULL)
00258 oldValueList_ = p;
00259 else {
00260 p->next_ = oldValueList_;
00261 oldValueList_ = p;
00262 }
00263 }
|
|
|
Definition at line 61 of file object.h. References NsObject::debug_.
00061 { return debug_; }
|
|
|
Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent. Definition at line 381 of file agent.cc. Referenced by Agent::command().
00382 {
00383 }
|
|
|
Definition at line 242 of file agent.cc. References OldValue::next_, Agent::oldValueList_, and OldValue::var_. Referenced by Agent::trace().
00243 {
00244 OldValue *p = oldValueList_;
00245 while ((p != NULL) && (p->var_ != v))
00246 p = p->next_;
00247 return p;
00248 }
|
|
||||||||||||||||
|
Definition at line 987 of file pushback.cc. Referenced by RateLimitSessionList::mergeSessions().
00987 {
00988
00989 //todo: think of a smarter way.
00990 //currently merge if bits < some value.
00991 //return (bits <= MIN_BITS_FOR_MERGER);
00992
00993 return 0;
00994 }
|
|
|
Definition at line 310 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Scheduler::clock(), Agent::here_, Scheduler::instance(), TIME_FORMAT, and Agent::traceName_. Referenced by Agent::command().
00311 {
00312 char wrk[256];
00313 int n;
00314 double curTime = (&Scheduler::instance() == NULL ? 0 :
00315 Scheduler::instance().clock());
00316
00317 sprintf(wrk, "v -t "TIME_FORMAT" -e monitor_agent %d %s",
00318 curTime, here_.addr_, traceName_);
00319 n = strlen(wrk);
00320 wrk[n] = '\n';
00321 wrk[n+1] = 0;
00322 if (channel_)
00323 (void)Tcl_Write(channel_, wrk, n+1);
00324 }
|
Here is the call graph for this function:

|
|
Definition at line 97 of file agent.h. References Agent::here_, nsaddr_t, and ns_addr_t::port_. Referenced by LmsAgent::pkt2agent(), TcpAsymSink::recv(), MIPBSAgent::recv(), LmsAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), LmsReceiver::send_refresh(), IcmpAgent::sendredirect(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().
|
|
||||||||||||
|
Definition at line 967 of file pushback.cc. References Scheduler::clock(), debugLevel, Scheduler::instance(), node_, Node::nodeid(), and verbose_. Referenced by calculateLowerBound(), PushbackTimer::cancelStatus(), command(), getQID(), identifyAggregate(), initialUpdate(), PushbackTimer::insert(), processPushbackCancel(), processPushbackRefresh(), processPushbackRequest(), processPushbackStatus(), pushbackCancel(), pushbackRefresh(), pushbackStatus(), recv(), refreshUpstreamLimits(), reportDrop(), resetDropLog(), PushbackTimer::sanityCheck(), PushbackTimer::schedule(), sendMsg(), and timeout().
00967 {
00968
00969 if (msgLevel < debugLevel) {
00970 if (verbose_) printf("PBA:%d (%g) %s", node_->nodeid(), Scheduler::instance().clock(), msg);
00971 fflush(stdout);
00972 }
00973 }
|
Here is the call graph for this function:

|
|
Definition at line 821 of file pushback.cc. References getQID(), RateLimitSessionList::getSessionByRemoteID(), queue_rec::pbq_, printMsg(), prnMsg, pushbackCancel(), queue_list_, PushbackMessage::rlsID_, PushbackQueue::rlsList_, and PushbackMessage::senderID_. Referenced by recv().
00821 {
00822
00823 int qid = getQID(msg->senderID_);
00824 sprintf(prnMsg, " pushback cancel from %d for queue index %d\n", msg->senderID_, qid);
00825 printMsg(prnMsg,0);
00826
00827 RateLimitSession * rls = queue_list_[qid].pbq_->rlsList_->getSessionByRemoteID(msg->rlsID_);
00828
00829 if (rls == NULL) {
00830 sprintf(prnMsg, " session %d not found\n", msg->rlsID_);
00831 printMsg(prnMsg,0);
00832 exit(-1);
00833 }
00834 pushbackCancel(rls);
00835
00836 }
|
Here is the call graph for this function:

|
|
Definition at line 789 of file pushback.cc. References PushbackRefreshMessage::aggSpec_, RateLimitSession::depthInPTree_, getQID(), RateLimitSessionList::getSessionByRemoteID(), PushbackTimer::insert(), PushbackRefreshMessage::limit_, queue_rec::pbq_, printMsg(), prnMsg, PUSHBACK_CYCLE_TIME, PUSHBACK_STATUS_EVENT, RateLimitSession::pushbackON_, queue_list_, refreshUpstreamLimits(), PushbackMessage::rlsID_, PushbackQueue::rlsList_, PushbackMessage::senderID_, RateLimitSession::setAggSpec(), RateLimitSession::setLimit(), and timer_. Referenced by recv().
00789 {
00790
00791 int qid = getQID(msg->senderID_);
00792 sprintf(prnMsg, " pushback refresh from %d for qid=%d with limit=%g\n", msg->senderID_, qid, msg->limit_);
00793 printMsg(prnMsg,0);
00794
00795 RateLimitSession * rls = queue_list_[qid].pbq_->rlsList_->getSessionByRemoteID(msg->rlsID_);
00796
00797 if (rls == NULL) {
00798 sprintf(prnMsg, " session %d not found\n", msg->rlsID_);
00799 printMsg(prnMsg,0);
00800 exit(-1);
00801 }
00802
00803 //1. change your own rate limit
00804 rls->setAggSpec(msg->aggSpec_);
00805 delete(msg->aggSpec_);
00806 double newLimit = msg->limit_;
00807 rls->setLimit(newLimit);
00808
00809 //2. if pushback has been propagated send out refreshes upstream with new limits
00810 if (rls->pushbackON_) {
00811 refreshUpstreamLimits(rls);
00812 }
00813
00814 //3. set up status timer.
00815 PushbackEvent * event = new PushbackEvent(PUSHBACK_CYCLE_TIME - 0.1*rls->depthInPTree_,
00816 PUSHBACK_STATUS_EVENT, rls);
00817 timer_->insert(event);
00818 }
|
Here is the call graph for this function:

|
|
Definition at line 712 of file pushback.cc. References PushbackRequestMessage::aggSpec_, RateLimitSessionList::containsAggSpec(), LoggingDataStruct::count_, PushbackRequestMessage::depth_, enable_pushback_, getQID(), PushbackTimer::insert(), RateLimitSessionList::insert(), PushbackRequestMessage::limit_, RateLimitSession::logData_, node_, queue_rec::pbq_, printMsg(), prnMsg, PUSHBACK_CHECK_EVENT, PUSHBACK_CHECK_TIME, PushbackMessage::qid_, queue_list_, RATE_LIMIT_TIME_DEFAULT, PushbackMessage::rlsID_, PushbackQueue::rlsList_, rtLogic_, PushbackMessage::senderID_, and timer_. Referenced by recv().
00712 {
00713
00714 int qid = getQID(msg->senderID_);
00715 sprintf(prnMsg, " pushback request from %d for qid=%d limit=%g\n", msg->senderID_,
00716 qid, msg->limit_);
00717 printMsg(prnMsg,0);
00718
00719 AggSpec * aggSpec = msg->aggSpec_;
00720 if (queue_list_[qid].pbq_->rlsList_->containsAggSpec(aggSpec)) {
00721 fprintf(stdout,"PBA: %s got a pushback req for agg I already rate-limit. \
00722 Feature not yet Implemented\n",name());
00723 exit(-1);
00724 }
00725
00726 RateLimitSession * rls = new RateLimitSession(aggSpec, msg->limit_, msg->senderID_, qid,
00727 msg->qid_, msg->rlsID_, msg->depth_+1,
00728 RATE_LIMIT_TIME_DEFAULT, -1, node_, rtLogic_);
00729 queue_list_[qid].pbq_->rlsList_->insert(rls);
00730
00731 //pushback propagation check if there are valid upstream neighbors && enable_pushback_
00732 if (rls->logData_->count_ && enable_pushback_) {
00733 PushbackEvent * event = new PushbackEvent(PUSHBACK_CHECK_TIME, PUSHBACK_CHECK_EVENT, rls);
00734 timer_->insert(event);
00735 }
00736 }
|
Here is the call graph for this function:

|
|
Definition at line 740 of file pushback.cc. References PushbackStatusMessage::arrivalRate_, PushbackTimer::cancelStatus(), checkQID(), LoggingDataStruct::consolidateStatus(), RateLimitSessionList::getSessionByLocalID(), PushbackStatusMessage::height_, RateLimitSession::heightInPTree_, RateLimitSession::logData_, node_, Node::nodeid(), RateLimitSession::origin_, queue_rec::pbq_, printMsg(), prnMsg, PushbackMessage::qid_, queue_list_, LoggingDataStruct::registerStatus(), RateLimitSession::remoteID_, RateLimitSession::remoteQID_, LoggingDataStruct::resetStatus(), PushbackMessage::rlsID_, PushbackQueue::rlsList_, PushbackMessage::senderID_, sendMsg(), LoggingDataStruct::statusArrivalRateAll_, and timer_. Referenced by recv().
00740 {
00741
00742 int qid = msg->qid_;
00743
00744 if (!checkQID(qid)) {
00745 sprintf(prnMsg, " Got invalid qid from %d in status message\n", msg->senderID_);
00746 printMsg(prnMsg,0);
00747 exit(-1);
00748 }
00749
00750 RateLimitSession * rls = queue_list_[qid].pbq_->rlsList_->getSessionByLocalID(msg->rlsID_);
00751
00752 if (rls == NULL) {
00753 sprintf(prnMsg, " session %d not found\n", msg->rlsID_);
00754 printMsg(prnMsg,0);
00755 exit(-1);
00756 }
00757
00758 //increase your height if you need to.
00759 if (msg->height_ + 1 > rls->heightInPTree_) {
00760 rls->heightInPTree_ = msg->height_ + 1;
00761 sprintf(prnMsg, " height increased to %d\n", rls->heightInPTree_);
00762 printMsg(prnMsg,0);
00763 }
00764
00765 rls->logData_->registerStatus(msg->senderID_, msg->arrivalRate_);
00766 sprintf(prnMsg, " got rate %g\n", msg->arrivalRate_);
00767 printMsg(prnMsg,0);
00768
00769 //send status if you are not root.
00770 if (rls->origin_!= node_->nodeid()) {
00771 // 1. check to see if status from all the upstream neighbors has arrived.
00772 // 2. if yes, then send status downstream.
00773 int gotAll = rls->logData_->consolidateStatus();
00774 if (gotAll==1) {
00775 //send status down
00776 double rate = rls->logData_->statusArrivalRateAll_;
00777 PushbackMessage * msg = new PushbackStatusMessage(node_->nodeid(), rls->origin_,
00778 rls->remoteQID_, rls->remoteID_,
00779 rate, rls->heightInPTree_);
00780 sendMsg(msg);
00781 timer_->cancelStatus(rls);
00782 //reset status arrivals.
00783 rls->logData_->resetStatus();
00784 }
00785 }
00786 }
|
Here is the call graph for this function:

|
|
Definition at line 656 of file pushback.cc. References RateLimitSession::aggSpec_, Scheduler::clock(), LoggingDataStruct::first_, Scheduler::instance(), RateLimitSession::localID_, RateLimitSession::localQID_, RateLimitSession::logData_, LoggingDataStructNode::next_, LoggingDataStructNode::nid_, node_, Node::nodeid(), AggSpec::print(), printMsg(), prnMsg, RateLimitSession::pushbackON_, queue_list_, PushbackTimer::removeEvents(), sendMsg(), and timer_. Referenced by initialUpdate(), processPushbackCancel(), and pushbackRefresh().
00656 {
00657
00658 sprintf(prnMsg,"Stopping rate-limiting for aggregate: ");
00659 printMsg(prnMsg,0);
00660 rls->aggSpec_->print();
00661 fflush(stdout);
00662
00663 #ifdef DEBUG
00664 double now = Scheduler::instance().clock();
00665 printf("time: %5.3f ID: %d Cancel pushback C\n", now, rls->localID_);
00666 #endif
00667
00668 if (rls->pushbackON_) {
00669 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00670 while (lgdsNode != NULL) {
00671 PushbackMessage * msg = new PushbackCancelMessage(node_->nodeid(), lgdsNode->nid_,
00672 rls->localQID_, rls->localID_);
00673 sendMsg(msg);
00674 lgdsNode = lgdsNode->next_;
00675 }
00676 }
00677
00678 //remove all events that point to this rls.
00679 timer_->removeEvents(rls);
00680 //local cancellation here.
00681 queue_list_[rls->localQID_].pbq_->rlsList_->endSession(rls);
00682
00683 }
|
Here is the call graph for this function:

|
|
Definition at line 356 of file pushback.cc. References RateLimitSession::aggSpec_, AggSpec::clone(), LoggingDataStruct::count_, RateLimitSession::depthInPTree_, DROP_RATE_FOR_PUSHBACK, RateEstimator::estRate_, LoggingDataStruct::first_, RateLimitSession::getDropRate(), RateLimitSession::heightInPTree_, INFINITE_LIMIT, PushbackTimer::insert(), RateLimitSession::localID_, RateLimitSession::localQID_, RateLimitSession::logData_, LoggingDataStructNode::next_, LoggingDataStructNode::nid_, node_, Node::nodeid(), PUSHBACK_CHECK_EVENT, PUSHBACK_CHECK_TIME, RateLimitSession::pushbackOn(), LoggingDataStructNode::pushbackSent(), LoggingDataStructNode::pushbackSent_, LoggingDataStructNode::rateEstimator_, RateLimitSession::rlStrategy_, sendMsg(), RateLimitStrategy::target_rate_, and timer_. Referenced by timeout().
00356 {
00357
00358 double dropRate = rls->getDropRate();
00359
00360 if (dropRate >= DROP_RATE_FOR_PUSHBACK) {
00361 rls->pushbackOn();
00362 rls->heightInPTree_++;
00363
00364 double totalRate = rls->rlStrategy_->target_rate_;
00365 int count = rls->logData_->count_;
00366 double fairShare = totalRate/count;
00367 int done = count;
00368
00369 //max-min allocation of limit.
00370 while (done != 0) {
00371 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00372 int countThisRound=0;
00373 while (lgdsNode != NULL) {
00374 double rate = lgdsNode->rateEstimator_->estRate_;
00375 if (rate <= fairShare && !lgdsNode->pushbackSent_) {
00376 AggSpec * aggSpec = rls->aggSpec_->clone();
00377 PushbackMessage * msg;
00378 if (rate < fairShare/2.0) {
00379 msg = new PushbackRequestMessage(node_->nodeid(), lgdsNode->nid_, rls->localQID_,
00380 rls->localID_, aggSpec, INFINITE_LIMIT,
00381 rls->depthInPTree_);
00382 lgdsNode->pushbackSent(INFINITE_LIMIT, rate);
00383 }
00384 else {
00385 msg = new PushbackRequestMessage(node_->nodeid(), lgdsNode->nid_, rls->localQID_,
00386 rls->localID_, aggSpec, rate, rls->depthInPTree_);
00387 lgdsNode->pushbackSent(rate, rate);
00388 }
00389 sendMsg(msg);
00390 countThisRound++;
00391 done--;
00392 totalRate -= rate;
00393 }
00394 lgdsNode = lgdsNode->next_;
00395 }
00396 if (done == 0) break;
00397 if (countThisRound==0) {
00398 //allocate fairshare to everyone and end.
00399 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00400 while (lgdsNode != NULL) {
00401 if (!lgdsNode->pushbackSent_) {
00402 AggSpec * aggSpec = rls->aggSpec_->clone();
00403 PushbackMessage * msg = new PushbackRequestMessage(node_->nodeid(), lgdsNode->nid_,
00404 rls->localQID_, rls->localID_,
00405 aggSpec, fairShare,
00406 rls->depthInPTree_);
00407 lgdsNode->pushbackSent(fairShare,lgdsNode->rateEstimator_->estRate_);
00408 sendMsg(msg);
00409 done--;
00410 totalRate-=fairShare;
00411 }
00412 lgdsNode = lgdsNode->next_;
00413 }
00414 }
00415 else {
00416 fairShare= totalRate/done;
00417 }
00418 }
00419
00420 }
00421 else {
00422 //set up pushback check for later.
00423 PushbackEvent * event = new PushbackEvent(PUSHBACK_CHECK_TIME, PUSHBACK_CHECK_EVENT, rls);
00424 timer_->insert(event);
00425 }
00426 }
|
Here is the call graph for this function:

|
|
Definition at line 446 of file pushback.cc. References Scheduler::clock(), EARLIEST_TIME_TO_FREE, RateLimitSessionList::first_, RateLimitSession::getArrivalRateForStatus(), PushbackQueue::getBW(), PushbackQueue::getRate(), PushbackTimer::insert(), Scheduler::instance(), RateLimitSession::localID_, LOWER_BOUND_MODE, RateLimitSession::lowerBound_, MAX_SESSIONS, RateLimitSession::merged_, MERGER_MODE, RateLimitSessionList::mergeSessions(), MIN_TIME_TO_FREE, RateLimitSession::next_, node_, Node::nodeid(), RateLimitSessionList::noMySessions(), RateLimitSession::origin_, queue_rec::pbq_, PRIMARY_WAITING_ZONE, printMsg(), prnMsg, PUSHBACK_CYCLE_TIME, PUSHBACK_REFRESH_EVENT, pushbackCancel(), RateLimitSession::pushbackON_, queue_list_, RateLimitSessionList::rankRate(), RateLimitSessionList::rankSession(), RateLimitSession::refreshed(), RateLimitSession::refreshTime_, refreshUpstreamLimits(), requiredLimit_, PushbackQueue::rlsList_, RateLimitSession::rlStrategy_, RateLimitSession::setLimit(), RateLimitSession::startTime_, TARGET_DROPRATE, RateLimitStrategy::target_rate_, and timer_. Referenced by timeout().
00446 {
00447
00448 PushbackQueue * pbq = queue_list_[qid].pbq_;
00449 int oldSessions = pbq->rlsList_->noMySessions(node_->nodeid());
00450 if (!oldSessions) {
00451 //set up refresh timers for a later time and return.
00452 // PushbackEvent * event = new PushbackEvent(PUSHBACK_CYCLE_TIME, PUSHBACK_REFRESH_EVENT, qid);
00453 // timer_->insert(event);
00454 return;
00455 }
00456
00457 int noSessions = oldSessions;
00458
00459 if (MERGER_MODE == 1) {
00460 pbq->rlsList_->mergeSessions(node_->nodeid());
00461 noSessions = pbq->rlsList_->noMySessions(node_->nodeid());
00462
00463 if (noSessions!=oldSessions) {
00464 sprintf(prnMsg, " Some sessions merged. old = %d new = %d\n", oldSessions, noSessions);
00465 printMsg(prnMsg,0);
00466
00467 //get rid of merged RLS's
00468 RateLimitSession * listItem = pbq->rlsList_->first_;
00469 while (listItem != NULL) {
00470 if (listItem->origin_ == node_->nodeid() && listItem->merged_) {
00471 pushbackCancel(listItem);
00472 listItem = listItem->next_;
00473
00474 }
00475 }
00476 } else {
00477 sprintf(prnMsg, " No sessions merged. number = %d\n", noSessions);
00478 printMsg(prnMsg,0);
00479 }
00480 } else {
00481 sprintf(prnMsg, "Number of sessions = %d\n", noSessions);
00482 printMsg(prnMsg,0);
00483 }
00484
00485 double now = Scheduler::instance().clock();
00486
00487 //check if some sessions need to be discarded because of rate-limiting too many sessions
00488 RateLimitSession * listItem1 = pbq->rlsList_->first_;
00489 while (noSessions > MAX_SESSIONS && listItem1 != NULL) {
00490 int rank = pbq->rlsList_->rankRate(node_->nodeid(), listItem1->getArrivalRateForStatus());
00491 if (listItem1->origin_ == node_->nodeid() &&
00492 rank >= MAX_SESSIONS && (now - listItem1->startTime_) >= EARLIEST_TIME_TO_FREE) {
00493 sprintf(prnMsg,"Releasing because of too many being rate-limited\n");
00494 printMsg(prnMsg,0);
00495 if (LOWER_BOUND_MODE == 1 &&
00496 queue_list_[qid].idTree_->lowerBound_ < listItem1->getArrivalRateForStatus()) {
00497 queue_list_[qid].idTree_->lowerBound_ = listItem1->getArrivalRateForStatus();
00498 }
00499 pushbackCancel(listItem1);
00500 noSessions--;
00501 }
00502 listItem1 = listItem1->next_;
00503 }
00504
00505 double linkBW = pbq->getBW();
00506 double arrRate = pbq->getRate();
00507 double targetRate = linkBW/(1 - TARGET_DROPRATE);
00508
00509 double totalRateLimitedArrivalRate = 0;
00510 double totalLimit=0;
00511 double lowerBound=-1;
00512 RateLimitSession * listItem = pbq->rlsList_->first_;
00513 while (listItem != NULL) {
00514 if (listItem->origin_ == node_->nodeid() && !listItem->merged_) {
00515 double sessionArrRate = listItem->getArrivalRateForStatus();
00516 double sessionLimit = listItem->rlStrategy_->target_rate_;
00517 totalRateLimitedArrivalRate+= sessionArrRate;
00518 totalLimit+= (sessionArrRate > sessionLimit)? sessionLimit: sessionArrRate;
00519 if (listItem->lowerBound_ < lowerBound || lowerBound == -1) {
00520 lowerBound = listItem->lowerBound_;
00521 }
00522 }
00523 listItem = listItem->next_;
00524 }
00525
00526 if (LOWER_BOUND_MODE == 1) {
00527 lowerBound = queue_list_[qid].idTree_->lowerBound_;
00528 }
00529
00530 double excessRate = (arrRate - totalLimit + totalRateLimitedArrivalRate) - targetRate;
00531
00532 sprintf(prnMsg,"arr=%g totalLimit=%g totalRateLimit=%g excess=%g\n", arrRate, totalLimit,
00533 totalRateLimitedArrivalRate, excessRate);
00534 printMsg(prnMsg,0);
00535
00536 if (excessRate < 0) {
00537 sprintf(prnMsg, "Negative Excess Rate. Things maybe fine now.\n");
00538 printMsg(prnMsg,0);
00539 //this would make all sessions go away after a while.
00540 #ifdef DEBUG
00541 printf("Negative Excess Rate - time: %5.3f\n", now);
00542 #endif
00543 requiredLimit_ = 2*totalRateLimitedArrivalRate;
00544 } else {
00545 //Should we allow such an abrupt increase when the number of sessions
00546 // changes?
00547 // How about: Let L be the requiredLimit.
00548 // We need Sum (session arrival rate - L ) = excessRate
00549 requiredLimit_ = (totalRateLimitedArrivalRate - excessRate)/noSessions;
00550 if (requiredLimit_ < lowerBound) {
00551 requiredLimit_ = lowerBound;
00552 }
00553 #ifdef DEBUG
00554 printf("New requiredLimit - time: %5.3f limit: %5.3f lowerBound:%5.3f \n", now, requiredLimit_, lowerBound);
00555 #endif
00556 }
00557
00558 sprintf(prnMsg,"Refresh. target=%g limit=%g floor=%g\n", targetRate, requiredLimit_,
00559 lowerBound);
00560 printMsg(prnMsg,0);
00561
00562 //consider all sessions in ascending order of their arrival rate
00563 for (int i=0; i<noSessions; i++) {
00564 listItem = pbq->rlsList_->first_;
00565 while (listItem != NULL ) {
00566 if (listItem->origin_ == node_->nodeid() &&
00567 pbq->rlsList_->rankSession(node_->nodeid(),listItem) == i)
00568 break;
00569 listItem = listItem->next_;
00570 }
00571 if (listItem == NULL) {
00572 printf("Error: Rank %d not found\n", i);
00573 exit(0);
00574 }
00575
00576 double oldLimit = listItem->rlStrategy_->target_rate_;
00577 double sendRate = listItem->getArrivalRateForStatus();
00578 #ifdef DEBUG
00579 printf("time: %5.3f ID: %d sendRate %5.3f oldLimit %5.3f requiredLimit %5.3f\n", now,
00580 listItem->localID_, sendRate, oldLimit, requiredLimit_);
00581 #endif
00582 //Session sending less than the limit.
00583 if (sendRate < requiredLimit_) {
00584 //if it has been sending less for "some" time.
00585 if (now - listItem->refreshTime_ >= MIN_TIME_TO_FREE) {
00586 #ifdef DEBUG
00587 printf("time: %5.3f ID: %d refreshTime %5.3f MIN %d Cancel pushback B \n",
00588 now, listItem->localID_, listItem->refreshTime_, MIN_TIME_TO_FREE);
00589 #endif
00590 pushbackCancel(listItem); //cancel rate-limiting
00591 requiredLimit_+= (requiredLimit_ - sendRate)/(noSessions - i - 1);
00592 i--; noSessions--;
00593 }
00594 else {
00595 //refresh upstream with double of max(sending rate, old limit)
00596 //just using sending rate, limits the amount an aggregate can grow till next refresh
00597 //using just old limit is tricky when different aggregates have different limits.
00598 //at the same time, we would prefer not to loosen the hold too much in one step.
00599 #ifdef DEBUG
00600 printf("time: %5.3f ID: %d double limit\n", now, listItem->localID_);
00601 #endif
00602 double maxR = sendRate>oldLimit? sendRate: oldLimit;
00603 if (now - listItem->refreshTime_ <= PRIMARY_WAITING_ZONE) {
00604 sprintf(prnMsg,"Waiting Zone 1: sendRate=%g oldLimit=%g\n", sendRate, oldLimit);
00605 printMsg(prnMsg,0);
00606 }
00607 else {
00608 sprintf(prnMsg,"Waiting Zone 2: sendRate=%g oldLimit=%g\n", sendRate, oldLimit);
00609 printMsg(prnMsg,0);
00610 maxR *= 1.5;
00611 }
00612 if (maxR < requiredLimit_) {
00613 listItem->setLimit(maxR);
00614 requiredLimit_ += (requiredLimit_ - maxR)/(noSessions - i - 1);
00615 }
00616 else {
00617 listItem->setLimit(requiredLimit_);
00618 }
00619
00620 if (listItem->pushbackON_)
00621 refreshUpstreamLimits(listItem);
00622 }
00623 }
00624 else {
00625 //change the rate limit most half way.
00626 double newLimit;
00627 if (oldLimit > 1.25 * requiredLimit_ || oldLimit ==0)
00628 newLimit = requiredLimit_;
00629 else
00630 newLimit = 0.5*requiredLimit_ + 0.5*oldLimit;
00631
00632 if (newLimit < lowerBound)
00633 newLimit = lowerBound;
00634
00635 listItem->refreshed();
00636 listItem->setLimit(newLimit);
00637 if (listItem->pushbackON_)
00638 refreshUpstreamLimits(listItem);
00639 #ifdef DEBUG
00640 printf("time: %5.3f ID: %d newLimit %5.3f oldLimit %5.3f requiredLimit %5.3f\n",
00641 now, listItem->localID_, newLimit, oldLimit, requiredLimit_);
00642 #endif
00643 }
00644 }
00645
00646 //setup refresh timer again
00647 noSessions = pbq->rlsList_->noMySessions(node_->nodeid());
00648 if (noSessions) {
00649 PushbackEvent * event = new PushbackEvent(PUSHBACK_CYCLE_TIME, PUSHBACK_REFRESH_EVENT, qid);
00650 timer_->insert(event);
00651 }
00652 }
|
Here is the call graph for this function:

|
|
Definition at line 429 of file pushback.cc. References RateLimitSession::getArrivalRateForStatus(), RateLimitSession::heightInPTree_, RateLimitSession::logData_, node_, Node::nodeid(), RateLimitSession::origin_, printMsg(), prnMsg, RateLimitSession::pushbackON_, RateLimitSession::remoteID_, RateLimitSession::remoteQID_, LoggingDataStruct::resetStatus(), and sendMsg(). Referenced by timeout().
00429 {
00430
00431 if (rls->pushbackON_) {
00432 sprintf(prnMsg, " Warning: status timer expired for non-leaf node\n");
00433 printMsg(prnMsg,0);
00434 //exit(-1);
00435 }
00436 double rate = rls->getArrivalRateForStatus();
00437 rls->logData_->resetStatus();
00438
00439 PushbackMessage * msg = new PushbackStatusMessage(node_->nodeid(), rls->origin_,
00440 rls->remoteQID_, rls->remoteID_,
00441 rate, rls->heightInPTree_);
00442 sendMsg(msg);
00443 }
|
Here is the call graph for this function:

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

|
||||||||||||
|
Reimplemented from Agent. Definition at line 688 of file pushback.cc. References hdr_pushback::msg_, printMsg(), prnMsg, processPushbackCancel(), processPushbackRefresh(), processPushbackRequest(), processPushbackStatus(), PUSHBACK_CANCEL_MSG, PUSHBACK_REFRESH_MSG, PUSHBACK_REQUEST_MSG, PUSHBACK_STATUS_MSG, and PushbackMessage::type().
00688 {
00689
00690 hdr_pushback * hdr_push = ((hdr_pushback*)pkt)->access(pkt);
00691 PushbackMessage * msg = hdr_push->msg_;
00692
00693 sprintf(prnMsg, " %s msg from %d\n", PushbackMessage::type(msg), msg->senderID_);
00694 printMsg(prnMsg,0);
00695
00696 switch (msg->msgID_) {
00697 case PUSHBACK_REQUEST_MSG : processPushbackRequest((PushbackRequestMessage *)msg);
00698 break;
00699 case PUSHBACK_STATUS_MSG : processPushbackStatus((PushbackStatusMessage *) msg);
00700 break;
00701 case PUSHBACK_REFRESH_MSG : processPushbackRefresh((PushbackRefreshMessage *) msg);
00702 break;
00703 case PUSHBACK_CANCEL_MSG : processPushbackCancel((PushbackCancelMessage *) msg);
00704 break;
00705 default: fprintf(stderr,"PBA: %s Undefined Message ID %d\n", name(),msg->msgID_);
00706 }
00707
00708 delete(msg);
00709 }
|
Here is the call graph for this function:

|
|
Definition at line 354 of file agent.cc. References Agent::app_, and Application::recv(). Referenced by DelAckSink::recv(), TcpSink::recv(), QSTcpSink::recv(), FullTcpAgent::recv(), and TcpAsymSink::recv().
|
Here is the call graph for this function:

|
|
Reimplemented from NsObject. Definition at line 78 of file agent.h.
00078 {};
|
|
|
Definition at line 839 of file pushback.cc. References RateLimitSession::aggSpec_, AggSpec::clone(), LoggingDataStruct::count_, LoggingDataStruct::first_, RateLimitSession::getArrivalRateForStatus(), INFINITE_LIMIT, RateLimitSession::localID_, RateLimitSession::localQID_, RateLimitSession::logData_, LoggingDataStructNode::next_, LoggingDataStructNode::nid_, node_, Node::nodeid(), printMsg(), prnMsg, RateLimitSession::rlStrategy_, sendMsg(), LoggingDataStructNode::sentRefresh(), LoggingDataStructNode::sentRefresh_, LoggingDataStructNode::statusArrivalRate_, and RateLimitStrategy::target_rate_. Referenced by processPushbackRefresh(), and pushbackRefresh().
00839 {
00840
00841 double totalRate = rls->rlStrategy_->target_rate_;
00842 int count = rls->logData_->count_;
00843 double fairShare = totalRate/count;
00844 int done = count;
00845 double arrRate = rls->getArrivalRateForStatus();
00846 sprintf(prnMsg, "Sending refresh messages to %d nodes. Limit = %g arrRate = %g\n", count, totalRate, arrRate);
00847 printMsg(prnMsg,0);
00848
00849 int excess = 0;
00850 if (totalRate > arrRate) {
00851 excess = 1;
00852 }
00853
00854 //max-min allocation of limit.
00855 while (done != 0) {
00856 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00857 int countThisRound=0;
00858 while (lgdsNode != NULL) {
00859 double rate;
00860 rate = lgdsNode->statusArrivalRate_;
00861 if (rate <= fairShare && !lgdsNode->sentRefresh_) {
00862 AggSpec * aggSpec = rls->aggSpec_->clone();
00863 PushbackMessage * msg;
00864 if (rate < fairShare/2.0) {
00865 msg = new PushbackRefreshMessage(node_->nodeid(), lgdsNode->nid_, rls->localQID_,
00866 rls->localID_, aggSpec, INFINITE_LIMIT);
00867 lgdsNode->sentRefresh(INFINITE_LIMIT);
00868 }
00869 else if (!excess) {
00870 msg = new PushbackRefreshMessage(node_->nodeid(), lgdsNode->nid_, rls->localQID_,
00871 rls->localID_, aggSpec, rate);
00872 lgdsNode->sentRefresh(rate);
00873 }
00874 else {
00875 msg = new PushbackRefreshMessage(node_->nodeid(), lgdsNode->nid_, rls->localQID_,
00876 rls->localID_, aggSpec, fairShare);
00877 lgdsNode->sentRefresh(fairShare);
00878 rate = fairShare;
00879 }
00880 sendMsg(msg);
00881 countThisRound++;
00882 done--;
00883 totalRate -= rate;
00884 }
00885 lgdsNode = lgdsNode->next_;
00886 }
00887 if (done == 0) break;
00888 if (countThisRound==0) {
00889 //allocate fairshare to everyone and end.
00890 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00891 while (lgdsNode != NULL) {
00892 if (!lgdsNode->sentRefresh_) {
00893 AggSpec * aggSpec = rls->aggSpec_->clone();
00894 PushbackMessage * msg = new PushbackRefreshMessage(node_->nodeid(), lgdsNode->nid_,
00895 rls->localQID_, rls->localID_,
00896 aggSpec, fairShare);
00897 lgdsNode->sentRefresh(fairShare);
00898 sendMsg(msg);
00899 done--;
00900 totalRate-=fairShare;
00901 }
00902 lgdsNode = lgdsNode->next_;
00903 }
00904 }
00905 else {
00906 fairShare = totalRate/done;
00907 }
00908 }
00909
00910 //reset all the sentRefresh bits
00911 LoggingDataStructNode * lgdsNode = rls->logData_->first_;
00912 while (lgdsNode != NULL) {
00913 lgdsNode->sentRefresh_ = 0;
00914 lgdsNode = lgdsNode->next_;
00915 }
00916
00917 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 123 of file pushback.cc. References hdr_ip::access(), ns_addr_t::addr_, checkQID(), hdr_ip::dst(), hdr_ip::flowid(), queue_rec::idTree_, ns_addr_t::port_, printMsg(), prnMsg, queue_list_, IdentStruct::registerDrop(), and hdr_ip::src(). Referenced by PushbackQueue::reportDrop().
00123 {
00124
00125 if (!checkQID(qid)) {
00126 sprintf(prnMsg,"Got invalid qid %d\n", qid);
00127 printMsg(prnMsg,0);
00128 exit(-1);
00129 }
00130
00131 hdr_ip * iph = hdr_ip::access(p);
00132 ns_addr_t src = iph->src();
00133 ns_addr_t dst = iph->dst();
00134 int fid = iph->flowid();
00135
00136 sprintf(prnMsg,"DropDetails from queue %d: %d.%d -> %d.%d (%d)\n", qid,
00137 src.addr_, src.port_, dst.addr_, dst.port_, fid);
00138 printMsg(prnMsg, 5);
00139
00140 queue_list_[qid].idTree_->registerDrop(p);
00141 }
|
Here is the call graph for this function:

|
|
Reimplemented in BayFullTcpAgent, HashClassifier, IvsSource, dsREDQueue, DiffusionRate, SinkAgent, DiffusionAgent, FloodingAgent, OmniMcastAgent, LinkDelay, CBQueue, DropTail, ErrorModel, PIQueue, Queue< T >, RedPDQueue, REDQueue, REMQueue, RIOQueue, Snoop, FackTcpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, Sack1TcpAgent, TcpSink, DelAckSink, TcpAgent, VegasTcpAgent, toraAgent, and Queue< T >. Definition at line 70 of file object.cc. Referenced by NsObject::command().
00071 {
00072 }
|
|
|
Definition at line 275 of file pushback.cc. References checkQID(), queue_rec::idTree_, printMsg(), prnMsg, queue_list_, and IdentStruct::reset(). Referenced by PushbackQueue::timeout().
00275 {
00276
00277 sprintf(prnMsg, " drop log reset for qid %d\n", qid);
00278 printMsg(prnMsg,5);
00279
00280 if (!checkQID(qid)) {
00281 printf("Got invalid id from queue in resetDropLog\n");
00282 exit(-1);
00283 }
00284
00285 queue_list_[qid].idTree_->reset();
00286 }
|
Here is the call graph for this function:

|
|
Reimplemented in SRMAgent. Definition at line 89 of file agent.h. References Agent::sendmsg().
00089 { sendmsg(nbytes); }
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented in HttpInvalAgent. Definition at line 84 of file agent.h. References Agent::sendmsg().
00084 { sendmsg(sz, data, 0); }
|
Here is the call graph for this function:

|
||||||||||||
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented in SA_Agent, RTPAgent, UdpAgent, LmsSender, SRMAgent, FullTcpAgent, TcpAgent, TfrcAgent, and SimpleTcpAgent. Definition at line 415 of file agent.cc.
00416 {
00417 }
|
|
||||||||||||||||
|
Reimplemented in UdpAgent. Definition at line 400 of file agent.cc. References abort(). Referenced by Agent::command(), Application::send(), Agent::send(), TrafficTrace::timeout(), TelnetApp::timeout(), EXPOO_Traffic::timeout(), and CBR_PP_Traffic::timeout().
00401 {
00402 fprintf(stderr,
00403 "Agent::sendmsg(int, AppData*, const char*) not implemented\n");
00404 abort();
00405 }
|
Here is the call graph for this function:

|
|
Definition at line 943 of file pushback.cc. References ns_addr_t::addr_, Agent::allocpkt(), Agent::dst_, intResult_, hdr_pushback::msg_, ns_addr_t::port_, printMsg(), prnMsg, Agent::send(), PushbackMessage::targetID_, and PushbackMessage::type(). Referenced by processPushbackStatus(), pushbackCancel(), pushbackCheck(), pushbackStatus(), and refreshUpstreamLimits().
00943 {
00944
00945 Tcl& tcl = Tcl::instance();
00946
00947 dst_.addr_ = msg->targetID_;
00948 //this assumes that all pushback agents have port zero.
00949
00950 tcl.evalf("%s set intResult_ [%s get-pba-port %d]", name(), name(),dst_.addr_ );
00951
00952 if ( intResult_ == -1 ) {
00953 fprintf(stderr,"PBA: %s Pushback Agent not found on Node %d\n", name(), dst_.addr_);
00954 return;
00955 }
00956 dst_.port_ = intResult_;
00957 Packet *pkt = allocpkt();
00958 hdr_pushback * hdr_push = ((hdr_pushback*)pkt)->access(pkt);
00959 hdr_push->msg_ = msg;
00960
00961 sprintf(prnMsg, " sent %s message to %d.%d\n", PushbackMessage::type(msg), dst_.addr_, dst_.port_);
00962 printMsg(prnMsg,4);
00963 send(pkt,0);
00964 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
|
|
||||||||||||||||||||
|
Definition at line 407 of file agent.cc. References abort(). Referenced by Agent::command().
00409 {
00410 fprintf(stderr,
00411 "Agent::sendmsg(int, AppData*, const char*) not implemented\n");
00412 abort();
00413 }
|
Here is the call graph for this function:

|
|
Definition at line 100 of file agent.h. References Agent::type_. Referenced by Agent::command(), HttpUInvalClass::create(), RA_Traffic::init(), POO_Traffic::init(), EXPOO_Traffic::init(), CBR_Traffic::init(), and CBR_PP_Traffic::init().
00100 { type_ = pkttype; }
|
|
|
Reimplemented in FullTcpAgent. Definition at line 95 of file agent.h. References Agent::size_. Referenced by rtProtoDV::command(), RLM_Sender::command(), imepAgent::getResponseListSize(), LandmarkAgent::makeUpdate(), Agent::recv(), SSMSRMAgent::send_glb_sess(), SSMSRMAgent::send_loc_sess(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), and TelnetApp::timeout().
00095 { 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_; }
|
|
|
Reimplemented in SA_Agent, RTPAgent, FtpClientAgent, BayFullTcpAgent, SinkAgent, RLM_Sender, MIPBSAgent, MIPMHAgent, RapAgent, RTCPAgent, TcpAsymSink, FackTcpAgent, FullTcpAgent, QSNewRenoTcpAgent, RBPVegasTcpAgent, RBPRenoTcpAgent, SackRHTcpAgent, Sack1TcpAgent, TcpSessionAgent, DelAckSink, TcpAgent, RenoTcpAgent, VegasTcpAgent, and SimpleTcpAgent. Definition at line 347 of file agent.cc. Referenced by SimpleTimer::expire().
00348 {
00349 }
|
|
|
Definition at line 289 of file pushback.cc. References INITIAL_UPDATE_EVENT, initialUpdate(), printMsg(), prnMsg, PUSHBACK_CHECK_EVENT, PUSHBACK_REFRESH_EVENT, PUSHBACK_STATUS_EVENT, pushbackCheck(), pushbackRefresh(), pushbackStatus(), and PushbackEvent::type(). Referenced by PushbackTimer::expire().
00289 {
00290
00291 sprintf(prnMsg, " %s event for qid %d\n", PushbackEvent::type(event), event->qid_);
00292 printMsg(prnMsg,0);
00293 switch (event->eventID_) {
00294 case PUSHBACK_CHECK_EVENT: pushbackCheck(event->rls_);
00295 break;
00296 case PUSHBACK_REFRESH_EVENT: pushbackRefresh(event->qid_);
00297 break;
00298 case PUSHBACK_STATUS_EVENT: pushbackStatus(event->rls_);
00299 break;
00300 case INITIAL_UPDATE_EVENT: initialUpdate(event->rls_);
00301 break;
00302 default: sprintf(prnMsg, " Unrecognized event %d\n", event->eventID_);
00303 printMsg(prnMsg,0);
00304 break;
00305 }
00306
00307 }
|
Here is the call graph for this function:

|
|
Reimplemented in TcpAgent. Definition at line 266 of file agent.cc. References ns_addr_t::addr_, Agent::channel_, Agent::dst_, Agent::here_, Agent::insertOldValue(), Scheduler::instance(), Agent::lookupOldValue(), min, TIME_FORMAT, Agent::traceName_, TRACEVAR_MAXVALUELENGTH, and OldValue::val_. Referenced by TcpAgent::trace().
00267 {
00268 if (channel_ == 0)
00269 return;
00270 char wrk[256], value[128];
00271 int n;
00272
00273 // XXX we need to keep track of old values. What's the best way?
00274 v->value(value, 128);
00275
00276 // XXX hack: how do I know ns has not started yet?
00277 // if there's nothing in value, return
00278 static int started = 0;
00279 if (!started) {
00280 Tcl::instance().evalc("[Simulator instance] is-started");
00281 if (Tcl::instance().result()[0] == '0')
00282 // Simulator not started, do nothing
00283 return;
00284 // remember for next time (so we don't always have to call to tcl)
00285 started = 1;
00286 };
00287
00288 OldValue *ov = lookupOldValue(v);
00289 if (ov != NULL) {
00290 sprintf(wrk,
00291 "f -t "TIME_FORMAT" -s %d -d %d -n %s -a %s -v %s -o %s -T v",
00292 Scheduler::instance().clock(), here_.addr_,
00293 dst_.addr_, v->name(), traceName_, value, ov->val_);
00294 strncpy(ov->val_,
00295 value,
00296 min(strlen(value)+1, TRACEVAR_MAXVALUELENGTH));
00297 } else {
00298 // if there is value, insert it into old value list
00299 sprintf(wrk, "f -t "TIME_FORMAT" -s %d -d %d -n %s -a %s -v %s -T v",
00300 Scheduler::instance().clock(), here_.addr_,
00301 dst_.addr_, v->name(), traceName_, value);
00302 insertOldValue(v, value);
00303 }
00304 n = strlen(wrk);
00305 wrk[n] = '\n';
00306 wrk[n+1] = 0;
00307 (void)Tcl_Write(channel_, wrk, n+1);
00308 }
|
Here is the call graph for this function:

|
|
Reimplemented in TcpAgent. Definition at line 146 of file agent.h.
00146 {}
|
|
|
Reimplemented in BayFullTcpAgent. Definition at line 134 of file agent.h. Referenced by Agent::attachApp(), Agent::idle(), RapAgent::IpgTimeout(), UdpAgent::recv(), SimpleTcpAgent::recv(), RapAgent::recv(), HttpInvalAgent::recv(), Agent::recv(), and Agent::recvBytes(). |
|
|
Definition at line 130 of file agent.h. Referenced by Agent::addAgentTrace(), Agent::command(), Agent::flushAVar(), Agent::monitorAgentTrace(), TcpAsymSink::recv(), Agent::trace(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar(). |
|
|
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 98 of file pushback.h. Referenced by printMsg(), and PushbackAgent(). |
|
|
Definition at line 121 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
Definition at line 57 of file connector.h. Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv(). |
|
|
Reimplemented in AckRecons. Definition at line 115 of file agent.h. Referenced by Agent::addAgentTrace(), Agent::daddr(), Agent::delay_bind_dispatch(), Agent::deleteAgentTrace(), Agent::dport(), DSRProto::DSRProto(), Agent::flushAVar(), Agent::initpkt(), SRMAgent::recv(), SSMSRMAgent::recv(), NatAgent::recv(), SRMAgent::sendmsg(), sendMsg(), and Agent::trace(). |
|
|
Definition at line 107 of file pushback.h. Referenced by initialUpdate(), processPushbackRequest(), and PushbackAgent(). |
|
|
Definition at line 145 of file agent.h. Referenced by TcpAgent::command(), and TcpAgent::trace_event(). |
|
|
Definition at line 118 of file agent.h. Referenced by Agent::delay_bind_dispatch(), AbsTcpAgent::flowid(), Agent::initpkt(), FullTcpAgent::recv(), CtrMcastEncap::recv(), AbsTcpAgent::send_batch(), Sack1TcpAgent::timeout(), and TcpAgent::trace_event(). |
|
|
Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent. Definition at line 120 of file agent.h. Referenced by Agent::delay_bind_dispatch(). |
|
|
|
Definition at line 97 of file pushback.h. Referenced by getQID(), PushbackAgent(), and sendMsg(). |
|
|
Definition at line 95 of file pushback.h. Referenced by checkQID(), command(), getQID(), PushbackAgent(), and PushbackQueue::PushbackQueue(). |
|
|
Definition at line 104 of file pushback.h. Referenced by calculateLowerBound(), command(), getQID(), identifyAggregate(), printMsg(), processPushbackRequest(), processPushbackStatus(), pushbackCancel(), pushbackCheck(), pushbackRefresh(), pushbackStatus(), refreshUpstreamLimits(), and PushbackQueue::timeout(). |
|
|
Definition at line 132 of file agent.h. Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent(). |
|
|
Definition at line 119 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
|
Definition at line 108 of file pushback.h. Referenced by calculateLowerBound(), command(), getQID(), identifyAggregate(), initialUpdate(), processPushbackCancel(), processPushbackRefresh(), processPushbackRequest(), processPushbackStatus(), pushbackCancel(), pushbackRefresh(), reportDrop(), and resetDropLog(). |
|
|
Definition at line 109 of file pushback.h. Referenced by pushbackRefresh(). |
|
|
Definition at line 112 of file pushback.h. Referenced by command(), identifyAggregate(), and processPushbackRequest(). |
|
|
|
|
Definition at line 113 of file pushback.h. Referenced by identifyAggregate(), initialUpdate(), processPushbackRefresh(), processPushbackRequest(), processPushbackStatus(), PushbackAgent(), pushbackCancel(), pushbackCheck(), and pushbackRefresh(). |
|
|
Definition at line 131 of file agent.h. Referenced by Agent::addAgentTrace(), Agent::command(), Agent::deleteAgentTrace(), Agent::flushAVar(), Agent::monitorAgentTrace(), and Agent::trace(). |
|
|
Definition at line 117 of file agent.h. Referenced by Agent::get_pkttype(), Agent::initpkt(), FullTcpAgent::listen(), BayFullTcpAgent::listen(), RapAgent::SendAck(), SRMAgent::sendmsg(), RapAgent::SendPacket(), and Agent::set_pkttype(). |
|
|
Definition at line 68 of file agent.cc. Referenced by imepAgent::handlerControlTimer(), imepAgent::handlerReXmitTimer(), Agent::initpkt(), imepAgent::sendAck(), imepAgent::sendBeacon(), toraAgent::sendCLR(), imepAgent::sendHello(), toraAgent::sendQRY(), DSRAgent::sendUnknownFlow(), toraAgent::sendUPD(), and DSRAgent::xmitFailed(). |
|
|
Definition at line 96 of file pushback.h. Referenced by command(), identifyAggregate(), printMsg(), PushbackAgent(), and PushbackQueue::PushbackQueue(). |
1.3.3