#include <diff_prob.h>
Inheritance diagram for DiffusionProb:


Public Member Functions | |
| DiffusionProb () | |
| void | recv (Packet *, Handler *) |
| int | command (int argc, const char *const *argv) |
| 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,...) |
Public Attributes | |
| Diff_Routing_Entry | routing_table [MAX_DATA_TYPE] |
Protected Member Functions | |
| void | Start () |
| void | consider_old (Packet *) |
| void | consider_new (Packet *) |
| void | add_outlist (unsigned int, From_List *) |
| void | data_request_all (unsigned int dtype) |
| void | CreateIOList (Pkt_Hash_Entry *, unsigned int) |
| void | UpdateIOList (From_List *, unsigned int) |
| void | Print_IOlist () |
| void | CalGradient (unsigned int) |
| void | IncGradient (unsigned int, ns_addr_t) |
| void | DecGradient (unsigned int, ns_addr_t) |
| void | ForwardData (Packet *) |
| void | ForwardTxFailed (Packet *) |
| void | ReTxData (Packet *) |
| void | GenPosReinf (unsigned int) |
| void | FwdPosReinf (unsigned int, Packet *) |
| void | InterfaceDown (int, ns_addr_t) |
| void | SendInhibit (int) |
| void | SendNegReinf () |
| void | InterestPropagate (Packet *pkt, Pkt_Hash_Entry *hashPtr) |
| void | xmitFailed (Packet *pkt) |
| void | send_to_dmux (Packet *pkt, Handler *h) |
| void | clear_arp_buf () |
| void | clear_send_buf () |
| void | reset () |
| void | Terminate () |
| Packet * | create_packet () |
| Packet * | prepare_message (unsigned int dtype, ns_addr_t to_addr, int msg_type) |
| void | DataForSink (Packet *) |
| void | StopSource () |
| void | MACprepare (Packet *pkt, nsaddr_t next_hop, int type, bool lk_dtct) |
| void | MACsend (Packet *pkt, Time delay=0) |
| void | StickPacketInArpBuffer (Packet *pkt) |
| void | ArpBufferCheck () |
| void | SendBufferCheck () |
| void | StickPacketInSendBuffer (Packet *p) |
| void | trace (char *fmt,...) |
| virtual void | trace (TracedVar *v) |
| 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 |
| 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) |
| void | handle (Event *) |
Protected Attributes | |
| int | num_neg_bcast_send |
| int | num_neg_bcast_rcv |
| EnergyTimer * | energy_timer |
| bool | is_low_power |
| bool | POS_REINF_ |
| bool | NEG_REINF_ |
| int | pk_count |
| int | overhead |
| Pkt_Hash_Table | PktTable |
| Node * | node |
| Trace * | tracetarget |
| NsObject * | ll |
| NsObject * | port_dmux |
| ARPTable * | arp_table |
| ArpBufferTimer | arp_buf_timer |
| ArpBufEntry | arp_buf [ARP_BUF_SIZE] |
| SendBufTimer | send_buf_timer |
| SendBufferEntry | send_buf [SEND_BUF_SIZE] |
| 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_ |
Friends | |
| class | InterestTimer |
| class | EnergyTimer |
| class | ArpBufferTimer |
| class | SendBufTimer |
| void | XmitFailedCallback (Packet *pkt, void *data) |
|
|
Definition at line 94 of file diff_prob.cc. References is_low_power, num_neg_bcast_rcv, and num_neg_bcast_send.
00094 : DiffusionAgent() 00095 { 00096 is_low_power = false; 00097 num_neg_bcast_send = 0; 00098 num_neg_bcast_rcv = 0; 00099 } |
|
||||||||||||
|
Definition at line 671 of file diff_prob.cc. References AGT_ADDR, INTF_INSERT, From_List::is_sink, Diff_Routing_Entry::num_active, From_List::rank, and DiffusionAgent::routing_table. Referenced by CreateIOList(), and UpdateIOList().
00672 {
00673 Out_List *outPtr = new Out_List;
00674
00675 AGT_ADDR(outPtr) = AGT_ADDR(foundPtr);
00676 outPtr->rank = foundPtr->rank;
00677 outPtr->is_sink = foundPtr->is_sink;
00678
00679 INTF_INSERT(routing_table[dtype].active, outPtr);
00680 routing_table[dtype].num_active ++;
00681 }
|
|
|
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 494 of file diffusion.cc. References DiffusionAgent::arp_buf, ARP_BUF_SIZE, ARP_MAX_ATTEMPT, DiffusionAgent::arp_table, ARPTable::arplookup(), ARPTable::arprequest(), ArpBufEntry::attempt, HDR_CMN, DiffusionAgent::MACsend(), hdr_cmn::next_hop(), ArpBufEntry::p, THIS_NODE, and DiffusionAgent::xmitFailed(). Referenced by ArpBufferTimer::expire().
00495 {
00496 int c;
00497 ARPEntry *llinfo;
00498 hdr_cmn* cmh;
00499
00500 for (c = 0; c < ARP_BUF_SIZE; c++) {
00501 if (arp_buf[c].p == NULL)
00502 continue;
00503
00504 cmh = HDR_CMN(arp_buf[c].p);
00505 llinfo= arp_table->arplookup(cmh->next_hop());
00506 if (llinfo != 0) {
00507 MACsend(arp_buf[c].p, 0);
00508 arp_buf[c].p = NULL;
00509 continue;}
00510
00511 if (arp_buf[c].attempt > ARP_MAX_ATTEMPT) {
00512 // printf("ARP fails. Too many attempts.\n");
00513 xmitFailed(arp_buf[c].p);
00514 arp_buf[c].p = NULL;
00515 continue;
00516 }
00517
00518 arp_table->arprequest(THIS_NODE, cmh->next_hop(), (LL *)ll);
00519 arp_buf[c].attempt ++;
00520 }
00521 }
|
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 726 of file diff_prob.cc. References Diff_Routing_Entry::active, Out_List::gradient, OUT_NEXT, pow(), From_List::rank, and DiffusionAgent::routing_table. Referenced by CreateIOList(), and UpdateIOList().
00727 {
00728 Out_List *cur_out;
00729
00730 for (cur_out = routing_table[dtype].active; cur_out != NULL;
00731 cur_out = OUT_NEXT(cur_out) ) {
00732 cur_out->gradient = pow(2, routing_table[dtype].num_active -
00733 cur_out->rank) /
00734 ( pow(2, routing_table[dtype].num_active) - 1);
00735 }
00736 }
|
Here is the call graph for this function:

|
|
Definition at line 625 of file diffusion.cc. References DiffusionAgent::arp_buf, ARP_BUF_SIZE, ArpBufEntry::attempt, Packet::free(), ArpBufEntry::p, and ArpBufEntry::t. Referenced by DiffusionAgent::reset().
00626 {
00627 for (int i=0; i<ARP_BUF_SIZE; i++) {
00628 arp_buf[i].t = 0;
00629 arp_buf[i].attempt = 0;
00630 if (arp_buf[i].p != NULL)
00631 Packet::free(arp_buf[i].p);
00632 arp_buf[i].p = NULL;
00633 }
00634 }
|
Here is the call graph for this function:

|
|
Definition at line 636 of file diffusion.cc. References Packet::free(), SendBufferEntry::p, DiffusionAgent::send_buf, SEND_BUF_SIZE, and SendBufferEntry::t. Referenced by DiffusionAgent::reset().
00637 {
00638 for (int i=0; i<SEND_BUF_SIZE; i++) {
00639 send_buf[i].t = 0;
00640 if (send_buf[i].p != NULL)
00641 Packet::free(send_buf[i].p);
00642 send_buf[i].p = NULL;
00643 }
00644 }
|
Here is the call graph for this function:

|
|
Reimplemented in FullTcpAgent. Definition at line 377 of file agent.cc. Referenced by Agent::command().
00378 {
00379 }
|
|
||||||||||||
|
Reimplemented from Agent. Reimplemented in DiffusionRate. Definition at line 235 of file diffusion.cc. References DiffusionAgent::arp_table, Agent::command(), DiffusionAgent::NEG_REINF_, DiffusionAgent::node, DiffusionAgent::port_dmux, DiffusionAgent::POS_REINF_, DiffusionAgent::reset(), DiffusionAgent::Start(), DiffusionAgent::StopSource(), DiffusionAgent::Terminate(), THIS_NODE, and DiffusionAgent::tracetarget. Referenced by DiffusionRate::command().
00236 {
00237 Tcl& tcl = Tcl::instance();
00238
00239 if (argc == 2) {
00240
00241 if (strcasecmp(argv[1], "reset-state")==0) {
00242
00243 reset();
00244 return TCL_OK;
00245 }
00246
00247 if (strcasecmp(argv[1], "reset")==0) {
00248
00249 return Agent::command(argc, argv);
00250 }
00251
00252 if (strcasecmp(argv[1], "start")==0) {
00253 Start();
00254 return TCL_OK;
00255 }
00256
00257 if (strcasecmp(argv[1], "stop")==0) {
00258 return TCL_OK;
00259 }
00260
00261 if (strcasecmp(argv[1], "terminate")==0) {
00262 Terminate();
00263 return TCL_OK;
00264 }
00265
00266 if (strcasecmp(argv[1], "stop-source")==0) {
00267 StopSource();
00268 return TCL_OK;
00269 }
00270
00271 if (strcasecmp(argv[1], "enable-pos") == 0) {
00272 POS_REINF_ = true;
00273 return TCL_OK;
00274 }
00275
00276 if (strcasecmp(argv[1], "enable-neg") == 0) {
00277 NEG_REINF_ = true;
00278 return TCL_OK;
00279 }
00280
00281
00282 if (strcasecmp(argv[1], "disable-pos") == 0) {
00283 POS_REINF_ = false;
00284 return TCL_OK;
00285 }
00286
00287 if (strcasecmp(argv[1], "disable-neg") == 0) {
00288 NEG_REINF_ = false;
00289 return TCL_OK;
00290 }
00291
00292 } else if (argc == 3) {
00293
00294 if (strcasecmp(argv[1], "on-node")==0) {
00295 node = (Node *)tcl.lookup(argv[2]);
00296 return TCL_OK;
00297 }
00298
00299
00300 if (strcasecmp(argv[1], "add-ll") == 0) {
00301
00302 TclObject *obj;
00303
00304 if ( (obj = TclObject::lookup(argv[2])) == 0) {
00305 fprintf(stderr, "Diffusion Node: %d lookup of %s failed\n", THIS_NODE,
00306 argv[2]);
00307 return TCL_ERROR;
00308 }
00309 ll = (NsObject *) obj;
00310
00311 // What a hack !!!
00312 arp_table = ((LL *)ll)->arp_table();
00313 if (arp_table == NULL)
00314 return TCL_ERROR;
00315
00316 return TCL_OK;
00317 }
00318
00319 if (strcasecmp (argv[1], "tracetarget") == 0) {
00320 TclObject *obj;
00321 if ((obj = TclObject::lookup (argv[2])) == 0) {
00322 fprintf (stderr, "%s: %s lookup of %s failed\n", __FILE__, argv[1],
00323 argv[2]);
00324 return TCL_ERROR;
00325 }
00326
00327 tracetarget = (Trace *) obj;
00328 return TCL_OK;
00329 }
00330
00331 if (strcasecmp(argv[1], "port-dmux") == 0) {
00332
00333 TclObject *obj;
00334
00335 if ( (obj = TclObject::lookup(argv[2])) == 0) {
00336 fprintf(stderr, "Diffusion Node: %d lookup of %s failed\n", THIS_NODE,
00337 argv[2]);
00338 return TCL_ERROR;
00339 }
00340 port_dmux = (NsObject *) obj;
00341 return TCL_OK;
00342 }
00343
00344
00345 }
00346
00347 return Agent::command(argc, argv);
00348 }
|
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 }
|
|
|
Reimplemented from DiffusionAgent. Definition at line 192 of file diff_prob.cc. References Diff_Routing_Entry::active, God::AddSink(), AGENT_NEXT, AGT_ADDR, BACKTRACK_, CAL_RANGE, Diff_Routing_Entry::counter, CreateIOList(), PrvCurPtr::cur, DATA, DATA_READY, DATA_REQUEST, data_request_all(), DATA_STOP, hdr_cdiff::data_type, DiffusionAgent::DataForSink(), DecGradient(), hdr_cdiff::forward_agent_id, ForwardData(), ForwardTxFailed(), Packet::free(), Pkt_Hash_Entry::from_agent, FwdPosReinf(), GenPosReinf(), Pkt_Hash_Table::GetHash(), HDR_CDIFF, IncGradient(), Diff_Routing_Entry::IncRecvCnt(), INHIBIT, God::instance(), INTEREST, INTEREST_DELAY, InterestTimer, INTF_FIND, INTF_INSERT, INTF_REMOVE, is_low_power, IS_SINK, From_List::is_sink, MAX_DATA_TYPE, MAX_REINFORCE_COUNTER, hdr_cdiff::mess_type, DiffusionAgent::NEG_REINF_, NEG_REINFORCE, Agent_List::next, NORMALIZE, nsaddr_t, Diff_Routing_Entry::num_active, Pkt_Hash_Entry::num_from, num_neg_bcast_rcv, hdr_cdiff::pk_num, DiffusionAgent::PktTable, DiffusionAgent::POS_REINF_, POS_REINFORCE, PrvCurPtr::prv, From_List::rank, ReTxData(), DiffusionAgent::routing_table, SEND_MESSAGE, hdr_cdiff::sender_id, SendInhibit(), Diff_Routing_Entry::sink, Diff_Routing_Entry::source, THIS_NODE, Pkt_Hash_Entry::timer, TX_FAILED, and Random::uniform(). Referenced by recv().
00193 {
00194 hdr_cdiff* dfh = HDR_CDIFF(pkt);
00195 unsigned char msg_type = dfh->mess_type;
00196 unsigned int dtype = dfh->data_type;
00197
00198 Pkt_Hash_Entry *hashPtr;
00199 From_List *fromPtr;
00200 Agent_List *agentPtr;
00201 Agent_List *cur;
00202 PrvCurPtr RetVal;
00203 nsaddr_t from_nodeID, forward_nodeID;
00204
00205 int i;
00206
00207 switch (msg_type) {
00208 case INTEREST :
00209
00210 hashPtr = PktTable.GetHash(dfh->sender_id, dfh->pk_num);
00211
00212 // Check if it comes from sink agent of this node
00213 // If so we have to keep it in sink list
00214
00215 from_nodeID = (dfh->sender_id).addr_;
00216 forward_nodeID = (dfh->forward_agent_id).addr_;
00217
00218
00219 if (THIS_NODE == from_nodeID) {
00220
00221 // It's from a sink on this node.
00222 // Is it already in list ?
00223
00224 RetVal = INTF_FIND(routing_table[dtype].sink, dfh->sender_id);
00225
00226 if (RetVal.cur == NULL) {
00227 // No, it's not.
00228 agentPtr = new Agent_List;
00229 AGT_ADDR(agentPtr) = dfh->sender_id;
00230 INTF_INSERT(routing_table[dtype].sink, agentPtr);
00231
00232 God::instance()->AddSink(dtype, THIS_NODE);
00233 }
00234
00235 }
00236 else {
00237
00238 // It's not from a sink on this node.
00239
00240 fromPtr = new From_List;
00241 hashPtr->from_agent = fromPtr;
00242 hashPtr->num_from = 1;
00243 AGT_ADDR(fromPtr) = dfh->forward_agent_id;
00244 fromPtr->rank = 1;
00245 fromPtr->next = NULL;
00246
00247 // Is the forwarder node is a sink node ?
00248 // This information is useful when we do negative reinforcement.
00249
00250 if ( from_nodeID == forward_nodeID )
00251 fromPtr->is_sink = true;
00252
00253 }
00254
00255
00256 // Do we have to request data ?
00257
00258 if (routing_table[dtype].source == NULL) {
00259
00260 // No, we don't. Better forward the interest.
00261
00262 hashPtr->timer = new InterestTimer(this, hashPtr, pkt);
00263 (hashPtr->timer)->sched(INTEREST_DELAY*Random::uniform(1.0));
00264 }
00265 else {
00266
00267 // Since this node has sources,it won't propagate the interest.
00268 // We need to create Out_List and In_List in routing table [dtype] now.
00269
00270 CreateIOList(hashPtr, dtype);
00271 data_request_all(dtype);
00272
00273 Packet::free(pkt);
00274 }
00275 break;
00276
00277
00278 case POS_REINFORCE :
00279
00280 if ( POS_REINF_ == false ) {
00281 printf("Hey, we are not in pos_reinf mode.\n");
00282 Packet::free(pkt);
00283 exit(-1);
00284 }
00285
00286 IncGradient(dtype, dfh->forward_agent_id);
00287 CAL_RANGE(routing_table[dtype].active);
00288
00289 if (routing_table[dtype].source == NULL) {
00290 if (is_low_power == false) {
00291 FwdPosReinf(dtype, pkt);
00292 return;
00293 }
00294 }
00295
00296 Packet::free(pkt);
00297 break;
00298
00299
00300 case NEG_REINFORCE :
00301
00302 if (NEG_REINF_ == false) {
00303 printf("Hey, we are not in neg_reinf mode.\n");
00304 Packet::free(pkt);
00305 exit(-1);
00306 }
00307
00308 // Negative Reinforcement won't be forwarded.
00309
00310 num_neg_bcast_rcv++;
00311
00312 for (i=0; i<MAX_DATA_TYPE; i++) {
00313 RetVal = INTF_FIND(routing_table[i].active, dfh->sender_id);
00314 if (RetVal.cur == NULL ) {
00315 continue;
00316 }
00317
00318 // If it is not a sink, we decrease the gradient.
00319
00320 if ( IS_SINK(RetVal.cur) == false) {
00321 DecGradient(i, dfh->sender_id);
00322 CAL_RANGE(routing_table[i].active);
00323 }
00324 }
00325
00326 Packet::free(pkt);
00327 break;
00328
00329
00330 case DATA_READY :
00331
00332 // put source_agent in source list of routing table
00333
00334 agentPtr = new Agent_List;
00335 AGT_ADDR(agentPtr) = dfh->sender_id;
00336 agentPtr->next = routing_table[dtype].source;
00337 routing_table[dtype].source = agentPtr;
00338
00339 if (routing_table[dtype].active != NULL ||
00340 routing_table[dtype].sink != NULL) {
00341 SEND_MESSAGE(dtype, dfh->sender_id, DATA_REQUEST);
00342 }
00343
00344 Packet::free(pkt);
00345 break;
00346
00347
00348 case DATA :
00349
00350 DataForSink(pkt);
00351
00352 routing_table[dtype].IncRecvCnt(dfh->forward_agent_id);
00353 ForwardData(pkt);
00354
00355 if (routing_table[dtype].counter >= MAX_REINFORCE_COUNTER) {
00356 if (is_low_power == false) {
00357 if (POS_REINF_ == true)
00358 GenPosReinf(dtype);
00359 return;
00360 }
00361 if (routing_table[dtype].sink != NULL) {
00362 if (POS_REINF_ == true)
00363 GenPosReinf(dtype);
00364 return;
00365 }
00366 }
00367 break;
00368
00369
00370 case INHIBIT :
00371
00372 if (routing_table[dtype].active == NULL) {
00373 Packet::free(pkt);
00374 return;
00375 }
00376
00377 RetVal=INTF_FIND(routing_table[dtype].active, dfh->sender_id);
00378 if (RetVal.cur == NULL){
00379 Packet::free(pkt);
00380 return;
00381 }
00382
00383 INTF_REMOVE(RetVal.prv, RetVal.cur);
00384 INTF_INSERT(routing_table[dtype].inactive, RetVal.cur);
00385 routing_table[dtype].num_active --;
00386 NORMALIZE(routing_table[dtype].active);
00387 CAL_RANGE(routing_table[dtype].active);
00388
00389 if (routing_table[dtype].num_active < 1) {
00390
00391 // *** You need to stop the source if you have one. *****
00392
00393 if (routing_table[dtype].source != NULL ) {
00394 for (cur=routing_table[dtype].source; cur != NULL;
00395 cur=AGENT_NEXT(cur)) {
00396 SEND_MESSAGE(dtype, AGT_ADDR(cur), DATA_STOP);
00397 }
00398 Packet::free(pkt);
00399 return;
00400 }
00401
00402 // If not, send inhibit signal upstream
00403
00404 SendInhibit(dtype);
00405 }
00406
00407 Packet::free(pkt);
00408 return;
00409
00410
00411 case TX_FAILED :
00412
00413 if (BACKTRACK_ == false) {
00414 printf("We are not in backtracking mode.\n");
00415 Packet::free(pkt);
00416 exit(-1);
00417 }
00418
00419 if (routing_table[dtype].active == NULL) {
00420 ForwardTxFailed(pkt);
00421 return;
00422 }
00423
00424 // RetVal=INTF_FIND(routing_table[dtype].active, dfh->sender_id);
00425
00426 RetVal=INTF_FIND(routing_table[dtype].active, dfh->forward_agent_id);
00427
00428 if (RetVal.cur != NULL){
00429 INTF_REMOVE(RetVal.prv, RetVal.cur);
00430 INTF_INSERT(routing_table[dtype].inactive, RetVal.cur);
00431 routing_table[dtype].num_active --;
00432 NORMALIZE(routing_table[dtype].active);
00433 CAL_RANGE(routing_table[dtype].active);
00434 }
00435
00436 if (routing_table[dtype].num_active < 1) {
00437 ForwardTxFailed(pkt);
00438 return;
00439 }
00440
00441 ReTxData(pkt);
00442
00443 Packet::free(pkt);
00444 return;
00445
00446
00447 default :
00448
00449 Packet::free(pkt);
00450 break;
00451 }
00452 }
|
Here is the call graph for this function:

|
|
Reimplemented from DiffusionAgent. Definition at line 135 of file diff_prob.cc. References AGT_ADDR, CreateIOList(), hdr_cdiff::data_type, hdr_cdiff::forward_agent_id, Packet::free(), Pkt_Hash_Entry::from_agent, Pkt_Hash_Table::GetHash(), Pkt_Hash_Entry::has_list, HDR_CDIFF, INTEREST, Pkt_Hash_Entry::is_forwarded, From_List::is_sink, hdr_cdiff::mess_type, Agent_List::next, nsaddr_t, Pkt_Hash_Entry::num_from, hdr_cdiff::pk_num, DiffusionAgent::PktTable, From_List::rank, hdr_cdiff::sender_id, Pkt_Hash_Entry::timer, and UpdateIOList(). Referenced by recv().
00136 {
00137 hdr_cdiff* dfh = HDR_CDIFF(pkt);
00138 unsigned char msg_type = dfh->mess_type;
00139 unsigned int dtype = dfh->data_type;
00140
00141 Pkt_Hash_Entry *hashPtr;
00142 From_List *fromPtr;
00143 nsaddr_t from_nodeID, forward_nodeID;
00144
00145 switch (msg_type) {
00146 case INTEREST :
00147
00148 hashPtr = PktTable.GetHash(dfh->sender_id, dfh->pk_num);
00149
00150 if (hashPtr->is_forwarded == true) {
00151 Packet::free(pkt);
00152 return;
00153 }
00154
00155 from_nodeID = (dfh->sender_id).addr_;
00156 forward_nodeID = (dfh->forward_agent_id).addr_;
00157
00158
00159 hashPtr->num_from++;
00160 fromPtr = new From_List;
00161 AGT_ADDR(fromPtr) = dfh->forward_agent_id;
00162 fromPtr->rank = hashPtr->num_from;
00163
00164 if (from_nodeID == forward_nodeID)
00165 fromPtr->is_sink = true;
00166
00167 fromPtr->next = hashPtr->from_agent;
00168 hashPtr->from_agent = fromPtr;
00169
00170 // Check if this hashPtr has timer, and if lists already exist,
00171 // to decide whether to create or update Out_List and In_List
00172
00173 if (hashPtr->timer == NULL) {
00174 if (hashPtr->has_list==false) {
00175 CreateIOList(hashPtr, dtype);
00176 }
00177 else {
00178 UpdateIOList(fromPtr, dtype);
00179 }
00180 }
00181
00182 Packet::free(pkt);
00183 break;
00184
00185 default :
00186 Packet::free(pkt);
00187 break;
00188 }
00189 }
|
Here is the call graph for this function:

|
|
Definition at line 363 of file diffusion.cc. References Agent::allocpkt(), HDR_CDIFF, HDR_CMN, NOW, hdr_cmn::size(), and hdr_cdiff::ts_. Referenced by DiffusionAgent::prepare_message().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 636 of file diff_prob.cc. References add_outlist(), CAL_RANGE, CalGradient(), Diff_Routing_Entry::counter, Pkt_Hash_Entry::from_agent, FROM_NEXT, Pkt_Hash_Entry::has_list, INTF_FREEALL, Diff_Routing_Entry::num_active, and DiffusionAgent::routing_table. Referenced by consider_new(), consider_old(), and InterestPropagate().
00638 {
00639 From_List *fromPtr;
00640
00641 // Better clear out all existing IO lists first.
00642
00643 INTF_FREEALL(routing_table[dtype].active);
00644 INTF_FREEALL(routing_table[dtype].inactive);
00645 INTF_FREEALL(routing_table[dtype].iif);
00646 INTF_FREEALL(routing_table[dtype].down_iif);
00647 routing_table[dtype].num_active=0;
00648 routing_table[dtype].counter=0;
00649
00650 for (fromPtr = hashPtr->from_agent; fromPtr != NULL;
00651 fromPtr = FROM_NEXT(fromPtr) ) {
00652 add_outlist(dtype, fromPtr);
00653 }
00654
00655 hashPtr->has_list = true;
00656
00657 CalGradient(dtype);
00658 CAL_RANGE(routing_table[dtype].active);
00659 }
|
Here is the call graph for this function:

|
|
|
Definition at line 625 of file diff_prob.cc. References AGENT_NEXT, AGT_ADDR, DATA_REQUEST, DiffusionAgent::routing_table, SEND_MESSAGE, and Diff_Routing_Entry::source. Referenced by consider_new(), and InterestPropagate().
00626 {
00627 Agent_List *cur_agent;
00628
00629 for (cur_agent=routing_table[dtype].source; cur_agent != NULL;
00630 cur_agent = AGENT_NEXT(cur_agent) ) {
00631 SEND_MESSAGE(dtype, AGT_ADDR(cur_agent), DATA_REQUEST);
00632 }
00633 }
|
|
|
Definition at line 98 of file diffusion.cc. References AGENT_NEXT, AGT_ADDR, Packet::copy(), hdr_cdiff::data_type, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_IP, Agent::here_, hdr_cdiff::next_nodes, NODE_ADDR, hdr_cdiff::num_next, DiffusionAgent::routing_table, and DiffusionAgent::send_to_dmux(). Referenced by DiffusionRate::consider_new(), and consider_new().
00099 {
00100 hdr_cdiff *dfh = HDR_CDIFF(pkt);
00101 unsigned int dtype = dfh->data_type;
00102 Agent_List *cur_agent;
00103 Packet *cur_pkt;
00104 hdr_cdiff *cur_dfh;
00105 hdr_ip *cur_iph;
00106
00107
00108 // Give it to sink agents on this node. Don't care if wireless.
00109
00110 for (cur_agent= (routing_table[dtype]).sink; cur_agent != NULL;
00111 cur_agent= AGENT_NEXT(cur_agent) ) {
00112
00113 cur_pkt = pkt->copy();
00114 cur_iph = HDR_IP(cur_pkt);
00115 cur_iph->dst_ = AGT_ADDR(cur_agent);
00116
00117 cur_dfh = HDR_CDIFF(cur_pkt);
00118 cur_dfh->forward_agent_id = here_;
00119 cur_dfh->num_next = 1;
00120 cur_dfh->next_nodes[0] = NODE_ADDR(cur_agent);
00121
00122 send_to_dmux(cur_pkt, 0);
00123 }
00124 }
|
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 }
|
|
||||||||||||
|
Definition at line 756 of file diff_prob.cc. References Diff_Routing_Entry::active, PrvCurPtr::cur, GRADIENT, INTF_FIND, NORMALIZE, OUT_NEXT, and DiffusionAgent::routing_table. Referenced by consider_new().
00757 {
00758 Out_List *cur_out;
00759 PrvCurPtr RetVal;
00760
00761 RetVal=INTF_FIND(routing_table[dtype].active, addr);
00762
00763 if (RetVal.cur != NULL) {
00764
00765 for (cur_out = routing_table[dtype].active; cur_out != NULL;
00766 cur_out = OUT_NEXT(cur_out) )
00767 GRADIENT(cur_out) = GRADIENT(cur_out) + 1.0;
00768
00769 cur_out = (Out_List *)(RetVal.cur);
00770 GRADIENT(cur_out) = GRADIENT(cur_out) - 1.99;
00771 if (GRADIENT(cur_out)< 0.0) {
00772 GRADIENT(cur_out) = 0.0;
00773 }
00774 NORMALIZE(routing_table[dtype].active);
00775 }
00776 }
|
|
||||||||||||||||
|
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 476 of file diff_prob.cc. References AGENT_NEXT, AGT_ADDR, BACKTRACK_, DATA_STOP, hdr_cdiff::data_type, hdr_ip::dst_, hdr_cdiff::forward_agent_id, Packet::free(), HDR_CDIFF, HDR_CMN, HDR_IP, Agent::here_, hdr_cdiff::info, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::next_nodes, NODE_ADDR, NS_AF_INET, Out_List::num_data_send, hdr_cdiff::num_next, hdr_cdiff::pk_num, DiffusionAgent::prepare_message(), DiffusionAgent::routing_table, SEND_MESSAGE, extra_info::sender, hdr_cdiff::sender_id, extra_info::seq, Diff_Routing_Entry::sink, extra_info::size, hdr_cmn::size_, Diff_Routing_Entry::source, THIS_NODE, TX_FAILED, and WHERE_TO_GO. Referenced by consider_new().
00477 {
00478 hdr_cdiff *dfh = HDR_CDIFF(pkt);
00479 unsigned int dtype =dfh->data_type;
00480 Out_List *cur_out;
00481 Packet *cur_pkt;
00482 hdr_cdiff *cur_dfh;
00483 hdr_ip *cur_iph;
00484
00485 cur_out = WHERE_TO_GO(routing_table[dtype].active);
00486
00487 if (cur_out !=NULL) {
00488
00489 // Got somewhere to go.
00490
00491 cur_pkt = pkt;
00492 cur_iph = HDR_IP(cur_pkt);
00493
00494 cur_iph->dst_ = AGT_ADDR(cur_out);
00495
00496 cur_dfh = HDR_CDIFF(cur_pkt);
00497 cur_dfh->forward_agent_id = here_;
00498 cur_dfh->num_next = 1;
00499 cur_dfh->next_nodes[0] = NODE_ADDR(cur_out);
00500
00501 cur_out->num_data_send++;
00502
00503 #ifdef DEBUG_PROB
00504 printf("DF node %x will send data (%x, %x, %d) to %x\n",
00505 THIS_NODE, (cur_dfh->sender_id).addr_,
00506 (cur_dfh->sender_id).port_, cur_dfh->pk_num,
00507 AGT_ADDR(cur_out));
00508 #endif
00509
00510 MACprepare(cur_pkt, NODE_ADDR(cur_out), NS_AF_INET, 1);
00511 MACsend(cur_pkt, 0);
00512
00513 return;
00514 }
00515
00516 if (routing_table[dtype].sink != NULL) {
00517
00518 // No where to go but have sinks.
00519
00520 Packet::free(pkt);
00521 return;
00522 }
00523
00524 // No where to go and no sink.
00525 // Check if we have sources on this node.
00526 // If so, we stop the sources. Otherwise, we generate the transmission
00527 // failure packet.
00528
00529 Agent_List *cur;
00530
00531 if (routing_table[dtype].source != NULL ) {
00532 for (cur=routing_table[dtype].source; cur != NULL; cur=AGENT_NEXT(cur)) {
00533
00534 // DATA_STOP never go out of the node, so don't care if wireless.
00535
00536 SEND_MESSAGE(dtype, AGT_ADDR(cur), DATA_STOP);
00537 }
00538 Packet::free(pkt);
00539 return;
00540 }
00541
00542 // No source, generate the transmission failure packet.
00543
00544 if (BACKTRACK_ == false) {
00545 Packet::free(pkt);
00546 return;
00547 }
00548
00549 // YES, we are in backtracking mode so send TX_FAILED to the forwarder.
00550
00551 cur_pkt = prepare_message(dtype, dfh->forward_agent_id, TX_FAILED);
00552 cur_dfh = HDR_CDIFF(cur_pkt);
00553 cur_dfh->info.sender = dfh->sender_id;
00554 cur_dfh->info.seq = dfh->pk_num;
00555
00556 hdr_cmn *cmh = HDR_CMN(pkt);
00557 cur_dfh->info.size = cmh->size_;
00558
00559 MACprepare(cur_pkt, (dfh->forward_agent_id).addr_, NS_AF_INET, 0);
00560 MACsend(cur_pkt, 0);
00561
00562 Packet::free(pkt);
00563 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

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

|
|
Definition at line 780 of file diff_prob.cc. References AGT_ADDR, Diff_Routing_Entry::counter, FIND_MAX_IN, Diff_Routing_Entry::iif, IN_NEXT, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), NODE_ADDR, NS_AF_INET, DiffusionAgent::overhead, POS_REINFORCE, DiffusionAgent::prepare_message(), In_List::prev_received, DiffusionAgent::routing_table, and In_List::total_received. Referenced by consider_new().
00781 {
00782 In_List *cur_in, *max_in;
00783 Packet *pkt;
00784
00785 max_in = FIND_MAX_IN(routing_table[dtype].iif);
00786
00787 if (max_in != NULL) {
00788 if ( (max_in->total_received - max_in->prev_received) <
00789 routing_table[dtype].counter) {
00790
00791 pkt=prepare_message(dtype, AGT_ADDR(max_in), POS_REINFORCE);
00792
00793 MACprepare(pkt, NODE_ADDR(max_in), NS_AF_INET, 0);
00794 MACsend(pkt, 0);
00795
00796 overhead++;
00797
00798 }
00799 }
00800
00801 routing_table[dtype].counter = 0;
00802 for (cur_in = routing_table[dtype].iif; cur_in != NULL;
00803 cur_in = IN_NEXT(cur_in) ) {
00804 cur_in->prev_received = cur_in->total_received;
00805 }
00806
00807 }
|
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_; }
|
|
|
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 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 740 of file diff_prob.cc. References PrvCurPtr::cur, GRADIENT, INTF_FIND, NORMALIZE, and DiffusionAgent::routing_table. Referenced by consider_new().
00741 {
00742 Out_List *cur_out;
00743 PrvCurPtr RetVal;
00744
00745 RetVal=INTF_FIND(routing_table[dtype].active, addr);
00746
00747 if (RetVal.cur != NULL) {
00748 cur_out = (Out_List *)(RetVal.cur);
00749 GRADIENT(cur_out) = GRADIENT(cur_out) + 0.99;
00750 NORMALIZE(routing_table[dtype].active);
00751 }
00752
00753 }
|
|
|
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 455 of file diff_prob.cc. References CreateIOList(), data_request_all(), hdr_cdiff::data_type, Packet::free(), HDR_CDIFF, Pkt_Hash_Entry::is_forwarded, MAC_BROADCAST, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), NS_AF_ILINK, DiffusionAgent::overhead, DiffusionAgent::routing_table, and Diff_Routing_Entry::source. Referenced by InterestTimer::expire().
00457 {
00458 hdr_cdiff *dfh = HDR_CDIFF(pkt);
00459 unsigned int dtype=dfh->data_type;
00460
00461 CreateIOList(hashPtr, dtype);
00462
00463 if ( routing_table[dtype].source != NULL ) {
00464 data_request_all(dtype);
00465 Packet::free(pkt);
00466 return;
00467 }
00468
00469 MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00470 MACsend(pkt, 0);
00471 overhead++;
00472 hashPtr->is_forwarded = true;
00473 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 851 of file diff_prob.cc. References AGENT_NEXT, AGT_ADDR, CAL_RANGE, PrvCurPtr::cur, DATA_STOP, INTF_FIND, INTF_INSERT, INTF_REMOVE, NORMALIZE, Diff_Routing_Entry::num_active, PrvCurPtr::prv, DiffusionAgent::routing_table, SEND_MESSAGE, SendInhibit(), and Diff_Routing_Entry::source.
00852 {
00853 PrvCurPtr RetVal;
00854
00855 RetVal = INTF_FIND(routing_table[dtype].iif, DownDiff);
00856
00857 if (RetVal.cur != NULL) {
00858 INTF_REMOVE(RetVal.prv, RetVal.cur);
00859 INTF_INSERT(routing_table[dtype].down_iif, RetVal.cur);
00860 return;
00861 }
00862
00863 RetVal = INTF_FIND(routing_table[dtype].active, DownDiff);
00864 if (RetVal.cur == NULL)
00865 return;
00866
00867 INTF_REMOVE(RetVal.prv, RetVal.cur);
00868 INTF_INSERT(routing_table[dtype].inactive, RetVal.cur);
00869 routing_table[dtype].num_active --;
00870 NORMALIZE(routing_table[dtype].active);
00871 CAL_RANGE(routing_table[dtype].active);
00872
00873 if (routing_table[dtype].num_active < 1) {
00874
00875 // ** If we have a source, stop the source.
00876 // If not, send inhibit signal upstream. **
00877
00878 Agent_List *cur;
00879
00880 if (routing_table[dtype].source != NULL ) {
00881 for (cur=routing_table[dtype].source; cur != NULL; cur=AGENT_NEXT(cur)) {
00882 SEND_MESSAGE(dtype, AGT_ADDR(cur), DATA_STOP);
00883 }
00884 }
00885 else {
00886 SendInhibit(dtype);
00887 }
00888 }
00889 }
|
Here is the call graph for this function:

|
|
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 }
|
|
||||||||||||||||||||
Here is the call graph for this function:

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

|
|
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().
|
|
||||||||||||||||
Here is the call graph for this function:

|
|
Reimplemented from DiffusionAgent. Definition at line 684 of file diff_prob.cc. References Diff_Routing_Entry::active, Out_List::gradient, GRADIENT, IN_NEXT, NODE_ADDR, Out_List::num_data_send, NUM_DATA_SEND, num_neg_bcast_rcv, num_neg_bcast_send, NUM_NEG_RECV, NUM_POS_RECV, OUT_NEXT, DiffusionAgent::routing_table, THIS_NODE, and In_List::total_received.
00685 {
00686 Out_List *cur_out;
00687 In_List *cur_in;
00688 int i;
00689
00690 for (i=0; i<1; i++) {
00691 printf("Node %d neg bcast send %d, neg bcast rcv %d\n",
00692 THIS_NODE, num_neg_bcast_send, num_neg_bcast_rcv);
00693 for (cur_out = routing_table[i].active; cur_out != NULL;
00694 cur_out = OUT_NEXT(cur_out) ) {
00695 printf("DF node %d has oif %d (%f,%d) send data %d recv neg %d pos %d\n",
00696 THIS_NODE, NODE_ADDR(cur_out), GRADIENT(cur_out),
00697 routing_table[i].num_active, NUM_DATA_SEND(cur_out),
00698 NUM_NEG_RECV(cur_out), NUM_POS_RECV(cur_out));
00699 }
00700
00701 for (cur_in = routing_table[i].iif; cur_in != NULL;
00702 cur_in = IN_NEXT(cur_in) ) {
00703 printf("Diffusion node %d has iif for %d\n",
00704 THIS_NODE, NODE_ADDR(cur_in));
00705 }
00706
00707 for (cur_out = routing_table[i].inactive; cur_out != NULL;
00708 cur_out = OUT_NEXT(cur_out) ) {
00709 printf("Diffusion node %d has down oif %d (%f, %d) send %d\n",
00710 THIS_NODE, NODE_ADDR(cur_out), cur_out->gradient,
00711 routing_table[i].num_active, cur_out->num_data_send);
00712
00713 }
00714
00715 for (cur_in = routing_table[i].down_iif; cur_in != NULL;
00716 cur_in = IN_NEXT(cur_in) ) {
00717 printf("Diffusion node %d has down_iif for %d (recv %d)\n", THIS_NODE,
00718 NODE_ADDR(cur_in), cur_in->total_received);
00719 }
00720
00721 }
00722
00723 }
|
|
||||||||||||
|
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 DiffusionAgent. Definition at line 102 of file diff_prob.cc. References consider_new(), consider_old(), Pkt_Hash_Table::GetHash(), HDR_CDIFF, hdr_cdiff::mess_type, MsgStr, hdr_cdiff::pk_num, DiffusionAgent::PktTable, Pkt_Hash_Table::put_in_hash(), hdr_cdiff::sender_id, and THIS_NODE.
00103 {
00104 hdr_cdiff* dfh = HDR_CDIFF(packet);
00105
00106 // Packet Hash Table is used to keep info about experienced pkts.
00107
00108 Pkt_Hash_Entry *hashPtr= PktTable.GetHash(dfh->sender_id, dfh->pk_num);
00109
00110
00111 #ifdef DEBUG_PROB
00112 printf("DF node %x recv %s (%x, %x, %d)\n",
00113 THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00114 (dfh->sender_id).port_, dfh->pk_num);
00115 #endif
00116
00117
00118 // Received this packet before ?
00119
00120 if (hashPtr != NULL) {
00121 consider_old(packet);
00122 return;
00123 }
00124
00125 // Never receive it before ? Put in hash table.
00126
00127 PktTable.put_in_hash(dfh);
00128
00129 // Take action for a new pkt.
00130
00131 consider_new(packet);
00132 }
|
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 {};
|
|
|
Reimplemented from NsObject. Reimplemented in DiffusionRate. Definition at line 613 of file diffusion.cc. References DiffusionAgent::clear_arp_buf(), DiffusionAgent::clear_send_buf(), MAX_DATA_TYPE, DiffusionAgent::PktTable, Diff_Routing_Entry::reset(), Pkt_Hash_Table::reset(), and DiffusionAgent::routing_table. Referenced by DiffusionAgent::command(), and DiffusionRate::reset().
00614 {
00615 PktTable.reset();
00616
00617 for (int i=0; i<MAX_DATA_TYPE; i++) {
00618 routing_table[i].reset();
00619 }
00620 clear_arp_buf();
00621 clear_send_buf();
00622 }
|
Here is the call graph for this function:

|
|
Definition at line 591 of file diff_prob.cc. References AGT_ADDR, DATA, hdr_cdiff::data_type, Pkt_Hash_Table::GetHash(), HDR_CDIFF, HDR_CMN, hdr_cdiff::info, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), NODE_ADDR, NS_AF_INET, hdr_cdiff::pk_num, DiffusionAgent::PktTable, DiffusionAgent::prepare_message(), DiffusionAgent::routing_table, extra_info::sender, hdr_cdiff::sender_id, extra_info::seq, extra_info::size, hdr_cmn::size_, and WHERE_TO_GO. Referenced by consider_new().
00592 {
00593 hdr_cdiff *dfh = HDR_CDIFF(pkt);
00594 Pkt_Hash_Entry *hashPtr=PktTable.GetHash(dfh->info.sender, dfh->info.seq);
00595
00596 // Make sure it has data on its cache.
00597
00598 if (hashPtr == NULL) {
00599 printf("No hash for (%x, %x, %d)\n", (dfh->info.sender).addr_,
00600 (dfh->info.sender).port_, dfh->info.seq);
00601 return;
00602 }
00603
00604 int dtype = dfh->data_type;
00605 Out_List *to_out = WHERE_TO_GO(routing_table[dtype].active);
00606
00607 if (to_out == NULL) return;
00608
00609 Packet *rtxPkt = prepare_message(dtype, AGT_ADDR(to_out), DATA);
00610 hdr_cdiff *rtx_dfh = HDR_CDIFF(rtxPkt);
00611 hdr_cmn *rtx_cmh = HDR_CMN(rtxPkt);
00612
00613 rtx_dfh->sender_id = dfh->info.sender;
00614 rtx_dfh->pk_num = dfh->info.seq;
00615 rtx_cmh->size_ = dfh->info.size;
00616
00617 MACprepare(rtxPkt, NODE_ADDR(to_out), NS_AF_INET, 1);
00618 MACsend(rtxPkt, 0);
00619
00620 printf("Retransmit (%d,%d,%d)\n",(rtx_dfh->sender_id).addr_,
00621 (rtx_dfh->sender_id).port_, rtx_dfh->pk_num);
00622 }
|
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:

|
||||||||||||
|
Definition at line 154 of file diffusion.h. References DiffusionAgent::port_dmux, and NsObject::recv(). Referenced by DiffusionRate::consider_new(), DiffusionAgent::DataForSink(), and DiffusionRate::DataReqAll().
|
Here is the call graph for this function:

|
|
Definition at line 563 of file diffusion.cc. References Scheduler::clock(), PrvCurPtr::cur, hdr_cdiff::data_type, hdr_ip::dst_, Packet::free(), HDR_CDIFF, HDR_CMN, HDR_IP, Scheduler::instance(), INTF_FIND, DiffusionAgent::MACsend(), SendBufferEntry::p, DiffusionAgent::routing_table, DiffusionAgent::send_buf, SEND_BUF_SIZE, SEND_TIMEOUT, and SendBufferEntry::t. Referenced by SendBufTimer::expire().
00564 {
00565 int c;
00566 hdr_cdiff *dfh;
00567 hdr_cmn *cmh;
00568 hdr_ip *iph;
00569 int dtype;
00570 PrvCurPtr RetVal;
00571
00572 for (c = 0; c < SEND_BUF_SIZE; c++) {
00573 if (send_buf[c].p == NULL)
00574 continue;
00575
00576 dfh = HDR_CDIFF(send_buf[c].p);
00577 cmh = HDR_CMN(send_buf[c].p);
00578 iph = HDR_IP(send_buf[c].p);
00579 dtype = dfh->data_type;
00580
00581 RetVal = INTF_FIND(routing_table[dtype].active, iph->dst_);
00582
00583 if (RetVal.cur != NULL) {
00584 MACsend(send_buf[c].p, 0);
00585 send_buf[c].p = NULL;
00586 continue;
00587 }
00588
00589 if (Scheduler::instance().clock() - send_buf[c].t > SEND_TIMEOUT) {
00590 Packet::free(send_buf[c].p);
00591 send_buf[c].p = NULL;
00592 continue;
00593 }
00594
00595 }
00596 }
|
Here is the call graph for this function:

|
|
Definition at line 892 of file diff_prob.cc. References ns_addr_t::addr_, INHIBIT, MAC_BROADCAST, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), NS_AF_ILINK, DiffusionAgent::overhead, ns_addr_t::port_, DiffusionAgent::prepare_message(), and ROUTING_PORT. Referenced by consider_new(), and InterfaceDown().
00893 {
00894 // Wireless. Just use one MAC broadcast.
00895
00896 ns_addr_t bcast_addr;
00897 bcast_addr.addr_ = MAC_BROADCAST;
00898 bcast_addr.port_ = ROUTING_PORT;
00899
00900 Packet *pkt = prepare_message(dtype, bcast_addr, INHIBIT);
00901 MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00902 MACsend(pkt, 0);
00903 overhead++;
00904 return;
00905 }
|
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 911 of file diff_prob.cc. References ns_addr_t::addr_, MAC_BROADCAST, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), NEG_REINFORCE, NS_AF_ILINK, DiffusionAgent::overhead, ns_addr_t::port_, DiffusionAgent::prepare_message(), and ROUTING_PORT. Referenced by EnergyTimer::expire().
00912 {
00913 ns_addr_t bcast_addr;
00914 bcast_addr.addr_ = MAC_BROADCAST;
00915 bcast_addr.port_ = ROUTING_PORT;
00916
00917 Packet *pkt = prepare_message(0, bcast_addr, NEG_REINFORCE);
00918 MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00919 MACsend(pkt, 0);
00920 overhead++;
00921 return;
00922 }
|
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_; }
|
|
|
Reimplemented from DiffusionAgent. Definition at line 842 of file diff_prob.cc. References ENERGY_CHECK, energy_timer, EnergyTimer, DiffusionAgent::node, TimerHandler::resched(), DiffusionAgent::Start(), and Random::uniform().
00843 {
00844 DiffusionAgent::Start();
00845
00846 energy_timer = new EnergyTimer(this, node);
00847 energy_timer->resched(ENERGY_CHECK + ENERGY_CHECK * Random::uniform(1.0));
00848 }
|
Here is the call graph for this function:

|
|
Definition at line 452 of file diffusion.cc. References DiffusionAgent::arp_buf, ARP_BUF_SIZE, DiffusionAgent::arp_table, ARPTable::arplookup(), ArpBufEntry::attempt, HDR_CMN, DiffusionAgent::MACsend(), min, hdr_cmn::next_hop(), NOW, ArpBufEntry::p, ArpBufEntry::t, Time, and DiffusionAgent::xmitFailed().
00453 {
00454 Time min = DBL_MAX;
00455 int min_index = 0;
00456 int c;
00457
00458 for (c=0; c < ARP_BUF_SIZE; c++) {
00459 if (arp_buf[c].p == NULL) {
00460 arp_buf[c].t = NOW;
00461 arp_buf[c].attempt = 1;
00462 arp_buf[c].p = pkt;
00463 return;
00464 }
00465 else if (arp_buf[c].t < min) {
00466 min = arp_buf[c].t;
00467 min_index = c;
00468 }
00469 }
00470
00471 // Before killing somebody, let him get a last chance to send.
00472
00473 ARPEntry *llinfo;
00474 hdr_cmn* cmh = HDR_CMN(arp_buf[min_index].p);
00475
00476 llinfo= arp_table->arplookup(cmh->next_hop());
00477
00478 if (llinfo == 0) {
00479 // printf("ARP fails. And must give up slot.\n");
00480 xmitFailed(arp_buf[min_index].p);
00481 }
00482 else
00483 MACsend(arp_buf[min_index].p, 0);
00484
00485
00486 // The new packet is taking over the slot of the dead guy.
00487
00488 arp_buf[min_index].t = NOW;
00489 arp_buf[min_index].attempt = 1;
00490 arp_buf[min_index].p = pkt;
00491 }
|
Here is the call graph for this function:

|
|
Definition at line 524 of file diffusion.cc. References Scheduler::clock(), PrvCurPtr::cur, hdr_cdiff::data_type, hdr_ip::dst_, Packet::free(), HDR_CDIFF, HDR_IP, Scheduler::instance(), INTF_FIND, DiffusionAgent::MACsend(), min, NOW, SendBufferEntry::p, DiffusionAgent::routing_table, DiffusionAgent::send_buf, SEND_BUF_SIZE, SendBufferEntry::t, and Time.
00525 {
00526 Time min = DBL_MAX;
00527 int min_index = 0;
00528 int c;
00529
00530 for (c = 0 ; c < SEND_BUF_SIZE ; c ++)
00531 if (send_buf[c].p == NULL)
00532 {
00533 send_buf[c].t = NOW;
00534 send_buf[c].p = p;
00535 return;
00536 }
00537 else if (send_buf[c].t < min)
00538 {
00539 min = send_buf[c].t;
00540 min_index = c;
00541 }
00542
00543 // Before killing somebody, you'd better give him the last chance.
00544
00545 hdr_cdiff *dfh = HDR_CDIFF(send_buf[min_index].p);
00546 hdr_ip *iph = HDR_IP(send_buf[min_index].p);
00547 int dtype = dfh->data_type;
00548
00549 PrvCurPtr RetVal = INTF_FIND(routing_table[dtype].active, iph->dst_);
00550
00551 if (RetVal.cur != NULL)
00552 MACsend(send_buf[min_index].p, 0);
00553 else
00554 Packet::free(send_buf[min_index].p);
00555
00556 // A new packet is taking over the slot.
00557
00558 send_buf[min_index].t = Scheduler::instance().clock();
00559 send_buf[min_index].p = p;
00560 }
|
Here is the call graph for this function:

|
|
Definition at line 351 of file diffusion.cc. References AGENT_NEXT, AGT_ADDR, DATA_STOP, MAX_DATA_TYPE, DiffusionAgent::routing_table, SEND_MESSAGE, and Diff_Routing_Entry::source. Referenced by DiffusionAgent::command().
00352 {
00353 Agent_List *cur;
00354
00355 for (int i=0; i<MAX_DATA_TYPE; i++) {
00356 for (cur=routing_table[i].source; cur!=NULL; cur=AGENT_NEXT(cur) ) {
00357 SEND_MESSAGE(i, AGT_ADDR(cur), DATA_STOP);
00358 }
00359 }
00360 }
|
|
|
Definition at line 48 of file connector.h. References Connector::target_. Referenced by JoBS::assignRateDropsADC(), FQ::deque(), QSAgent::recv(), and MIPMHAgent::reg().
00048 { return target_; }
|
|
|
Definition at line 208 of file diffusion.cc. References EnergyModel::energy(), Node::energy_model(), EnergyModel::initialenergy(), DiffusionAgent::node, DiffusionAgent::overhead, DiffusionAgent::Print_IOlist(), and THIS_NODE. Referenced by DiffusionAgent::command().
00209 {
00210 #ifdef DEBUG_OUTPUT
00211 printf("Diffusion node %d : terminates (overhead %d)\n",
00212 THIS_NODE, overhead);
00213 printf("node %d: remaining energy %f, initial energy %f\n", THIS_NODE,
00214 node->energy_model()->energy(),
00215 node->energy_model()->initialenergy() );
00216 Print_IOlist();
00217 #endif
00218 }
|
Here is the call graph for this function:

|
|
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 }
|
|
|
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:

|
||||||||||||
|
Definition at line 599 of file diffusion.cc. References BaseTrace::buffer(), BaseTrace::dump(), Trace::pt_, and DiffusionAgent::tracetarget.
00600 {
00601 va_list ap;
00602
00603 if (!tracetarget)
00604 return;
00605
00606 va_start (ap, fmt);
00607 vsprintf (tracetarget->pt_->buffer (), fmt, ap);
00608 tracetarget->pt_->dump ();
00609 va_end (ap);
00610 }
|
Here is the call graph for this function:

|
|
Reimplemented in TcpAgent. Definition at line 146 of file agent.h.
00146 {}
|
|
||||||||||||
|
Definition at line 662 of file diff_prob.cc. References add_outlist(), CAL_RANGE, CalGradient(), and DiffusionAgent::routing_table. Referenced by consider_old().
00664 {
00665 add_outlist(dtype, fromPtr);
00666 CalGradient(dtype);
00667 CAL_RANGE(routing_table[dtype].active);
00668 }
|
Here is the call graph for this function:

|
|
Reimplemented from DiffusionAgent. |
|
|
Definition at line 186 of file diffusion.h. |
|
|
Definition at line 155 of file diff_prob.h. Referenced by Start(). |
|
|
Definition at line 154 of file diff_prob.h. Referenced by consider_new(). |
|
|
Definition at line 187 of file diffusion.h. |
|
||||||||||||
|
Definition at line 439 of file diffusion.cc. Referenced by DiffusionAgent::MACprepare().
00440 {
00441 DiffusionAgent *agent = (DiffusionAgent *)data; // cast of trust
00442 agent->xmitFailed(pkt);
00443 }
|
|
|
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 148 of file diffusion.h. Referenced by DiffusionAgent::ArpBufferCheck(), DiffusionAgent::clear_arp_buf(), and DiffusionAgent::StickPacketInArpBuffer(). |
|
|
Definition at line 147 of file diffusion.h. Referenced by DiffusionAgent::Start(). |
|
|
Definition at line 145 of file diffusion.h. Referenced by DiffusionAgent::ArpBufferCheck(), DiffusionAgent::command(), and DiffusionAgent::StickPacketInArpBuffer(). |
|
|
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 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(), PushbackAgent::sendMsg(), and Agent::trace(). |
|
|
Definition at line 124 of file diff_prob.h. Referenced by Start(). |
|
|
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 125 of file diff_prob.h. Referenced by consider_new(), DiffusionProb(), and EnergyTimer::expire(). |
|
|
Definition at line 143 of file diffusion.h. |
|
|
Definition at line 134 of file diffusion.h. Referenced by DiffusionRate::CheckNegCounter(), DiffusionAgent::command(), DiffusionRate::consider_new(), consider_new(), DiffusionAgent::DiffusionAgent(), EnergyTimer::expire(), DiffusionRate::FwdData(), DiffusionRate::ProcessNegReinf(), and DiffusionRate::Start(). |
|
|
Definition at line 141 of file diffusion.h. Referenced by DiffusionAgent::command(), DiffusionAgent::DiffusionAgent(), Start(), and DiffusionAgent::Terminate(). |
|
|
Definition at line 122 of file diff_prob.h. Referenced by consider_new(), DiffusionProb(), and Print_IOlist(). |
|
|
Definition at line 121 of file diff_prob.h. Referenced by DiffusionProb(), and Print_IOlist(). |
|
|
Definition at line 132 of file agent.h. Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent(). |
|
|
Definition at line 137 of file diffusion.h. Referenced by DiffusionRate::BcastNeg(), DiffusionAgent::DiffusionAgent(), ForwardTxFailed(), FwdPosReinf(), GenPosReinf(), DiffusionRate::InterestHandle(), InterestPropagate(), DiffusionRate::PosReinf(), SendInhibit(), SendNegReinf(), DiffusionAgent::Terminate(), and DiffusionRate::UcastNeg(). |
|
|
Definition at line 136 of file diffusion.h. Referenced by DiffusionAgent::DiffusionAgent(), and DiffusionAgent::prepare_message(). |
|
|
Definition at line 139 of file diffusion.h. Referenced by consider_new(), consider_old(), ForwardTxFailed(), DiffusionRate::ProcessPosReinf(), DiffusionAgent::recv(), DiffusionRate::recv(), recv(), DiffusionAgent::reset(), and ReTxData(). |
|
|
Definition at line 144 of file diffusion.h. Referenced by DiffusionAgent::command(), and DiffusionAgent::send_to_dmux(). |
|
|
Definition at line 133 of file diffusion.h. Referenced by DiffusionAgent::command(), DiffusionRate::consider_new(), consider_new(), and DiffusionAgent::DiffusionAgent(). |
|
|
Definition at line 119 of file agent.h. Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt(). |
|
|
|
Definition at line 150 of file diffusion.h. Referenced by DiffusionAgent::clear_send_buf(), DiffusionAgent::SendBufferCheck(), and DiffusionAgent::StickPacketInSendBuffer(). |
|
|
Definition at line 149 of file diffusion.h. Referenced by DiffusionAgent::Start(). |
|
|
|
|
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 142 of file diffusion.h. Referenced by DiffusionAgent::command(), DiffusionAgent::DiffusionAgent(), and DiffusionAgent::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(). |
1.3.3