Inheritance diagram for asim:


Definition at line 104 of file asim.cc.
Public Member Functions | |
| int | allscaled () |
| int | allscaled () |
| asim () | |
| asim () | |
| void | CalcLinkDelays (int flag=0) |
| void | CalcLinkStats (int flag=0) |
| void | CalcPerFlowDelays () |
| void | CalcPerFlowStats () |
| int | command (int argc, const char *const *argv) |
| virtual void | debug (const char *fmt,...) |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| virtual void | delay_bind_init_all () |
| double | get_flow_delay (int x) |
| double | get_flow_delay (int x) |
| double | get_flow_drop (int x) |
| double | get_flow_drop (int x) |
| double | get_flow_tput (int x) |
| double | get_flow_tput (int x) |
| double | get_link_delay (int x) |
| double | get_link_delay (int x) |
| double | get_link_drop (int x) |
| double | get_link_drop (int x) |
| double | get_link_pdelay (int x) |
| double | get_link_pdelay (int x) |
| double | get_link_qdelay (int x) |
| double | get_link_qdelay (int x) |
| double | get_link_tput (int x) |
| double | get_link_tput (int x) |
| void | GetInputs (char *argv) |
| void | GetInputs (char *argv) |
| int | isdebug () const |
| double | Lq (double rho, int K) |
| double | Lq (double rho, int K) |
| double | min (double x, double y) |
| double | min (double x, double y) |
| void | newupdate (int niter) |
| void | newupdate (int niter) |
| double | padhye (double rtt, double p) |
| double | padhye (double rtt, double p) |
| double | Pk (double rho, int K, int k) |
| double | Pk (double rho, int K, int k) |
| double | Po (double rho, int K) |
| double | Po (double rho, int K) |
| void | PrintData () |
| void | PrintData () |
| void | PrintResults () |
| void | PrintResults () |
| virtual void | recv (Packet *p, const char *s) |
| void | recv (Packet *, Handler *=0) |
| virtual void | recvOnly (Packet *) |
| double | redFn (double minth, double pmin, double maxth, double pmax, double qlength) |
| double | redFn (double minth, double pmin, double maxth, double pmax, double qlength) |
| void | Update (int niter) |
| void | Update (int niter) |
| void | Update2 () |
| void | Update3 (int flag=0) |
| void | UpdateHelper (int flag=0) |
| void | UpdateHelper (int flag=0) |
Data Fields | |
| int ** | Adj |
| int ** | Adj |
| flow_stats * | flows |
| flow_stats * | flows |
| int | K |
| link_stats * | links |
| link_stats * | links |
| int | MaxHops |
| int * | nAdj |
| int * | nAdj |
| int | nConnections |
| int | nLinks |
Protected Member Functions | |
| void | handle (Event *) |
| virtual void | reset () |
Protected Attributes | |
| int | debug_ |
|
|
Definition at line 964 of file asim.cc.
|
|
|
Definition at line 702 of file asimstd.cc.
|
|
|
Definition at line 591 of file asimstd.cc. 00591 { 00592 00593 //cout << nConnections; 00594 00595 for(int i=0; i<nConnections; i++) 00596 if(!flows[i].is_sflow && !flows[i].scaled){ 00597 //cout << "Connection " << i << " not scaled as yet\n"; 00598 return 0; 00599 } 00600 00601 cout << "All are scaled\n"; 00602 00603 return 1; 00604 00605 }
|
|
|
Definition at line 734 of file asim.cc. 00734 { 00735 00736 //cout << nConnections; 00737 00738 for(int i=0; i<nConnections; i++) 00739 if(!flows[i].is_sflow && !flows[i].scaled){ 00740 cout << "Connection " << i << " not scaled as yet\n"; 00741 return 0; 00742 } 00743 00744 //cout << "All are scaled\n"; 00745 00746 return 1; 00747 00748 }
|
|
|
Definition at line 567 of file asim.cc. Referenced by command(). 00567 { 00568 00569 // flag = 1 means enable RED 00570 00571 // Calculate Link delays ... basically queuing delays 00572 00573 for(int i=0; i<nLinks; i++){ 00574 00575 double rho = links[i].lambda/links[i].mu; 00576 double qlength = Lq(rho,links[i].buffer); 00577 00578 links[i].qdelay = qlength/links[i].mu; 00579 links[i].drop = Pk(rho,links[i].buffer,links[i].buffer); 00580 //cout << "rho = " << rho << " drop = " << links[i].drop << endl; 00581 00582 // Special code for RED gateways 00583 if(flag){ 00584 if(links[i].red){ 00585 double minth, maxth, pmin, pmax, delay,p; 00586 minth = links[i].minth; 00587 maxth = links[i].maxth; 00588 pmin = links[i].pmin; 00589 pmax = links[i].pmax; 00590 /* Debo's RED approx 00591 links[i].drop = redFn(minth,pmin,maxth,pmax,qlength/links[i].buffer); 00592 qlength = (1-links[i].drop)*links[i].buffer; 00593 links[i].qdelay = qlength/links[i].mu; 00594 */ 00595 00596 // Ashish's RED approx. 00597 p=(links[i].redrouter)->ComputeProbability(rho, delay); 00598 links[i].drop = p; 00599 qlength = Lq(rho*(1-p), links[i].buffer); 00600 links[i].qdelay = delay; 00601 } 00602 } 00603 00604 00605 //cout << "delay = " << links[i].qdelay << " and drop = " << links[i].drop << endl; 00606 00607 00608 } 00609 00610 }
|
|
|
Definition at line 429 of file asimstd.cc. Referenced by main(). 00429 { 00430 00431 // flag = 1 means enable RED 00432 00433 // Calculate Link delays ... basically queuing delays 00434 00435 for(int i=0; i<nLinks; i++){ 00436 00437 double rho = links[i].lambda/links[i].mu; 00438 double qlength = Lq(rho,links[i].buffer); 00439 00440 links[i].qdelay = qlength/links[i].mu; 00441 links[i].drop = Pk(rho,links[i].buffer,links[i].buffer); 00442 // cout << "Link " << i << " has drop prob = " << links[i].drop << endl; 00443 00444 // Special code for RED gateways 00445 if(flag){ 00446 if(links[i].red){ 00447 double minth, maxth, pmin, pmax, delay,p; 00448 minth = links[i].minth; 00449 maxth = links[i].maxth; 00450 pmin = links[i].pmin; 00451 pmax = links[i].pmax; 00452 00453 // The RED approx. 00454 p=(links[i].redrouter)->ComputeProbability(rho, delay); 00455 links[i].drop = p; 00456 qlength = Lq(rho*(1-p), links[i].buffer); 00457 links[i].qdelay = delay; 00458 } 00459 } 00460 // cout << i << sp << "rho = " << rho << " delay = " << links[i].qdelay << " and drop = " << links[i].drop << endl; 00461 } 00462 00463 }
|
|
|
Definition at line 612 of file asim.cc. Referenced by command(). 00612 { 00613 for(int i=0; i<nConnections; i++){ 00614 double d = 0, p = 1 ; 00615 // Calculate drops and delays 00616 for(int j=0;j<nAdj[i];j++){ 00617 d += 2*links[Adj[i][j]].prop + links[Adj[i][j]].qdelay; 00618 p *= 1-links[Adj[i][j]].drop; 00619 } 00620 p = 1-p; 00621 00622 flows[i].no = nAdj[i]; 00623 flows[i].delay = d; 00624 flows[i].drop = p; 00625 flows[i].t = flows[i].p_tput; 00626 00627 // p is the end2end drop prob 00628 // If its normal flow, calculate Padhye's stuff 00629 // If its short flow, use our approximations 00630 // Nothing more 00631 00632 00633 if(flows[i].is_sflow){ 00634 // If k flows come and each each flow has n packets to 00635 // send then 00636 double t = (flows[i].slambda*flows[i].snopkts); 00637 flows[i].p_tput = t/(1-p); 00638 } 00639 else{ 00640 // regular bulk TCP connections, Padhye et. al. 00641 if(!p){ 00642 // cout << "Oops, something wrong"; 00643 } 00644 flows[i].p_tput = padhye(d,p); 00645 } 00646 00647 // cout << "connection " << sp << i << sp << d << sp << p; 00648 //cout << sp << flows[i].p_tput << endl; 00649 00650 00651 } 00652 }
|
|
|
Definition at line 465 of file asimstd.cc. Referenced by main(). 00465 { 00466 00467 for(int i=0; i<nConnections; i++){ 00468 double d = 0, p = 1 ; 00469 // Calculate drops and delays 00470 for(int j=0;j<nAdj[i];j++){ 00471 d += 2*links[Adj[i][j]].prop + links[Adj[i][j]].qdelay; 00472 p *= 1-links[Adj[i][j]].drop; 00473 } 00474 p = 1-p; 00475 //cout << "Flow " << i << " has drop prob = " << p << endl; 00476 00477 flows[i].no = nAdj[i]; 00478 flows[i].delay = d; 00479 flows[i].drop = p; 00480 flows[i].t = flows[i].p_tput; 00481 00482 // p is the end2end drop prob 00483 // If its normal flow, calculate Padhye's stuff 00484 // If its short flow, use our approximations 00485 // Nothing more 00486 00487 00488 if(flows[i].is_sflow==1){ 00489 // If k flows come and each each flow has n packets to 00490 // send then 00491 double t = (flows[i].slambda*flows[i].snopkts); 00492 flows[i].p_tput = t/(1-p); 00493 } 00494 else if(flows[i].is_sflow==2){ 00495 // For CBR, dont divide by 1-p unlike short flows. 00496 // If rate is x and prob is p, net goodput is x(1-p) 00497 flows[i].p_tput = flows[i].slambda*(1-p); 00498 // cout << "cbr stuff - tput = " << flows[i].p_tput << endl; 00499 } 00500 else{ 00501 // regular bulk TCP connections, Padhye et. al. 00502 if(!p){ 00503 // cout << "Oops, something wrong"; 00504 } 00505 flows[i].p_tput = padhye(d,p); 00506 } 00507 00508 // cout << "connection " << sp << i << sp << d << sp << p; 00509 //cout << sp << flows[i].p_tput << endl; 00510 00511 00512 } 00513 }
|
|
||||||||||||
|
Reimplemented from NsObject. Definition at line 168 of file asim.cc. References CalcLinkDelays(), CalcPerFlowDelays(), and newupdate(). 00168 { 00169 00170 if (strcmp(argv[1], "run") == 0) { 00171 int niter=0; 00172 for(int i=0; i<20; i++){ 00173 CalcLinkDelays(1); 00174 CalcPerFlowDelays(); 00175 newupdate(niter); 00176 } 00177 //PrintResults(); 00178 return (TCL_OK); 00179 } 00180 00181 if (strcmp(argv[1], "readinput") == 0) { 00182 GetInputs((char*)argv[2]); 00183 //cout << "All inputs properly obtained from " << argv[2] <<endl ; 00184 return (TCL_OK); 00185 } 00186 00187 if (strcmp(argv[1], "get-link-drop") == 0) { 00188 cout << "Hi"; 00189 Tcl& tcl = Tcl::instance(); 00190 tcl.resultf("%lf",get_link_drop(atoi(argv[2]))); 00191 return (TCL_OK); 00192 } 00193 00194 if (strcmp(argv[1], "get-link-delay") == 0) { 00195 Tcl& tcl = Tcl::instance(); 00196 tcl.resultf("%lf",get_link_delay(atoi(argv[2]))); 00197 return (TCL_OK); 00198 } 00199 00200 if (strcmp(argv[1], "get-link-tput") == 0) { 00201 Tcl& tcl = Tcl::instance(); 00202 tcl.resultf("%lf",get_link_tput(atoi(argv[2]))); 00203 return (TCL_OK); 00204 } 00205 00206 if (strcmp(argv[1], "get-flow-tput") == 0) { 00207 Tcl& tcl = Tcl::instance(); 00208 tcl.resultf("%lf",get_flow_tput(atoi(argv[2]))); 00209 return (TCL_OK); 00210 } 00211 00212 if (strcmp(argv[1], "get-flow-delay") == 0) { 00213 Tcl& tcl = Tcl::instance(); 00214 tcl.resultf("%lf",get_flow_delay(atoi(argv[2]))); 00215 return (TCL_OK); 00216 } 00217 00218 if (strcmp(argv[1], "get-flow-drop") == 0) { 00219 Tcl& tcl = Tcl::instance(); 00220 tcl.resultf("%lf",get_flow_drop(atoi(argv[2]))); 00221 return (TCL_OK); 00222 } 00223 return 0; 00224 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_. 00103 { 00104 if (!debug_) 00105 return; 00106 va_list ap; 00107 va_start(ap, fmt); 00108 vprintf(fmt, ap); 00109 }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 63 of file object.cc. References NsObject::debug_. Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch(). 00064 { 00065 if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer)) 00066 return TCL_OK; 00067 return TclObject::delay_bind_dispatch(varName, localName, tracer); 00068 }
|
|
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
|
|
|
Definition at line 150 of file asimstd.cc. References c::delay, flows, and nConnections. 00150 { 00151 assert(x<nConnections); 00152 return flows[x].delay; 00153 }
|
|
|
Definition at line 251 of file asim.cc. 00251 { 00252 assert(x<nConnections); 00253 return flows[x].delay; 00254 }
|
|
|
Definition at line 160 of file asimstd.cc. References c::drop, flows, and nConnections. 00160 { 00161 assert(x<nConnections); 00162 return flows[x].drop; 00163 }
|
|
|
Definition at line 261 of file asim.cc. 00261 { 00262 assert(x<nConnections); 00263 return flows[x].drop; 00264 }
|
|
|
Definition at line 155 of file asimstd.cc. References flows, nConnections, and c::p_tput. 00155 { 00156 assert(x<nConnections); 00157 return flows[x].p_tput; 00158 }
|
|
|
Definition at line 256 of file asim.cc. 00256 { 00257 assert(x<nConnections); 00258 return flows[x].p_tput; 00259 }
|
|
|
Definition at line 130 of file asimstd.cc. References links, nLinks, n::prop, and n::qdelay.
|
|
|
Definition at line 231 of file asim.cc.
|
|
|
Definition at line 125 of file asimstd.cc. References n::drop, links, and nLinks.
|
|
|
Definition at line 226 of file asim.cc.
|
|
|
Definition at line 140 of file asimstd.cc. References links, nLinks, and n::prop.
|
|
|
Definition at line 241 of file asim.cc.
|
|
|
Definition at line 135 of file asimstd.cc. References links, nLinks, and n::qdelay.
|
|
|
Definition at line 236 of file asim.cc.
|
|
|
Definition at line 145 of file asimstd.cc. References n::lambda, links, and nLinks.
|
|
|
Definition at line 246 of file asim.cc.
|
|
|
Definition at line 165 of file asimstd.cc. References Adj, c::drop, flows, c::is_sflow, links, MaxHops, nAdj, nConnections, n::nflows, nLinks, c::scaled, c::slambda, c::snopkts, and n::theflows. 00165 { 00166 00167 // Init links and connections 00168 nConnections = 0; 00169 nLinks = 0; 00170 00171 // Start the reading process 00172 FILE *f; 00173 f = fopen(argv,"r"); 00174 assert(f); 00175 00176 char s[256]; 00177 while (fgets(s, 255, f)) { 00178 00179 // Read a token 00180 char *t; 00181 t = strtok(s, " \t\n"); 00182 00183 // Ignore comments 00184 if (!t || !t[0] || (t[0] == '#') || !strncasecmp(t, "comment", 6)) 00185 continue; 00186 00187 // Define the number of connections 00188 if (!strcasecmp(t,"n")) { 00189 t = strtok(NULL," \t"); 00190 assert(t); 00191 nConnections = atoi(t); 00192 assert(nConnections > 0); 00193 assert(nConnections >= 0); 00194 nAdj = new int[nConnections]; 00195 Adj = new int*[nConnections]; 00196 flows = new flow_stats[nConnections]; 00197 for (int i=0; i<nConnections; ++i) 00198 nAdj[i] = -1; 00199 continue; 00200 } 00201 00202 // Define the number of links 00203 else if (!strcasecmp(t,"m")) { 00204 00205 t = strtok(NULL," \t"); 00206 assert(t); 00207 // #of links defined 00208 nLinks = atoi(t); 00209 assert(nLinks > 0); 00210 // Allocate space for sotring lambdas and mus 00211 links = new link_stats[nLinks]; 00212 continue; 00213 } 00214 00215 // Enter each route 00216 else if (!strcasecmp(t,"route")) { 00217 00218 assert (nConnections > 0); 00219 assert (nLinks > 0); 00220 t = strtok(NULL," \t"); 00221 assert(t); 00222 int i = atoi(t); 00223 assert(i > 0 && i<= nConnections); 00224 i--; 00225 00226 // We dunno whether this will be short flow specs 00227 flows[i].is_sflow = 0; // Lets assume its a normal flow 00228 flows[i].drop = 0; // Assume ideal case to start off 00229 flows[i].scaled = 0; // Not scaled as yet 00230 00231 t = strtok(NULL," \t"); 00232 assert(t); 00233 nAdj[i] = atoi(t); 00234 assert(nAdj[i] > 0 && nAdj[i] <= nLinks); 00235 // We know how many links it will use 00236 Adj[i] = new int[nAdj[i]]; 00237 for (int j=0; j<nAdj[i]; ++j) { 00238 t = strtok(NULL," \t"); 00239 assert(t); 00240 int l = atoi(t); 00241 assert(l > 0 && l <= nLinks); 00242 l--; 00243 Adj[i][j] = l; 00244 } 00245 00246 if (MaxHops < nAdj[i]) MaxHops = nAdj[i]; 00247 00248 00249 t = strtok(NULL," \t"); 00250 // assert(t); 00251 00252 // Short flows stuff 00253 00254 if (t && !strcasecmp(t,"sh")) { 00255 // There are short flows on this route. 00256 flows[i].is_sflow = 1; 00257 00258 // read the slambda 00259 t = strtok(NULL," \t"); 00260 assert(t); 00261 double tmp = atof(t); 00262 flows[i].slambda = tmp; 00263 00264 // read the snopkts 00265 t = strtok(NULL," \t"); 00266 assert(t); 00267 int tmpi = atoi(t); 00268 flows[i].snopkts = tmpi; 00269 } 00270 00271 00272 // For cbr 00273 // Treat almost like a short flow! 00274 00275 if (t && !strcasecmp(t,"cbr")) { 00276 // There are short flows on this route. 00277 flows[i].is_sflow = 2; 00278 00279 // read the rate 00280 t = strtok(NULL," \t"); 00281 assert(t); 00282 double tmp = atof(t); 00283 flows[i].slambda = tmp; 00284 flows[i].snopkts = 1; 00285 } 00286 00287 00288 // Now, let us put the flows in persective 00289 // Insert the flow id trhough all the links 00290 int l_; 00291 for(int j=0;j<nAdj[i];j++){ 00292 l_ = Adj[i][j]; 00293 (links[l_].theflows).push_back(i); 00294 links[l_].nflows++; 00295 if(flows[i].is_sflow){ 00296 links[l_].lambda+=flows[i].slambda*flows[i].snopkts; 00297 } 00298 } 00299 00300 continue; 00301 } 00302 00303 else if(!strcasecmp(t,"link")){ 00304 00305 assert (nLinks > 0); 00306 00307 // Get the link number 00308 t = strtok(NULL," \t"); 00309 assert(t); 00310 int i = atoi(t); 00311 assert(i > 0 && i<= nLinks); 00312 i--; 00313 00314 // Get the prop delay 00315 t = strtok(NULL," \t"); 00316 assert(t); 00317 double p = atof(t); 00318 assert(p>=0); 00319 links[i].prop = p; 00320 00321 // Get the lambda for this link 00322 t = strtok(NULL," \t"); 00323 assert(t); 00324 p = atof(t); 00325 assert(p>=0); 00326 links[i].lambda = 0; 00327 links[i].tlambda = p; 00328 links[i].plambda = p; 00329 00330 // Get the mu for this link 00331 t = strtok(NULL," \t"); 00332 assert(t); 00333 p = atof(t); 00334 assert(p>=0); 00335 links[i].mu = p; 00336 00337 // Get the buffer for this link 00338 t = strtok(NULL," \t"); 00339 assert(t); 00340 int t1 = atoi(t); 00341 assert(t1>0); 00342 links[i].buffer = t1; 00343 00344 // Check for RED Q or not 00345 t = strtok(NULL," \t"); 00346 if(t && !strcasecmp(t,"red")){ 00347 00348 // must be a red queue 00349 // input red parameters 00350 // all parameters between 0 and 1 00351 links[i].red=1; 00352 // get minth 00353 t = strtok(NULL," \t"); 00354 double dt = atof(t); 00355 //assert(dt>=0 && dt<=1); 00356 links[i].minth=dt; 00357 00358 // get pmin 00359 t = strtok(NULL," \t"); 00360 dt = atof(t); 00361 //assert(dt>=0 && dt<=1); 00362 links[i].pmin=dt; 00363 00364 // get maxth 00365 t = strtok(NULL," \t"); 00366 dt = atof(t); 00367 //assert(dt>=0 && dt<=1); 00368 links[i].maxth=dt; 00369 00370 // get pmax 00371 t = strtok(NULL," \t"); 00372 dt = atof(t); 00373 //assert(dt>=0 && dt<=1); 00374 links[i].pmax=dt; 00375 00376 // Invoke Ashish's RED module ... ignore pmin ..... 00377 00378 links[i].redrouter = new RedRouter((int)links[i].minth, 00379 (int)links[i].maxth, 00380 links[i].pmax); 00381 assert(links[i].red); 00382 00383 } 00384 else{ 00385 links[i].red=0; 00386 } 00387 00388 links[i].nflows = 0; // init the num of flows 00389 00390 continue; 00391 00392 } 00393 00394 assert(0); 00395 } 00396 00397 // Check whether everything is all right 00398 assert (nConnections > 0); 00399 assert (nLinks > 0); 00400 for (int i=0; i<nConnections; ++i) 00401 assert(nAdj[i] > 0); 00402 00403 00404 }
|
|
|
Definition at line 266 of file asim.cc. Referenced by main(). 00266 { 00267 00268 // error if usage is wrong 00269 /* 00270 if (argc != 2) { 00271 fprintf(stderr,"Usage: %s <InputFile>\n", argv[0]); 00272 exit(-1); 00273 }*/ 00274 00275 // No error 00276 MaxHops = 0; 00277 // K = atoi(argv[1]); 00278 // assert(K >= 1); 00279 00280 00281 // Init links and connections 00282 nConnections = 0; 00283 nLinks = 0; 00284 00285 // Start the reading process 00286 FILE *f; 00287 f = fopen(argv,"r"); 00288 assert(f); 00289 00290 char s[256]; 00291 while (fgets(s, 255, f)) { 00292 00293 // Read a token 00294 char *t; 00295 t = strtok(s, " \t\n"); 00296 00297 // Ignore comments 00298 if (!t || !t[0] || (t[0] == '#') || !strncasecmp(t, "comment", 6)) 00299 continue; 00300 00301 // Define the number of connections 00302 if (!strcasecmp(t,"n")) { 00303 t = strtok(NULL," \t"); 00304 assert(t); 00305 nConnections = atoi(t); 00306 assert(nConnections > 0); 00307 assert(nConnections >= 0); 00308 nAdj = new int[nConnections]; 00309 Adj = new int*[nConnections]; 00310 flows = new flow_stats[nConnections]; 00311 for (int i=0; i<nConnections; ++i) 00312 nAdj[i] = -1; 00313 continue; 00314 } 00315 00316 // Define the number of links 00317 else if (!strcasecmp(t,"m")) { 00318 00319 t = strtok(NULL," \t"); 00320 assert(t); 00321 // #of links defined 00322 nLinks = atoi(t); 00323 assert(nLinks > 0); 00324 // Allocate space for sotring lambdas and mus 00325 links = new link_stats[nLinks]; 00326 continue; 00327 } 00328 00329 // Enter each route 00330 else if (!strcasecmp(t,"route")) { 00331 00332 assert (nConnections > 0); 00333 assert (nLinks > 0); 00334 t = strtok(NULL," \t"); 00335 assert(t); 00336 int i = atoi(t); 00337 assert(i > 0 && i<= nConnections); 00338 i--; 00339 00340 // We dunno whether this will be short flow specs 00341 flows[i].is_sflow = 0; // Lets assume its a normal flow 00342 flows[i].drop = 0; // Assume ideal case to start off 00343 flows[i].scaled = 0; // Not scaled as yet 00344 00345 t = strtok(NULL," \t"); 00346 assert(t); 00347 nAdj[i] = atoi(t); 00348 assert(nAdj[i] > 0 && nAdj[i] <= nLinks); 00349 Adj[i] = new int[nAdj[i]]; 00350 for (int j=0; j<nAdj[i]; ++j) { 00351 t = strtok(NULL," \t"); 00352 assert(t); 00353 int l = atoi(t); 00354 assert(l > 0 && l <= nLinks); 00355 l--; 00356 Adj[i][j] = l; 00357 } 00358 00359 if (MaxHops < nAdj[i]) MaxHops = nAdj[i]; 00360 00361 00362 t = strtok(NULL," \t"); 00363 // assert(t); 00364 00365 // Short flows stuff 00366 00367 if (t && !strcasecmp(t,"sh")) { 00368 // There are short flows on this route. 00369 flows[i].is_sflow = 1; 00370 00371 // read the slambda 00372 t = strtok(NULL," \t"); 00373 assert(t); 00374 double tmp = atof(t); 00375 flows[i].slambda = tmp; 00376 00377 // read the snopkts 00378 t = strtok(NULL," \t"); 00379 assert(t); 00380 int tmpi = atoi(t); 00381 flows[i].snopkts = tmpi; 00382 } 00383 00384 continue; 00385 } 00386 00387 else if(!strcasecmp(t,"link")){ 00388 00389 assert (nLinks > 0); 00390 00391 // Get the link number 00392 t = strtok(NULL," \t"); 00393 assert(t); 00394 int i = atoi(t); 00395 assert(i > 0 && i<= nLinks); 00396 i--; 00397 00398 // Get the prop delay 00399 t = strtok(NULL," \t"); 00400 assert(t); 00401 double p = atof(t); 00402 assert(p>=0); 00403 links[i].prop = p; 00404 00405 // Get the lambda for this link 00406 t = strtok(NULL," \t"); 00407 assert(t); 00408 p = atof(t); 00409 assert(p>=0); 00410 links[i].lambda = 0; 00411 links[i].tlambda = p; 00412 links[i].plambda = p; 00413 00414 // Get the mu for this link 00415 t = strtok(NULL," \t"); 00416 assert(t); 00417 p = atof(t); 00418 assert(p>=0); 00419 links[i].mu = p; 00420 00421 // Get the buffer for this link 00422 t = strtok(NULL," \t"); 00423 assert(t); 00424 int t1 = atoi(t); 00425 assert(t1>0); 00426 links[i].buffer = t1; 00427 00428 // Check for RED Q or not 00429 t = strtok(NULL," \t"); 00430 if(t && !strcasecmp(t,"red")){ 00431 00432 // must be a red queue 00433 // input red parameters 00434 // all parameters between 0 and 1 00435 links[i].red=1; 00436 // get minth 00437 t = strtok(NULL," \t"); 00438 double dt = atof(t); 00439 //assert(dt>=0 && dt<=1); 00440 links[i].minth=dt; 00441 00442 // get pmin 00443 t = strtok(NULL," \t"); 00444 dt = atof(t); 00445 //assert(dt>=0 && dt<=1); 00446 links[i].pmin=dt; 00447 00448 // get maxth 00449 t = strtok(NULL," \t"); 00450 dt = atof(t); 00451 //assert(dt>=0 && dt<=1); 00452 links[i].maxth=dt; 00453 00454 // get pmax 00455 t = strtok(NULL," \t"); 00456 dt = atof(t); 00457 //assert(dt>=0 && dt<=1); 00458 links[i].pmax=dt; 00459 00460 // Invoke Ashish's RED module ... ignore pmin ..... 00461 00462 links[i].redrouter = new RedRouter((int)links[i].minth, 00463 (int)links[i].maxth, 00464 links[i].pmax); 00465 assert(links[i].red); 00466 00467 } 00468 else{ 00469 links[i].red=0; 00470 } 00471 00472 continue; 00473 00474 } 00475 00476 assert(0); 00477 } 00478 00479 // Check whether everything is all right 00480 assert (nConnections > 0); 00481 assert (nLinks > 0); 00482 int i; 00483 for (i=0; i<nConnections; ++i) 00484 assert(nAdj[i] > 0); 00485 00486 00487 // check all the edges and store all the connections that flow 00488 // through a particular link 00489 00490 for(i=0;i<nLinks;i++){ 00491 00492 // cout << i << sp; 00493 int c=0; links[i].tlambda=0; 00494 00495 for(int j=0;j<nConnections;j++){ 00496 for(int k=0;k<nAdj[j];k++){ 00497 if(Adj[j][k]==i){ 00498 c++; 00499 } 00500 } 00501 } 00502 links[i].nflows=c; 00503 //cout << c << sp; 00504 00505 if(c){ 00506 links[i].theflows = new int[c]; 00507 c = 0; 00508 // Store teh flows 00509 for(int j=0;j<nConnections;j++){ 00510 for(int k=0;k<nAdj[j];k++){ 00511 if(Adj[j][k]==i){ 00512 if(flows[j].is_sflow){ 00513 links[i].lambda+=flows[j].slambda*flows[j].snopkts; 00514 } 00515 links[i].theflows[c++]=j; 00516 // cout << links[i].theflows[c-1] << sp; 00517 } 00518 } 00519 } 00520 // cout << " slambda = " << links[i].lambda; 00521 } 00522 00523 else links[i].theflows = 0; // no connection passing through this edge 00524 //cout << endl; 00525 00526 00527 00528 } 00529 00530 /* 00531 char c= getchar(); 00532 00533 for(int i=0;i<nConnections;i++){ 00534 cout << "connection" << sp << i << sp << "-"; 00535 for(int j=0;j<nAdj[i];j++){ 00536 cout << sp << Adj[i][j]; 00537 } 00538 cout << endl; 00539 } 00540 */ 00541 00542 }
|
|
|
Implements Handler. Reimplemented in LinkDelay, LL, AckRecons, and Snoop. Definition at line 91 of file object.cc. References NsObject::recv().
Here is the call graph for this function: ![]() |
|
|
Definition at line 61 of file object.h. References NsObject::debug_. 00061 { return debug_; }
|
|
||||||||||||
|
Definition at line 110 of file asimstd.cc. References pow(). 00110 { 00111 00112 double t1,t2; 00113 00114 if(rho==1){ 00115 return (1.0*K*(K-1))/(2.0*(K+1)); 00116 } 00117 00118 t1=rho*1.0/(1-rho); 00119 t2=rho*1.0/(1-pow(rho,K+1)); 00120 t2*=K*pow(rho,K)+1; 00121 return (t1-t2)/2; 00122 00123 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 153 of file asim.cc. References pow(). 00153 { 00154 00155 double t1,t2; 00156 00157 if(rho==1){ 00158 return (1.0*K*(K-1))/(2.0*(K+1)); 00159 } 00160 00161 t1=rho*1.0/(1-rho); 00162 t2=rho*1.0/(1-pow(rho,K+1)); 00163 t2*=K*pow(rho,K)+1; 00164 return (t1-t2)/2; 00165 00166 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 72 of file asimstd.cc.
|
|
||||||||||||
|
Definition at line 118 of file asim.cc. Referenced by padhye().
|
|
|
Definition at line 610 of file asimstd.cc. 00610 { 00611 00612 // 1st init all unscaled tputs and cap 00613 00614 for (int i=0;i<nLinks;i++){ 00615 links[i].uc = links[i].mu*(1.05); 00616 links[i].utput = 0; 00617 } 00618 00619 00620 // calc all the unscaled tputs and C set all short flows 00621 // to be scaled already 00622 for(int i=0; i<nConnections; i++){ 00623 if(flows[i].is_sflow) 00624 flows[i].scaled = 1; 00625 else 00626 flows[i].scaled = 0; 00627 for(int j=0;j<nAdj[i];j++){ 00628 if(flows[i].is_sflow) 00629 links[Adj[i][j]].uc -= flows[i].p_tput; 00630 else 00631 links[Adj[i][j]].utput += flows[i].p_tput; 00632 } 00633 } 00634 00635 //for(int i =0; i<nLinks; i++ ){ 00636 //cout << i << sp << links[i].uc << sp << links[i].utput << endl; 00637 //} 00638 00639 double maxgamma; // most congested link 00640 int bneck; 00641 double t; 00642 00643 bneck = -1; 00644 maxgamma = 0; 00645 for(int i=0; i<nLinks; i++){ 00646 if(links[i].uc){ 00647 t=links[i].utput/links[i].uc; 00648 if(t > maxgamma){ 00649 bneck = i; 00650 maxgamma = t; 00651 } 00652 } 00653 } 00654 00655 while(bneck+1){ 00656 00657 //cout << "bneck = " << bneck << sp << links[bneck].uc << sp << links[bneck].utput << sp << maxgamma << sp << links[bneck].nflows <<endl; 00658 for(int i=0; i<links[bneck].nflows; i++){ 00659 // For all the connections passing through this link 00660 int t = links[bneck].theflows[i]; // get a connection id 00661 // cout << i<< sp << t << sp ; 00662 // Now reduce its p_tput iff its not a short flow 00663 // For short flows we dont do scaling 00664 if(!flows[t].is_sflow && !flows[t].scaled){ 00665 flows[t].p_tput /= maxgamma; 00666 //cout << "Flow " << t << " getting scaled to << " << flows[t].p_tput; 00667 flows[t].scaled = 1; // we have scaled this flow already 00668 for(int j=0;j<nAdj[t];j++){ 00669 // subtract this scaled throughout from all teh links that 00670 // have this flow. 00671 links[Adj[t][j]].uc -= flows[t].p_tput; 00672 links[Adj[t][j]].utput -= flows[t].p_tput*maxgamma; 00673 // cout << sp << Adj[i][j]; 00674 } 00675 //cout << endl; 00676 } 00677 } 00678 00679 //cout << links[bneck].uc << sp << links[bneck].utput << endl; 00680 00681 links[bneck].uc = 0; 00682 00683 bneck = -1; 00684 maxgamma = 0; 00685 for(int i=0; i<nLinks; i++){ 00686 if(links[i].uc){ 00687 t=links[i].utput/links[i].uc; 00688 if(t > maxgamma){ 00689 bneck = i; 00690 maxgamma = t; 00691 } 00692 } 00693 } 00694 00695 } 00696 00697 Update(niter); 00698 00699 }
|
|
|
Definition at line 844 of file asim.cc. Referenced by command(), and main(). 00844 { 00845 00846 int i; 00847 00848 // 1st init all unscaled tputs and cap 00849 for (i=0;i<nLinks;i++){ 00850 links[i].uc = links[i].mu*(1.05); 00851 links[i].utput = 0; 00852 } 00853 00854 00855 // calc all the unscaled tputs and C set all short flows 00856 // to be scaled already 00857 for(i=0; i<nConnections; i++){ 00858 if(flows[i].is_sflow) 00859 flows[i].scaled = 1; 00860 else 00861 flows[i].scaled = 0; 00862 for(int j=0;j<nAdj[i];j++){ 00863 if(flows[i].is_sflow) 00864 links[Adj[i][j]].uc -= flows[i].p_tput; 00865 else 00866 links[Adj[i][j]].utput += flows[i].p_tput; 00867 } 00868 } 00869 00870 // for(i=0; i<nLinks; i++ ){ 00871 //cout << i << sp << links[i].uc << sp << links[i].utput << endl; 00872 //} 00873 00874 double maxgamma; // most congested link 00875 int bneck; 00876 double t; 00877 00878 bneck = -1; 00879 maxgamma = 0; 00880 for(i=0; i<nLinks; i++){ 00881 if(links[i].uc){ 00882 t=links[i].utput/links[i].uc; 00883 if(t > maxgamma){ 00884 bneck = i; 00885 maxgamma = t; 00886 } 00887 } 00888 } 00889 00890 //cout << bneck << endl; 00891 00892 //char c= getchar(); 00893 /* 00894 for(i=0;i<nConnections;i++){ 00895 cout << "connection" << sp << i << sp << "-"; 00896 for(int j=0;j<nAdj[i];j++){ 00897 cout << sp << Adj[i][j]; 00898 } 00899 cout << endl; 00900 } 00901 */ 00902 // c= getchar(); 00903 00904 while(bneck+1){ 00905 00906 // cout << "bneck = " << bneck << sp << links[bneck].uc << sp << links[bneck].utput << sp << maxgamma << sp << links[bneck].nflows <<endl; 00907 00908 for(i=0; i<links[bneck].nflows; i++){ 00909 // For all the connections passing through this link 00910 int t = links[bneck].theflows[i]; // get a connection id 00911 // cout << i<< sp << t << sp ; 00912 // Now reduce its p_tput iff its not a short flow 00913 // For short flows we dont do scaling 00914 if(!flows[t].is_sflow && !flows[t].scaled){ 00915 flows[t].p_tput /= maxgamma; 00916 //cout << "Flow " << t << " getting scaled to << " << flows[t].p_tput; 00917 flows[t].scaled = 1; // we have scaled this flow already 00918 for(int j=0;j<nAdj[t];j++){ 00919 // subtract this scaled throughout from all teh links that 00920 // have this flow. 00921 links[Adj[t][j]].uc -= flows[t].p_tput; 00922 links[Adj[t][j]].utput -= flows[t].p_tput*maxgamma; 00923 // cout << sp << Adj[i][j]; 00924 } 00925 //cout << endl; 00926 } 00927 } 00928 00929 // cout << links[bneck].uc << sp << links[bneck].utput << endl; 00930 00931 links[bneck].uc = 0; 00932 00933 bneck = -1; 00934 maxgamma = 0; 00935 for(i=0; i<nLinks; i++){ 00936 if(links[i].uc){ 00937 t=links[i].utput/links[i].uc; 00938 if(t > maxgamma){ 00939 bneck = i; 00940 maxgamma = t; 00941 } 00942 } 00943 } 00944 /* 00945 c = getchar(); 00946 00947 for(i=0;i<nConnections;i++){ 00948 cout << "connection" << sp << i << sp << "-"; 00949 for(int j=0;j<nAdj[i];j++){ 00950 cout << sp << Adj[i][j]; 00951 } 00952 cout << endl; 00953 }*/ 00954 00955 // c=getchar(); 00956 00957 } 00958 00959 Update(niter); 00960 00961 }
|
|
||||||||||||
|
Definition at line 76 of file asimstd.cc. References min(). 00076 { 00077 00078 double rto = 1; 00079 double t=1; 00080 t = rtt*sqrt(2*p/3)+rto*min(1,(3*sqrt(3*p/8)))*p*(1+32*p*p); 00081 return min(20/rtt,1/t); 00082 00083 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 122 of file asim.cc. References min(). 00122 { 00123 00124 double rto = 1; 00125 double t=1; 00126 t = rtt*sqrt(2*p/3)+rto*min(1,(3*sqrt(3*p/8)))*p*(1+32*p*p); 00127 return min(20/rtt,1/t); 00128 00129 }
Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 96 of file asimstd.cc. References pow(). 00096 { 00097 00098 if(rho==1) 00099 return 1.0/(K+1); 00100 00101 if(rho==0) 00102 return 0; 00103 00104 double t; 00105 // M/M/1/K 00106 t=((1-rho)*pow(rho,k))/(1-pow(rho,K+1)); 00107 return t; 00108 }
Here is the call graph for this function: ![]() |
|
||||||||||||||||
|
Definition at line 142 of file asim.cc. References pow(). 00142 { 00143 00144 if(rho==1) 00145 return 1.0/(K+1); 00146 00147 double t; 00148 t=(1-rho)*pow(rho,k); 00149 t/=1-pow(rho,K+1); 00150 return t; 00151 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 85 of file asimstd.cc. References pow(). 00085 { 00086 00087 if(rho==1) 00088 return 1.0/(K+1); 00089 00090 double t; 00091 t=(1.0*(1-rho))/(1.0-pow(rho,K)); 00092 return t; 00093 00094 }
Here is the call graph for this function: ![]() |
|
||||||||||||
|
Definition at line 131 of file asim.cc. References pow(). 00131 { 00132 00133 if(rho==1) 00134 return 1.0/(K+1); 00135 00136 double t; 00137 t=(1.0*(1-rho))/(1.0-pow(rho,K)); 00138 return t; 00139 00140 }
Here is the call graph for this function: ![]() |
|
|
Definition at line 515 of file asimstd.cc. References sp. 00515 { 00516 for(int i=0;i<nLinks;i++){ 00517 cout << i << sp << links[i].lambda << sp << links[i].mu; 00518 cout << sp << links[i].buffer << endl; 00519 } 00520 }
|
|
|
Definition at line 654 of file asim.cc. References sp. 00654 { 00655 for(int i=0;i<nLinks;i++){ 00656 cout << i << sp << links[i].lambda << sp << links[i].mu; 00657 cout << sp << links[i].buffer << endl; 00658 } 00659 }
|
|
|
Definition at line 523 of file asimstd.cc. 00523 { 00524 00525 for(int i=0;i<nLinks;i++){ 00526 printf("l %d qdel %.5lf drop %.5lf lam %.3lf\n", i+1, links[i].qdelay, links[i].drop,links[i].lambda); 00527 } 00528 00529 for(int i=0; i<nConnections; i++){ 00530 printf("c %d gput %.5lf drop %.5lf e2edel %.5lf\n", i+1, 00531 flows[i].p_tput, 00532 flows[i].drop, 00533 flows[i].delay); 00534 } 00535 00536 }
|
|
|
Definition at line 661 of file asim.cc. References sp. 00661 { 00662 int i; 00663 00664 for(i=0;i<nLinks;i++){ 00665 // cout << i << sp << links[i].qdelay << sp << links[i].drop; 00666 cout << sp << "Qdelay = " << links[i].prop << sp << links[i].lambda; 00667 cout << sp << links[i].drop << endl; 00668 } 00669 00670 for(i=0; i<nConnections; i++){ 00671 cout << i << sp << flows[i].delay << sp; 00672 cout << flows[i].drop << sp << flows[i].p_tput << sp; 00673 cout << sp << endl; 00674 } 00675 00676 }
|
|
||||||||||||
|
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: ![]() |
|
||||||||||||
|
Implements NsObject. Definition at line 968 of file asim.cc.
|
|
|
Reimplemented in Agent, and Trace. Definition at line 56 of file object.h. Referenced by Trace::recvOnly().
|
|
||||||||||||||||||||||||
|
Definition at line 408 of file asimstd.cc. 00409 { 00410 00411 assert(qlength>=0 && qlength<=1); 00412 assert(pmax>=0 && pmax<=1); 00413 assert(pmin>=0 && pmin<=1); 00414 assert(minth>=0 && minth<=1); 00415 assert(maxth>=0 && maxth<=1); 00416 assert(maxth>=minth); 00417 assert(pmax>pmin); 00418 00419 double t; 00420 if(qlength<minth) 00421 return 0; 00422 if(qlength>maxth) 00423 return 1; 00424 return pmin + (qlength-minth)/(pmax-pmin); 00425 00426 }
|
|
||||||||||||||||||||||||
|
Definition at line 546 of file asim.cc. 00547 { 00548 00549 assert(qlength>=0 && qlength<=1); 00550 assert(pmax>=0 && pmax<=1); 00551 assert(pmin>=0 && pmin<=1); 00552 assert(minth>=0 && minth<=1); 00553 assert(maxth>=0 && maxth<=1); 00554 assert(maxth>=minth); 00555 assert(pmax>pmin); 00556 00557 //Double t; 00558 if(qlength<minth) 00559 return 0; 00560 if(qlength>maxth) 00561 return 1; 00562 return pmin + (qlength-minth)/(pmax-pmin); 00563 00564 }
|
|
|
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, Queue< T >, and XcpSink. Definition at line 70 of file object.cc. Referenced by NsObject::command().
|
|
|
Definition at line 565 of file asimstd.cc. 00565 { 00566 00567 UpdateHelper(); 00568 00569 for(int i=0; i<nLinks; i++){ 00570 links[i].plambda = links[i].lambda; 00571 double t; 00572 double tk=links[i].mu*(1.05)+5; 00573 00574 if(niter){ 00575 if(links[i].tlambda>tk) 00576 //t = pow((sqrt(links[i].lambda)+sqrt(links[i].mu+5))/2,2); 00577 t = ((links[i].lambda)+tk)/2; 00578 // t = exp((log(links[i].lambda)+log(links[i].mu+5))/2); 00579 else 00580 //t = pow((sqrt(links[i].tlambda)+sqrt(links[i].lambda))/2,2); 00581 t= ((links[i].tlambda)+(links[i].lambda))/2; 00582 // t = exp((log(links[i].tlambda)+log(links[i].lambda))/2); 00583 } 00584 else t = links[i].tlambda; 00585 links[i].lambda = t; // Update the lambda .......... 00586 } 00587 00588 }
|
|
|
Definition at line 698 of file asim.cc. 00698 { 00699 00700 UpdateHelper(); 00701 00702 for(int i=0; i<nLinks; i++){ 00703 links[i].plambda = links[i].lambda; 00704 double t; 00705 double tk=links[i].mu*(1.1); 00706 00707 if(niter){ 00708 if(links[i].tlambda>tk) 00709 //t = pow((sqrt(links[i].lambda)+sqrt(links[i].mu+5))/2,2); 00710 t = ((links[i].lambda)+tk)/2; 00711 // t = exp((log(links[i].lambda)+log(links[i].mu+5))/2); 00712 else 00713 //t = pow((sqrt(links[i].tlambda)+sqrt(links[i].lambda))/2,2); 00714 t= ((links[i].tlambda)+(links[i].lambda))/2; 00715 // t = exp((log(links[i].tlambda)+log(links[i].lambda))/2); 00716 } 00717 else t = links[i].tlambda; 00718 links[i].lambda = t; // Update the lambda .......... 00719 } 00720 00721 }
|
|
|
Definition at line 724 of file asim.cc. 00724 { 00725 00726 UpdateHelper(); 00727 00728 for(int i=0; i<nLinks; i++){ 00729 links[i].plambda = links[i].lambda; 00730 links[i].lambda = (links[i].lambda + links[i].tlambda)/2; 00731 } 00732 }
|
|
|
Definition at line 751 of file asim.cc. 00751 { 00752 00753 // flag = 1 means dont touch short flows in your scaling algo 00754 00755 00756 double maxtlambda = -1e7; 00757 int bneck = -1; 00758 int i; 00759 00760 // 1st get set scaled var of all flows to 0 00761 for(i=0; i<nConnections; i++) 00762 flows[i].scaled = 0; 00763 00764 // Calculate the tlambdas 00765 UpdateHelper(); 00766 00767 // Find out the link with the max throughput 00768 00769 for(i=0; i<nLinks; i++){ 00770 //cout << "after updatehelper link #" << i << " " << links[i].tlambda << "\n"; 00771 if(links[i].tlambda>maxtlambda){ 00772 bneck = i; 00773 maxtlambda = links[i].tlambda; 00774 } 00775 } 00776 00777 cout << "bottleneck = " << bneck << sp << maxtlambda <<endl; 00778 00779 double tk = links[bneck].mu*(1+links[bneck].drop)+5; 00780 // We cant go above this tk ...... 00781 00782 while((maxtlambda > tk + 1) && ! allscaled()){ 00783 00784 cout << "Maxtlambda = " << maxtlambda << " bneck = " << bneck << endl; 00785 00786 // cout << "tk = "<< tk << " maxlambda = " << maxtlambda << endl; 00787 00788 // Now lets reduce this to tk 00789 assert(bneck>=0 && bneck<=nLinks); 00790 int i; 00791 for(i=0; i<links[bneck].nflows; i++){ 00792 00793 // For all the connections passing through this link 00794 int t = links[bneck].theflows[i]; // get a connection id 00795 // Now reduce its p_tput iff its not a short flow 00796 // For short flows we dont do scaling 00797 if(flag){ 00798 if(!flows[t].is_sflow && !flows[t].scaled){ 00799 flows[t].p_tput *= (tk)/maxtlambda; 00800 //cout << "Flow " << t << " getting scaled to << " << flows[t].p_tput <<" \n"; 00801 flows[t].scaled = 1; // we have scaled this flow already 00802 } 00803 } 00804 else 00805 flows[t].p_tput *= (tk)/maxtlambda; 00806 flows[t].scaled = 1; // we have scaled this flow already 00807 00808 } 00809 00810 for (i=0; i<nLinks;i++){ 00811 cout << "Link " << i << " tlambda = " << links[i].tlambda << endl; 00812 } 00813 00814 //Char x =getchar(); 00815 00816 // Recalculate the flows' stats 00817 UpdateHelper(0); 00818 00819 // Find out the link with the max throughput 00820 bneck = -1; 00821 maxtlambda = -1e7; 00822 for(i=0; i<nLinks; i++){ 00823 if(links[i].tlambda>maxtlambda){ 00824 bneck = i; 00825 maxtlambda = links[i].tlambda; 00826 } 00827 } 00828 00829 00830 tk = links[bneck].mu*(1+links[bneck].drop)+5; 00831 00832 00833 } 00834 00835 Update(0); 00836 cout << "Out of the converge loop\n"; 00837 for (i =0; i<nLinks;i++){ 00838 cout << "Link " << i << " tlambda = " << links[i].tlambda << endl; 00839 } 00840 00841 }
|
|
|
Definition at line 538 of file asimstd.cc. 00538 { 00539 00540 // if flag = 1 then update only when link is unscaled as of now 00541 // if flag = 0 then do the usual update 00542 00543 for(int i=0; i<nLinks; i++){ 00544 links[i].tlambda=0; 00545 } 00546 00547 for(int i=0; i<nConnections; i++){ 00548 if(!flag || !flows[i].scaled) 00549 for(int j=0;j<nAdj[i];j++){ 00550 if(flows[i].is_sflow==2){ 00551 // cbr flow 00552 links[Adj[i][j]].tlambda += flows[i].slambda*(1-links[Adj[i][j]].drop); 00553 //cout << "cbr flow " << i << " adding " << flows[i].slambda*(1-links[Adj[i][j]].drop) 00554 // << " to link " << j << " tlam = " << links[Adj[i][j]].tlambda << endl; 00555 } 00556 else 00557 links[Adj[i][j]].tlambda += flows[i].p_tput; 00558 } 00559 // cout << flows[i].p_tput << "\n"; 00560 } 00561 00562 }
|
|
|
Definition at line 678 of file asim.cc. 00678 { 00679 00680 // if flag = 1 then update only when link is unscaled as of now 00681 // if flag = 0 then do the usual update 00682 00683 int i; 00684 for(i=0; i<nLinks; i++){ 00685 links[i].tlambda=0; 00686 } 00687 00688 for(i=0; i<nConnections; i++){ 00689 if(!flag || !flows[i].scaled) 00690 for(int j=0;j<nAdj[i];j++) 00691 links[Adj[i][j]].tlambda += flows[i].p_tput; 00692 // cout << flows[i].p_tput << "\n"; 00693 } 00694 00695 }
|
|
|
Definition at line 66 of file asimstd.cc. |
|
|
Definition at line 112 of file asim.cc. Referenced by GetInputs(). |
|
|
Reimplemented in FECModel, FloodAgent, and LandmarkAgent. Definition at line 66 of file object.h. Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), SctpAgent::Reset(), REDQueue::reset(), DropTail::shrink_queue(), and Delayer::try_send(). |
|
|
Definition at line 70 of file asimstd.cc. |
|
|
Definition at line 116 of file asim.cc. Referenced by get_flow_delay(), get_flow_drop(), get_flow_tput(), and GetInputs(). |
|
|
|
|
|
Definition at line 69 of file asimstd.cc. |
|
|
Definition at line 115 of file asim.cc. Referenced by get_link_delay(), get_link_drop(), get_link_pdelay(), get_link_qdelay(), get_link_tput(), and GetInputs(). |
|
|
Definition at line 110 of file asim.cc. Referenced by GetInputs(). |
|
|
Definition at line 67 of file asimstd.cc. |
|
|
Definition at line 113 of file asim.cc. Referenced by GetInputs(). |
|
|
Definition at line 109 of file asim.cc. Referenced by get_flow_delay(), get_flow_drop(), get_flow_tput(), and GetInputs(). |
|
|
Definition at line 111 of file asim.cc. Referenced by get_link_delay(), get_link_drop(), get_link_pdelay(), get_link_qdelay(), get_link_tput(), and GetInputs(). |
1.4.6