Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

DiffusionRate Class Reference

#include <diff_rate.h>

Inheritance diagram for DiffusionRate:

Inheritance graph
[legend]
Collaboration diagram for DiffusionRate:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DiffusionRate ()
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_taddr ()
nsaddr_tport ()
nsaddr_tdaddr ()
nsaddr_tdport ()
void set_pkttype (packet_t pkttype)
packet_t get_pkttype ()
NsObjecttarget ()
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 reset ()
void consider_old (Packet *)
void consider_new (Packet *)
void Start ()
void DataReqAll (unsigned int dtype, int report_rate)
void Print_IOlist ()
void FwdData (Packet *)
void PosReinf (int dtype, nsaddr_t to_node, ns_addr_t info_sender, unsigned int info_seq)
void ProcessPosReinf (Packet *pkt)
void ProcessNegReinf (Packet *pkt)
void UcastNeg (int dtype, ns_addr_t to)
void BcastNeg (int dtype)
void GenNeg (int dtype)
void InterestHandle (Packet *pkt)
void GradientTimeOut ()
void NegReinfTimeOut ()
void CheckNegCounter (int dtype)
bool FwdSubsample (Packet *pkt)
void FwdOriginal (Packet *pkt)
void TriggerPosReinf (Packet *pkt, ns_addr_t forward_agent)
void send_to_dmux (Packet *pkt, Handler *h)
void clear_arp_buf ()
void clear_send_buf ()
void Terminate ()
Packetcreate_packet ()
Packetprepare_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 xmitFailed (Packet *pkt)
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 ()
Packetallocpkt () const
Packetallocpkt (int) const
void initpkt (Packet *) const
void deleteAgentTrace ()
void addAgentTrace (const char *name)
void monitorAgentTrace ()
OldValuelookupOldValue (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

bool DUP_SUP_
sub_t sub_type_
org_t org_type_
pos_t pos_type_
pos_ndt pos_node_type_
neg_wint neg_win_type_
neg_tht neg_thr_type_
neg_mxt neg_max_type_
Data_Hash_Table DataTable
GradientTimergradient_timer
NegativeReinforceTimerneg_reinf_timer
int num_not_send_bcast_data
int num_data_bcast_send
int num_data_bcast_rcv
int num_neg_bcast_send
int num_neg_bcast_rcv
bool POS_REINF_
bool NEG_REINF_
int pk_count
int overhead
Pkt_Hash_Table PktTable
Nodenode
Tracetracetarget
NsObjectll
NsObjectport_dmux
ARPTablearp_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_
OldValueoldValueList_
Applicationapp_
EventTraceet_
NsObjecttarget_
NsObjectdrop_
int debug_

Static Protected Attributes

int uidcnt_

Friends

class GradientTimer
class NegativeReinforceTimer
class ArpBufferTimer
class SendBufTimer
void XmitFailedCallback (Packet *pkt, void *data)

Constructor & Destructor Documentation

DiffusionRate::DiffusionRate  ) 
 

Definition at line 85 of file diff_rate.cc.

References BCAST_SUB, DUP_SUP_, INTM_POS, NEG_ABSOLUTE, NEG_FIXED_MAX, neg_max_type_, neg_thr_type_, NEG_TIMER, neg_win_type_, num_data_bcast_rcv, num_data_bcast_send, num_neg_bcast_rcv, num_neg_bcast_send, num_not_send_bcast_data, org_type_, POS_ALL, pos_node_type_, pos_type_, sub_type_, and UNICAST_ORG.

00085                              : DiffusionAgent()
00086 {
00087   DUP_SUP_ = true;
00088 
00089   sub_type_ = BCAST_SUB;
00090   org_type_ = UNICAST_ORG;
00091   pos_type_ = POS_ALL;
00092   pos_node_type_ = INTM_POS;
00093   neg_win_type_ = NEG_TIMER;
00094   neg_thr_type_ = NEG_ABSOLUTE;
00095   neg_max_type_ = NEG_FIXED_MAX;
00096 
00097   num_not_send_bcast_data = 0;
00098   num_data_bcast_send = 0;
00099   num_data_bcast_rcv = 0;
00100   num_neg_bcast_send = 0;
00101   num_neg_bcast_rcv = 0;
00102 }


Member Function Documentation

void Agent::addAgentTrace const char *  name  )  [protected, inherited]
 

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:

nsaddr_t& Agent::addr  )  [inline, inherited]
 

Definition at line 96 of file agent.h.

References ns_addr_t::addr_, Agent::here_, and nsaddr_t.

Referenced by LandmarkAgent::assign_lmaddress(), SSMSRMAgent::command(), IntTcpAgent::createTcpSession(), Agent::flushAVar(), LmsSender::handle_lms_pkt(), SSMSRMAgent::is_active(), QSNewRenoTcpAgent::recv(), TcpAsymSink::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), QSAgent::recv(), MIPBSAgent::recv(), LmsAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), SSMSRMAgent::recv_glb_sess(), SSMSRMAgent::recv_loc_sess(), SSMSRMAgent::recv_rep_sess(), SRMAgent::recv_sess(), TapAgent::recvpkt(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), SSMSRMAgent::send_glb_sess(), LmsSender::send_lms_pkt(), SSMSRMAgent::send_loc_sess(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), MIPMHAgent::send_sols(), LmsSender::send_spm(), LmsAgent::send_upstream(), SRMAgent::sendmsg(), LmsSender::solicit_naks(), SRMAgent::start(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00096 { return here_.addr_; }

Packet * Agent::allocpkt int   )  const [protected, inherited]
 

Definition at line 517 of file agent.cc.

References Packet::allocdata(), and Agent::allocpkt().

00518 {
00519         Packet* p = allocpkt();
00520 
00521         if (n > 0)
00522                 p->allocdata(n);
00523 
00524         return(p);
00525 }

Here is the call graph for this function:

Packet * Agent::allocpkt  )  const [protected, inherited]
 

Definition at line 506 of file agent.cc.

References Packet::alloc(), and Agent::initpkt().

Referenced by TcpSink::ack(), QSTcpSink::ack(), Agent::allocpkt(), PingAgent::command(), MessageAgent::command(), mcastControlAgent::command(), LmsAgent::command(), LDPAgent::command(), LandmarkAgent::command(), IvsReceiver::command(), DSDV_Agent::command(), OmniMcastAgent::create_packet(), FloodingAgent::create_packet(), DiffusionAgent::create_packet(), SinkAgent::create_packet(), SensorQueryAgent::generate_query(), DSRAgent::getRouteForPacket(), LandmarkAgent::makeUpdate(), DSDV_Agent::makeUpdate(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), AbsTcpAgent::output(), TCPTapAgent::processpkt(), AbsDelAckSink::recv(), AbsTcpSink::recv(), SAack_Agent::recv(), PingAgent::recv(), Encapsulator::recv(), TapAgent::recvpkt(), MIPMHAgent::reg(), DSRAgent::replyFromRouteCache(), DSRAgent::returnSrcRouteToRequestor(), HttpInvalAgent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), MFTPSndAgent::send_data(), GAFAgent::send_discovery(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), SSMSRMAgent::send_glb_sess(), LmsSender::send_lms_pkt(), SSMSRMAgent::send_loc_sess(), MFTPRcvAgent::send_nak(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), MIPMHAgent::send_sols(), LmsSender::send_spm(), MFTPSndAgent::send_status_request(), RapAgent::SendAck(), UdpAgent::sendmsg(), SimpleTcpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), PushbackAgent::sendMsg(), LmsSender::sendmsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), RLM_Sender::sendpkt(), IvsSource::sendpkt(), IcmpAgent::sendredirect(), SA_Agent::sendreq(), DSRAgent::sendRouteShortening(), SA_Agent::sendteardown(), LmsSender::solicit_naks(), and AbsDelAckSink::timeout().

00507 {
00508         Packet* p = Packet::alloc();
00509         initpkt(p);
00510         return (p);
00511 }

Here is the call graph for this function:

void DiffusionAgent::ArpBufferCheck  )  [protected, inherited]
 

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:

void Agent::attachApp Application app  )  [virtual, inherited]
 

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 }

void DiffusionRate::BcastNeg int  dtype  )  [protected]
 

Definition at line 699 of file diff_rate.cc.

References ns_addr_t::addr_, HDR_CDIFF, HDR_CMN, MAC_BROADCAST, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::mess_type, MsgStr, NEG_REINFORCE, hdr_cmn::next_hop(), NS_AF_ILINK, num_neg_bcast_send, DiffusionAgent::overhead, hdr_cdiff::pk_num, ns_addr_t::port_, DiffusionAgent::prepare_message(), ROUTING_PORT, hdr_cdiff::sender_id, and THIS_NODE.

Referenced by FwdData(), and ProcessNegReinf().

00700 {
00701     ns_addr_t bcast_addr;
00702     bcast_addr.addr_ = MAC_BROADCAST;
00703     bcast_addr.port_ = ROUTING_PORT;
00704 
00705     Packet *pkt=prepare_message(dtype, bcast_addr, NEG_REINFORCE);
00706 
00707       MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00708       MACsend(pkt, 0);
00709       overhead++;
00710       num_neg_bcast_send++;
00711 
00712 #ifdef DEBUG_RATE
00713       hdr_cdiff *dfh = HDR_CDIFF(pkt);
00714       hdr_cmn *cmh = HDR_CMN(pkt);
00715       printf("DF node %d will send %s (%x, %x, %d) to %x\n",
00716              THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00717              (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00718 #endif // DEBUG_RATE
00719 
00720 }

Here is the call graph for this function:

void DiffusionRate::CheckNegCounter int  dtype  )  [protected]
 

Definition at line 297 of file diff_rate.cc.

References Diff_Routing_Entry::ClrAllNewOrg(), Diff_Routing_Entry::ClrAllOldOrg(), GenNeg(), MAX_NEG_COUNTER, NEG_FIXED_MAX, neg_max_type_, DiffusionAgent::NEG_REINF_, NEG_SCALE_MAX, Diff_Routing_Entry::new_org_counter, Diff_Routing_Entry::num_iif, PER_IIF, and DiffusionAgent::routing_table.

Referenced by consider_new().

00298 {
00299   if (neg_max_type_ == NEG_FIXED_MAX) {
00300           if (routing_table[dtype].new_org_counter >= MAX_NEG_COUNTER
00301               && NEG_REINF_ == true) {
00302             GenNeg(dtype);
00303             routing_table[dtype].new_org_counter = 0;
00304             routing_table[dtype].ClrAllNewOrg();
00305             routing_table[dtype].ClrAllOldOrg();
00306           }
00307           return;
00308   }
00309 
00310   if (neg_max_type_ == NEG_SCALE_MAX) {
00311           if (routing_table[dtype].new_org_counter >= 
00312               PER_IIF * routing_table[dtype].num_iif
00313               && NEG_REINF_ == true) {
00314             GenNeg(dtype);
00315             routing_table[dtype].new_org_counter = 0;
00316             routing_table[dtype].ClrAllNewOrg();
00317             routing_table[dtype].ClrAllOldOrg();
00318           }
00319           return;
00320   }
00321 }

Here is the call graph for this function:

void DiffusionAgent::clear_arp_buf  )  [protected, inherited]
 

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:

void DiffusionAgent::clear_send_buf  )  [protected, inherited]
 

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:

void Agent::close  )  [virtual, inherited]
 

Reimplemented in FullTcpAgent.

Definition at line 377 of file agent.cc.

Referenced by Agent::command().

00378 {
00379 }

int DiffusionRate::command int  argc,
const char *const *  argv
[virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 986 of file diff_rate.cc.

References DiffusionAgent::command(), DUP_SUP_, neg_max_type_, neg_thr_type_, neg_win_type_, org_type_, ParseNegMaxType(), ParseNegThrType(), ParseNegWinType(), ParseOrgType(), ParsePosNodeType(), ParsePosType(), ParseSubType(), pos_node_type_, pos_type_, and sub_type_.

00987 {
00988   if (argc == 2) {
00989     if (strcasecmp(argv[1], "enable-suppression") == 0) {
00990       DUP_SUP_ = true;
00991       return TCL_OK;
00992     }
00993 
00994     if (strcasecmp(argv[1], "disable-suppression") == 0) {
00995       DUP_SUP_ = false;
00996       return TCL_OK;
00997     }
00998 
00999   }
01000 
01001   else if (argc == 3) {
01002     
01003     if (strcasecmp(argv[1], "set-sub-tx-type") == 0 ) {
01004       sub_type_ = ParseSubType(argv[2]);
01005       return TCL_OK;
01006     }
01007 
01008     if (strcasecmp(argv[1], "set-org-tx-type") == 0 ) {
01009       org_type_ = ParseOrgType(argv[2]);
01010       return TCL_OK;
01011     }
01012 
01013     if (strcasecmp(argv[1], "set-pos-type") == 0 ) {
01014       pos_type_ = ParsePosType(argv[2]);
01015       return TCL_OK;
01016     }
01017 
01018     if (strcasecmp(argv[1], "set-pos-node-type") == 0 ) {
01019       pos_node_type_ = ParsePosNodeType(argv[2]);
01020       return TCL_OK;
01021     }
01022 
01023     if (strcasecmp(argv[1], "set-neg-win-type") == 0 ) {
01024       neg_win_type_ = ParseNegWinType(argv[2]);
01025       return TCL_OK;
01026     }
01027 
01028     if (strcasecmp(argv[1], "set-neg-thr-type") == 0 ) {
01029       neg_thr_type_ = ParseNegThrType(argv[2]);
01030       return TCL_OK;
01031     }
01032     
01033     if (strcasecmp(argv[1], "set-neg-max-type") == 0 ) {
01034       neg_max_type_ = ParseNegMaxType(argv[2]);
01035       return TCL_OK;
01036     }
01037   }
01038 
01039 
01040   return DiffusionAgent::command(argc, argv);
01041 }

Here is the call graph for this function:

void Agent::connect nsaddr_t  dst  )  [virtual, inherited]
 

Definition at line 389 of file agent.cc.

Referenced by Agent::command().

00390 {
00391 /*
00392         dst_ = dst;
00393 */
00394 }

void DiffusionRate::consider_new Packet  )  [protected]
 

Reimplemented from DiffusionAgent.

Definition at line 189 of file diff_rate.cc.

References Diff_Routing_Entry::active, God::AddSource(), AGT_ADDR, CheckNegCounter(), Diff_Routing_Entry::CntNeg(), Diff_Routing_Entry::CntNewOrg(), Diff_Routing_Entry::CntNewSub(), DATA, DATA_READY, DATA_REQUEST, hdr_cdiff::data_type, DiffusionAgent::DataForSink(), hdr_cdiff::forward_agent_id, Packet::free(), FwdData(), HDR_CDIFF, HDR_CMN, God::instance(), INTEREST, InterestHandle(), MAC_BROADCAST, hdr_cdiff::mess_type, NEG_COUNTER, DiffusionAgent::NEG_REINF_, NEG_REINFORCE, neg_win_type_, Diff_Routing_Entry::new_org_counter, Agent_List::next, hdr_cmn::next_hop_, nsaddr_t, num_data_bcast_rcv, num_neg_bcast_rcv, ORIGINAL, DiffusionAgent::POS_REINF_, POS_REINFORCE, DiffusionAgent::prepare_message(), ProcessNegReinf(), ProcessPosReinf(), hdr_cdiff::report_rate, DiffusionAgent::routing_table, DiffusionAgent::send_to_dmux(), hdr_cdiff::sender_id, Diff_Routing_Entry::sink, Diff_Routing_Entry::source, and SUB_SAMPLED.

Referenced by recv().

00190 {
00191   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00192   hdr_cmn * cmh = HDR_CMN(pkt);
00193   unsigned char msg_type = dfh->mess_type;
00194   unsigned int dtype = dfh->data_type;
00195 
00196   Agent_List *agentPtr;
00197   Packet *gen_pkt;
00198   hdr_cdiff *gen_dfh;
00199 
00200   switch (msg_type) {
00201     case INTEREST : 
00202       InterestHandle(pkt);
00203       return;
00204 
00205     case POS_REINFORCE :
00206       if ( POS_REINF_ == false ) {
00207         printf("Hey, we are not in pos_reinf mode.\n");
00208         Packet::free(pkt);
00209         exit(-1);
00210       }
00211 
00212       ProcessPosReinf(pkt);
00213       return;
00214 
00215     case NEG_REINFORCE :  
00216       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00217         num_neg_bcast_rcv++;
00218       } else {
00219         routing_table[dtype].CntNeg(dfh->forward_agent_id);
00220       }
00221 
00222       if (NEG_REINF_ == false) {
00223         printf("Hey, we are not in neg_reinf mode.\n");
00224         Packet::free(pkt);
00225         exit(-1);
00226       }
00227 
00228       ProcessNegReinf(pkt);
00229       return;
00230 
00231     case DATA_READY :
00232 
00233       // put source_agent in source list of routing table
00234 
00235       agentPtr = new Agent_List;
00236       AGT_ADDR(agentPtr) = dfh->sender_id;
00237       agentPtr->next = routing_table[dtype].source;
00238       routing_table[dtype].source = agentPtr;
00239 
00240       God::instance()->AddSource(dtype, (dfh->sender_id).addr_);
00241         /*
00242         printf("DF %d received DATA_READY (%d, %d, %d) at time %lf\n",
00243                THIS_NODE, dfh->sender_id.addr_, dfh->sender_id.port_,
00244                dfh->pk_num, NOW);
00245         */
00246 
00247       if (routing_table[dtype].active != NULL ||
00248             routing_table[dtype].sink != NULL) {
00249         gen_pkt = prepare_message(dtype, dfh->sender_id, DATA_REQUEST);
00250         gen_dfh = HDR_CDIFF(gen_pkt);
00251         gen_dfh->report_rate = SUB_SAMPLED;
00252         send_to_dmux(gen_pkt, 0);
00253 
00254           /*
00255           printf("DF %d sent DATA_REQUEST (%d, %d, %d) at time %lf\n",
00256                  THIS_NODE, gen_dfh->sender_id.addr_, gen_dfh->sender_id.port_,
00257                  gen_dfh->pk_num, NOW);
00258           */
00259       }
00260           
00261       Packet::free(pkt);
00262       return;
00263 
00264     case DATA :
00265 
00266       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00267         num_data_bcast_rcv++;
00268       }
00269 
00270       DataForSink(pkt);
00271 
00272       if (dfh->report_rate == SUB_SAMPLED) {
00273           routing_table[dtype].CntNewSub(dfh->forward_agent_id);
00274           FwdData(pkt);
00275           return;
00276       }
00277 
00278       if (dfh->report_rate == ORIGINAL) {
00279           routing_table[dtype].new_org_counter++;
00280           routing_table[dtype].CntNewOrg(dfh->forward_agent_id);
00281           FwdData(pkt);
00282 
00283           if (neg_win_type_ == NEG_COUNTER) {
00284             CheckNegCounter(dtype);
00285             return;
00286           }
00287       }
00288       return;
00289 
00290     default : 
00291       Packet::free(pkt);        
00292       break;
00293   }
00294 }

Here is the call graph for this function:

void DiffusionRate::consider_old Packet  )  [protected]
 

Reimplemented from DiffusionAgent.

Definition at line 152 of file diff_rate.cc.

References Diff_Routing_Entry::CntOldOrg(), DATA, hdr_cdiff::data_type, hdr_cdiff::forward_agent_id, Packet::free(), HDR_CDIFF, HDR_CMN, INTEREST, InterestHandle(), MAC_BROADCAST, hdr_cdiff::mess_type, NEG_REINFORCE, hdr_cmn::next_hop_, nsaddr_t, num_data_bcast_rcv, num_neg_bcast_rcv, ORIGINAL, hdr_cdiff::report_rate, and DiffusionAgent::routing_table.

Referenced by recv().

00153 {
00154   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00155   hdr_cmn* cmh = HDR_CMN(pkt);
00156   unsigned char msg_type = dfh->mess_type;
00157   unsigned int dtype = dfh->data_type;
00158 
00159   switch (msg_type) {
00160     case INTEREST :
00161       InterestHandle(pkt);
00162       return;
00163 
00164     case DATA: 
00165 
00166       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00167         num_data_bcast_rcv++;
00168       }
00169 
00170       if (dfh->report_rate == ORIGINAL) {
00171           routing_table[dtype].CntOldOrg(dfh->forward_agent_id);
00172       }
00173       Packet::free(pkt);
00174       return;
00175     
00176     case NEG_REINFORCE:
00177       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00178         num_neg_bcast_rcv++;
00179       }
00180       break;
00181       
00182     default : 
00183       Packet::free(pkt);        
00184       break;
00185   }
00186 }

Here is the call graph for this function:

Packet * DiffusionAgent::create_packet  )  [protected, inherited]
 

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().

00364 {
00365   Packet *pkt = allocpkt();
00366 
00367   if (pkt==NULL) return NULL;
00368 
00369   hdr_cmn*  cmh = HDR_CMN(pkt);
00370   cmh->size() = 36;
00371 
00372   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00373   dfh->ts_ = NOW;
00374   return pkt;
00375 }

Here is the call graph for this function:

nsaddr_t& Agent::daddr  )  [inline, inherited]
 

Definition at line 98 of file agent.h.

References ns_addr_t::addr_, Agent::dst_, and nsaddr_t.

Referenced by IntTcpAgent::createTcpSession(), DSDV_Agent::lost_link(), TcpAsymSink::recv(), CtrMcastEncap::recv(), PingResponder::reflect(), IntTcpAgent::rxmit_last(), LmsSender::send_dmcast(), LmsSender::send_lms_pkt(), IntTcpAgent::send_one(), rtProtoDV::sendpkt(), LmsSender::solicit_naks(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), and TcpAsymAgent::traceVar().

00098 { return dst_.addr_; }

void DiffusionAgent::DataForSink Packet  )  [protected, inherited]
 

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 consider_new(), and DiffusionProb::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:

void DiffusionRate::DataReqAll unsigned int  dtype,
int  report_rate
[protected]
 

Definition at line 654 of file diff_rate.cc.

References AGENT_NEXT, AGT_ADDR, DATA_REQUEST, HDR_CDIFF, DiffusionAgent::prepare_message(), hdr_cdiff::report_rate, DiffusionAgent::routing_table, DiffusionAgent::send_to_dmux(), and Diff_Routing_Entry::source.

Referenced by InterestHandle(), ProcessNegReinf(), ProcessPosReinf(), and TriggerPosReinf().

00655 {
00656   Agent_List *cur_agent;
00657   Packet *pkt;
00658   hdr_cdiff *dfh;
00659 
00660   for (cur_agent=routing_table[dtype].source; cur_agent != NULL; 
00661        cur_agent = AGENT_NEXT(cur_agent) ) {
00662     pkt = prepare_message(dtype, AGT_ADDR(cur_agent), DATA_REQUEST);
00663     dfh = HDR_CDIFF(pkt);
00664     dfh->report_rate = report_rate;
00665     send_to_dmux(pkt, 0);
00666   }
00667 }

Here is the call graph for this function:

void NsObject::debug const char *  fmt,
... 
[virtual, inherited]
 

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 }

int Agent::delay_bind_dispatch const char *  varName,
const char *  localName,
TclObject tracer
[protected, virtual, inherited]
 

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:

void Agent::delay_bind_init_all  )  [protected, virtual, inherited]
 

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:

void Agent::deleteAgentTrace  )  [protected, inherited]
 

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:

nsaddr_t& Agent::dport  )  [inline, inherited]
 

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().

00099 { return dst_.port_; }

void Connector::drop Packet p,
const char *  s
[protected, virtual, inherited]
 

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:

void Connector::drop Packet p  )  [virtual, inherited]
 

Definition at line 106 of file connector.cc.

References Connector::drop_, Packet::free(), and NsObject::recv().

Referenced by DSRAgent::acceptRouteReply(), ARPTable::arpresolve(), JoBS::dropFront(), Vq::dropPacketForECN(), DSRAgent::dropSendBuff(), JoBS::dropTail(), dsREDQueue::edrop(), Vq::enque(), SRR::enque(), SimpleIntServ::enque(), SFQ::enque(), rtqueue::enque(), RIOQueue::enque(), REMQueue::enque(), REDQueue::enque(), RedPDQueue::enque(), PIQueue::enque(), Marker::enque(), GK::enque(), dsREDQueue::enque(), DRR::enque(), DropTail::enque(), Demarker::enque(), aodv_rqueue::enque(), toraAgent::forward(), AODV::forward(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), DSRAgent::getRouteForPacket(), Snoop::handle(), DSRAgent::handleFlowForwarding(), DSRAgent::handleForwarding(), DSDV_Agent::lost_link(), TCPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), rtqueue::purge(), imepAgent::purgeReXmitQ(), SessionTTLChecker::recv(), TTLChecker::recv(), toraAgent::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), TBF::recv(), SatLL::recv(), LL::recv(), GAFPartner::recv(), FloodAgent::recv(), Filter::recv(), DynamicLink::recv(), DSDV_Agent::recv(), AODV::recv(), AODV::recvError(), PriQueue::recvHighPriority(), AODV::recvReply(), toraAgent::reset(), Queue< T >::reset(), LinkDelay::reset(), AODV::rt_ll_failed(), AODV::rt_purge(), AODV::rt_resolve(), toraAgent::rtRoutePacket(), TCPTapAgent::sendpkt(), TapAgent::sendpkt(), IPTapAgent::sendpkt(), AODV::sendRequest(), SatLL::sendUp(), LL::sendUp(), PriQueue::Terminate(), DSRAgent::Terminate(), CMUPriQueue::Terminate(), ARPTable::Terminate(), and DSRAgent::undeliverablePkt().

00107 {
00108         if (drop_ != 0)
00109                 drop_->recv(p);
00110         else
00111                 Packet::free(p);
00112 }

Here is the call graph for this function:

void Agent::dumpTracedVars  )  [protected, inherited]
 

void DiffusionRate::FwdData Packet  )  [protected]
 

Definition at line 609 of file diff_rate.cc.

References BcastNeg(), Diff_Routing_Entry::ClrAllNewOrg(), Diff_Routing_Entry::ClrAllOldOrg(), hdr_cdiff::data_type, Diff_Routing_Entry::ExistOriginalGradient(), hdr_cdiff::forward_agent_id, Packet::free(), FwdOriginal(), FwdSubsample(), HDR_CDIFF, DiffusionAgent::NEG_REINF_, Diff_Routing_Entry::new_org_counter, nsaddr_t, hdr_cdiff::report_rate, DiffusionAgent::routing_table, Diff_Routing_Entry::sink, SUB_SAMPLED, THIS_NODE, and TriggerPosReinf().

Referenced by consider_new().

00610 {
00611   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00612   unsigned int dtype = dfh->data_type;
00613   nsaddr_t forwarder_node;
00614   ns_addr_t forward_agent;
00615   bool forward_flag;
00616 
00617   forwarder_node = (dfh->forward_agent_id).addr_;
00618   forward_agent = dfh->forward_agent_id;
00619 
00620   if (dfh->report_rate == SUB_SAMPLED) {
00621     forward_flag = FwdSubsample(pkt);
00622     TriggerPosReinf(pkt, forward_agent);
00623 
00624     if (forward_flag == false) {
00625       Packet::free(pkt);
00626     }
00627     return;
00628   } 
00629 
00630   // Then, report rate is ORIGINAL here.
00631 
00632   if (routing_table[dtype].ExistOriginalGradient() == false
00633       && routing_table[dtype].sink == NULL) {
00634     
00635     if (THIS_NODE != forwarder_node && NEG_REINF_ == true) {
00636       BcastNeg(dtype);
00637       routing_table[dtype].new_org_counter = 0;
00638       routing_table[dtype].ClrAllNewOrg();
00639       routing_table[dtype].ClrAllOldOrg();
00640    }
00641     Packet::free(pkt);
00642     return;
00643   }
00644 
00645   if (routing_table[dtype].ExistOriginalGradient() == false) {
00646     Packet::free(pkt);
00647     return;
00648   }
00649 
00650   FwdOriginal(pkt);
00651 }

Here is the call graph for this function:

void DiffusionRate::FwdOriginal Packet pkt  )  [protected]
 

Definition at line 549 of file diff_rate.cc.

References Diff_Routing_Entry::active, AGT_ADDR, BCAST_ORG, Packet::copy(), hdr_cdiff::data_type, hdr_ip::dst_, hdr_cdiff::forward_agent_id, Packet::free(), GRADIENT, HDR_CDIFF, HDR_CMN, HDR_IP, Agent::here_, JITTER, MAC_BROADCAST, MAC_RETRY_, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::mess_type, MsgStr, hdr_cmn::next_hop(), hdr_cdiff::next_nodes, NODE_ADDR, NS_AF_ILINK, NS_AF_INET, Out_List::num_data_send, hdr_cdiff::num_next, org_type_, ORIGINAL, OUT_NEXT, hdr_cdiff::pk_num, DiffusionAgent::routing_table, hdr_cdiff::sender_id, THIS_NODE, UNICAST_ORG, and Random::uniform().

Referenced by FwdData().

00550 {
00551   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00552   unsigned int dtype = dfh->data_type;
00553   Out_List *cur_out;
00554   Packet   *cur_pkt;
00555   hdr_cdiff *cur_dfh;
00556   hdr_ip   *cur_iph;
00557  
00558   if (org_type_ == BCAST_ORG) {
00559     MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00560     MACsend(pkt, JITTER*Random::uniform(1.0));
00561 
00562 #ifdef DEBUG_RATE 
00563     hdr_cmn *cmh = HDR_CMN(pkt);
00564     printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00565            THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00566            (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00567 #endif  // DEBUG_RATE
00568 
00569     return;
00570   }
00571 
00572   if (org_type_ == UNICAST_ORG) {
00573     for (cur_out = routing_table[dtype].active; cur_out!= NULL; 
00574        cur_out = OUT_NEXT(cur_out)) {
00575       if (GRADIENT(cur_out) == ORIGINAL) {
00576 
00577         cur_pkt       = pkt->copy();
00578         cur_iph       = HDR_IP(cur_pkt);
00579         cur_iph->dst_ = AGT_ADDR(cur_out);
00580 
00581         cur_dfh       = HDR_CDIFF(cur_pkt);
00582         cur_dfh->forward_agent_id = here_;
00583         cur_dfh->num_next = 1;
00584         cur_dfh->next_nodes[0] = NODE_ADDR(cur_out);
00585 
00586         cur_out->num_data_send++;
00587 
00588         MACprepare(cur_pkt, NODE_ADDR(cur_out), NS_AF_INET, 
00589                  MAC_RETRY_);
00590         MACsend(cur_pkt, 0);      
00591  
00592 #ifdef DEBUG_RATE
00593         cur_cmh = HDR_CMN(cur_pkt);
00594         printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00595              THIS_NODE, MsgStr[cur_dfh->mess_type], 
00596              (cur_dfh->sender_id).addr_, (cur_dfh->sender_id).port_, 
00597              cur_dfh->pk_num, cur_cmh->next_hop());
00598 #endif // DEBUG_RATE
00599 
00600       } // endif
00601     }   // endfor
00602 
00603     Packet::free(pkt);
00604     return; 
00605   }    // endif unicast original
00606 }

Here is the call graph for this function:

bool DiffusionRate::FwdSubsample Packet pkt  )  [protected]
 

Definition at line 446 of file diff_rate.cc.

References Diff_Routing_Entry::active, AGT_ADDR, BCAST_SUB, Packet::copy(), hdr_cdiff::data_type, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_CMN, HDR_IP, Agent::here_, JITTER, MAC_BROADCAST, MAC_RETRY_, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::mess_type, MsgStr, hdr_cmn::next_hop(), hdr_cdiff::next_nodes, NODE_ADDR, NS_AF_ILINK, NS_AF_INET, Diff_Routing_Entry::num_active, num_data_bcast_send, hdr_cdiff::num_next, num_not_send_bcast_data, OUT_NEXT, hdr_cdiff::pk_num, DiffusionAgent::routing_table, hdr_cdiff::sender_id, sub_type_, THIS_NODE, UNICAST_SUB, and Random::uniform().

Referenced by FwdData().

00447 {
00448   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00449   Out_List *cur_out;
00450   Packet   *cur_pkt;
00451   hdr_cdiff *cur_dfh;
00452   hdr_ip   *cur_iph;
00453   unsigned int dtype = dfh->data_type;
00454 
00455     if (routing_table[dtype].num_active <= 0) {   // Won't forward
00456       num_not_send_bcast_data++;
00457       return false;
00458     } 
00459 
00460     // Will forward
00461       
00462     num_data_bcast_send++;
00463 
00464     if (sub_type_ == BCAST_SUB) {
00465         MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00466         MACsend(pkt, JITTER*Random::uniform(1.0));
00467 
00468 #ifdef DEBUG_RATE 
00469         hdr_cmn *cmh = HDR_CMN(pkt);
00470         printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00471            THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00472            (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00473 #endif // DEBUG_RATE
00474 
00475         return true;
00476     }
00477 
00478     if (sub_type_ == UNICAST_SUB) {
00479         for (cur_out = routing_table[dtype].active; cur_out!= NULL; 
00480            cur_out = OUT_NEXT(cur_out)) {
00481 
00482           cur_pkt       = pkt->copy();
00483           cur_iph       = HDR_IP(cur_pkt);
00484           cur_iph->dst_ = AGT_ADDR(cur_out);
00485 
00486           cur_dfh       = HDR_CDIFF(cur_pkt);
00487           cur_dfh->forward_agent_id = here_;
00488           cur_dfh->num_next = 1;
00489           cur_dfh->next_nodes[0] = NODE_ADDR(cur_out);
00490 
00491           MACprepare(cur_pkt, NODE_ADDR(cur_out), NS_AF_INET, 
00492                  MAC_RETRY_);
00493           MACsend(cur_pkt, 0);      
00494 
00495 #ifdef DEBUG_RATE
00496           cur_cmh = HDR_CMN(cur_pkt);
00497           printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00498              THIS_NODE, MsgStr[cur_dfh->mess_type], 
00499              (cur_dfh->sender_id).addr_, (cur_dfh->sender_id).port_, 
00500              cur_dfh->pk_num, cur_cmh->next_hop());
00501 #endif // DEBUG_RATE
00502 
00503         } // endfor
00504         
00505         return true;
00506     }   // endif unicast sub
00507 
00508     return false;
00509 }

Here is the call graph for this function:

void DiffusionRate::GenNeg int  dtype  )  [protected]
 

Definition at line 670 of file diff_rate.cc.

References AGT_ADDR, Diff_Routing_Entry::iif, IN_NEXT, MAX_DUP_DATA, Diff_Routing_Entry::MostRecvOrg(), NEG_ABSOLUTE, NEG_MIN_RATIO, NEG_RELATIVE, neg_thr_type_, NEW_ORG_RECV, In_List::num_neg_send, OLD_ORG_RECV, DiffusionAgent::routing_table, and UcastNeg().

Referenced by CheckNegCounter(), and NegReinfTimeOut().

00671 {
00672   In_List *cur;
00673 
00674   if (neg_thr_type_ == NEG_ABSOLUTE) {
00675     for (cur= routing_table[dtype].iif; cur != NULL; cur= IN_NEXT(cur)) {
00676       if (NEW_ORG_RECV(cur) <= 0 && OLD_ORG_RECV(cur) > MAX_DUP_DATA) {
00677         UcastNeg(dtype, AGT_ADDR(cur));
00678         cur->num_neg_send++;
00679       }
00680     }
00681     return;
00682   }
00683 
00684   if (neg_thr_type_ == NEG_RELATIVE) {
00685     int most= routing_table[dtype].MostRecvOrg();
00686 
00687     for (cur= routing_table[dtype].iif; cur != NULL; cur= IN_NEXT(cur)) {
00688       if (OLD_ORG_RECV(cur) > MAX_DUP_DATA &&
00689           NEW_ORG_RECV(cur) <= NEG_MIN_RATIO*most) {
00690         UcastNeg(dtype, AGT_ADDR(cur));
00691         cur->num_neg_send++;
00692       }
00693     }
00694     return;
00695   }
00696 }

Here is the call graph for this function:

packet_t Agent::get_pkttype  )  [inline, inherited]
 

Definition at line 101 of file agent.h.

References packet_t, and Agent::type_.

Referenced by CBR_Traffic::init().

00101 { return type_; }

void DiffusionRate::GradientTimeOut  )  [protected]
 

Definition at line 419 of file diff_rate.cc.

References Diff_Routing_Entry::active, GRAD_TMOUT, gradient_timer, INTEREST_TIMEOUT, INTF_REMOVE, MAX_DATA_TYPE, Agent_List::next, NOW, TimerHandler::resched(), and DiffusionAgent::routing_table.

Referenced by GradientTimer::expire().

00420 {
00421   int i;
00422   Agent_List *cur_out, **prv_out;
00423  
00424   for (i=0; i<MAX_DATA_TYPE; i++) {
00425     for (cur_out = routing_table[i].active, 
00426          prv_out = (Agent_List **)&routing_table[i].active; 
00427          cur_out != NULL; ) {
00428       
00429       if (NOW > GRAD_TMOUT(cur_out)) {
00430         INTF_REMOVE(prv_out, cur_out);
00431         routing_table[i].num_active -- ;
00432         cur_out = *prv_out;
00433       }
00434       else {
00435         prv_out = &(cur_out->next);
00436         cur_out = cur_out->next;
00437       }
00438       
00439     }
00440   }
00441   
00442   gradient_timer->resched(INTEREST_TIMEOUT);
00443 }

Here is the call graph for this function:

void NsObject::handle Event  )  [protected, virtual, inherited]
 

Implements Handler.

Reimplemented in LinkDelay, LL, AckRecons, and Snoop.

Definition at line 91 of file object.cc.

References NsObject::recv().

00092 {
00093         recv((Packet*)e);
00094 }

Here is the call graph for this function:

void Agent::idle  )  [protected, virtual, inherited]
 

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().

00364 {
00365         if (app_)
00366                 app_->resume();
00367 }

Here is the call graph for this function:

void Agent::initpkt Packet  )  const [protected, inherited]
 

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:

void Agent::insertOldValue TracedVar *  v,
const char *  value
[protected, inherited]
 

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 }

void DiffusionRate::InterestHandle Packet pkt  )  [protected]
 

Definition at line 324 of file diff_rate.cc.

References God::AddSink(), AGT_ADDR, PrvCurPtr::cur, hdr_cdiff::data_type, DataReqAll(), hdr_cdiff::forward_agent_id, Packet::free(), GRAD_TMOUT, GRADIENT, HDR_CDIFF, HDR_CMN, God::instance(), INTEREST_PERIODIC, INTEREST_TIMEOUT, INTF_FIND, INTF_INSERT, JITTER, Diff_Routing_Entry::last_fwd_time, MAC_BROADCAST, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), max, hdr_cdiff::mess_type, MsgStr, hdr_cmn::next_hop(), NOW, NS_AF_ILINK, nsaddr_t, Diff_Routing_Entry::num_active, ORIGINAL, DiffusionAgent::overhead, hdr_cdiff::pk_num, hdr_cdiff::report_rate, DiffusionAgent::routing_table, hdr_cdiff::sender_id, SUB_SAMPLED, THIS_NODE, hdr_cdiff::ts_, and Random::uniform().

Referenced by consider_new(), and consider_old().

00325 {
00326   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00327   unsigned int dtype = dfh->data_type;
00328   Agent_List *agentPtr;
00329 
00330   nsaddr_t from_nodeID;
00331   PrvCurPtr RetVal;
00332   Out_List *OutPtr;
00333 
00334 
00335    if (dfh->ts_ + INTEREST_TIMEOUT < NOW) {
00336       Packet::free(pkt);
00337       return;
00338    }
00339 
00340    // Check if it comes from sink agent of this node
00341    // If so we have to keep it in sink list 
00342 
00343    from_nodeID = (dfh->sender_id).addr_;
00344 
00345    if (THIS_NODE == from_nodeID) {       // From sink agent on the same node.
00346 
00347      // It's from a sink on this node.
00348      // Is it already in list ?
00349 
00350      RetVal = INTF_FIND(routing_table[dtype].sink, dfh->sender_id);
00351 
00352      if (RetVal.cur == NULL) {            
00353         // No, it's not.
00354         agentPtr = new Agent_List;
00355         AGT_ADDR(agentPtr) = dfh->sender_id;
00356         INTF_INSERT(routing_table[dtype].sink, agentPtr);
00357 
00358         God::instance()->AddSink(dtype, THIS_NODE);
00359      }  
00360    } else {                                    // From different node.
00361 
00362      // If we have gradient for the forwarder.
00363         
00364      RetVal = INTF_FIND(routing_table[dtype].active, dfh->forward_agent_id);
00365      if (RetVal.cur == NULL) {
00366        OutPtr = new Out_List;
00367        AGT_ADDR(OutPtr) = dfh->forward_agent_id;
00368        GRADIENT(OutPtr) = dfh->report_rate;
00369        GRAD_TMOUT(OutPtr) = dfh->ts_ + INTEREST_TIMEOUT;
00370        INTF_INSERT(routing_table[dtype].active, OutPtr);
00371        routing_table[dtype].num_active ++;        
00372      } else {
00373       GRAD_TMOUT(RetVal.cur) = max(GRAD_TMOUT(RetVal.cur),
00374                                    dfh->ts_ + INTEREST_TIMEOUT);
00375      }
00376 
00377    }
00378 
00379    if (NOW > routing_table[dtype].last_fwd_time + INTEREST_PERIODIC) {
00380      if (routing_table[dtype].ExistOriginalGradient() == true) {
00381        DataReqAll(dtype, ORIGINAL);
00382      } else {
00383        DataReqAll(dtype, SUB_SAMPLED);
00384      }
00385      routing_table[dtype].last_fwd_time = NOW;
00386      MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00387      MACsend(pkt, JITTER*Random::uniform(1.0));
00388      overhead++;
00389 
00390 #ifdef DEBUG_RATE
00391      hdr_cmn *cmh = HDR_CMN(pkt);
00392      printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00393             THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00394             (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00395 #endif
00396 
00397 
00398      return;
00399    }
00400 
00401    Packet::free(pkt);
00402    return;
00403 }

Here is the call graph for this function:

int NsObject::isdebug  )  const [inline, inherited]
 

Definition at line 61 of file object.h.

References NsObject::debug_.

00061 { return debug_; }

void Agent::listen  )  [virtual, inherited]
 

Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent.

Definition at line 381 of file agent.cc.

Referenced by Agent::command().

00382 {
00383 }

OldValue * Agent::lookupOldValue TracedVar *  v  )  [protected, inherited]
 

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 }

void DiffusionAgent::MACprepare Packet pkt,
nsaddr_t  next_hop,
int  type,
bool  lk_dtct
[protected, inherited]
 

Definition at line 378 of file diffusion.cc.

References ns_addr_t::addr_, hdr_cmn::addr_type(), hdr_cmn::direction(), hdr_cmn::DOWN, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_CMN, HDR_IP, Agent::here_, MAC_BROADCAST, hdr_cmn::next_hop(), hdr_cdiff::next_nodes, NS_AF_ILINK, nsaddr_t, hdr_cdiff::num_next, ns_addr_t::port_, ROUTING_PORT, hdr_ip::src_, hdr_cmn::xmit_failure_, hdr_cmn::xmit_failure_data_, and DiffusionAgent::XmitFailedCallback.

Referenced by BcastNeg(), DiffusionProb::ForwardData(), DiffusionProb::ForwardTxFailed(), FwdOriginal(), DiffusionProb::FwdPosReinf(), FwdSubsample(), DiffusionProb::GenPosReinf(), InterestHandle(), DiffusionProb::InterestPropagate(), PosReinf(), DiffusionProb::ReTxData(), DiffusionProb::SendInhibit(), DiffusionProb::SendNegReinf(), and UcastNeg().

00380 {
00381   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00382   hdr_cmn* cmh = HDR_CMN(pkt);
00383   hdr_ip*  iph = HDR_IP(pkt);
00384 
00385   dfh->forward_agent_id = here_; 
00386   if (type == (int) NS_AF_ILINK && next_hop == (nsaddr_t) MAC_BROADCAST) {
00387       cmh->xmit_failure_ = 0;
00388       cmh->next_hop() = MAC_BROADCAST;
00389       cmh->addr_type() = NS_AF_ILINK;
00390       cmh->direction() = hdr_cmn::DOWN;
00391 
00392       
00393       iph->src_ = here_;
00394       iph->dst_.addr_ = next_hop;
00395       iph->dst_.port_ = ROUTING_PORT;
00396 
00397       dfh->num_next = 1;
00398       dfh->next_nodes[0] = next_hop;
00399 
00400       return;     
00401   }  
00402 
00403   if (lk_dtct != 0) {
00404     cmh->xmit_failure_ = XmitFailedCallback;
00405     cmh->xmit_failure_data_ = (void *) this;
00406   }
00407   else {
00408     cmh->xmit_failure_ = 0;
00409   }
00410 
00411   cmh->direction() = hdr_cmn::DOWN;
00412 
00413   cmh->next_hop() = next_hop;
00414   cmh->addr_type() = type;  
00415 
00416   iph->src_ = here_;
00417   iph->dst_.addr_ = next_hop;
00418   iph->dst_.port_ = ROUTING_PORT;
00419   
00420   dfh->num_next = 1;
00421   dfh->next_nodes[0] = next_hop;
00422 }

Here is the call graph for this function:

void DiffusionAgent::MACsend Packet pkt,
Time  delay = 0
[protected, inherited]
 

Definition at line 425 of file diffusion.cc.

References DATA, God::data_pkt_size, HDR_CDIFF, HDR_CMN, Scheduler::instance(), God::instance(), hdr_cdiff::mess_type, hdr_cdiff::num_next, Scheduler::schedule(), and hdr_cmn::size().

Referenced by DiffusionAgent::ArpBufferCheck(), BcastNeg(), DiffusionProb::ForwardData(), DiffusionProb::ForwardTxFailed(), FwdOriginal(), DiffusionProb::FwdPosReinf(), FwdSubsample(), DiffusionProb::GenPosReinf(), InterestHandle(), DiffusionProb::InterestPropagate(), PosReinf(), DiffusionProb::ReTxData(), DiffusionAgent::SendBufferCheck(), DiffusionProb::SendInhibit(), DiffusionProb::SendNegReinf(), DiffusionAgent::StickPacketInArpBuffer(), DiffusionAgent::StickPacketInSendBuffer(), and UcastNeg().

00426 {
00427   hdr_cmn*  cmh = HDR_CMN(pkt);
00428   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00429 
00430   if (dfh->mess_type == DATA)
00431     cmh->size() = (God::instance()->data_pkt_size) + 4*(dfh->num_next - 1);
00432   else
00433     cmh->size() = 36 + 4*(dfh->num_next -1);
00434 
00435   Scheduler::instance().schedule(ll, pkt, delay);
00436 }

Here is the call graph for this function:

void Agent::monitorAgentTrace  )  [protected, inherited]
 

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:

void DiffusionRate::NegReinfTimeOut  )  [protected]
 

Definition at line 406 of file diff_rate.cc.

References Diff_Routing_Entry::ClrAllNewOrg(), Diff_Routing_Entry::ClrAllOldOrg(), GenNeg(), MAX_DATA_TYPE, NEG_CHECK, neg_reinf_timer, Diff_Routing_Entry::new_org_counter, TimerHandler::resched(), and DiffusionAgent::routing_table.

Referenced by NegativeReinforceTimer::expire().

00407 {
00408   for (int i=0; i<MAX_DATA_TYPE; i++) {
00409     GenNeg(i);
00410     routing_table[i].new_org_counter = 0;
00411     routing_table[i].ClrAllNewOrg();
00412     routing_table[i].ClrAllOldOrg();
00413   }
00414   
00415   neg_reinf_timer->resched(NEG_CHECK);
00416 }

Here is the call graph for this function:

nsaddr_t& Agent::port  )  [inline, inherited]
 

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().

00097 { return here_.port_; }

void DiffusionRate::PosReinf int  dtype,
nsaddr_t  to_node,
ns_addr_t  info_sender,
unsigned int  info_seq
[protected]
 

Definition at line 903 of file diff_rate.cc.

References ns_addr_t::addr_, HDR_CDIFF, HDR_CMN, hdr_cdiff::info, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::mess_type, MsgStr, hdr_cmn::next_hop(), NS_AF_INET, ORIGINAL, DiffusionAgent::overhead, hdr_cdiff::pk_num, ns_addr_t::port_, POS_REINFORCE, DiffusionAgent::prepare_message(), hdr_cdiff::report_rate, ROUTING_PORT, extra_info::sender, hdr_cdiff::sender_id, extra_info::seq, and THIS_NODE.

Referenced by ProcessPosReinf(), and TriggerPosReinf().

00905 {
00906   ns_addr_t to_agent_addr;
00907   to_agent_addr.addr_ = to_node;
00908   to_agent_addr.port_ = ROUTING_PORT;
00909 
00910   Packet *pkt=prepare_message(dtype, to_agent_addr, POS_REINFORCE);
00911   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00912 
00913       dfh->report_rate = ORIGINAL;
00914       dfh->info.sender = info_sender;
00915       dfh->info.seq = info_seq;
00916       
00917       MACprepare(pkt, to_node, NS_AF_INET, 1);
00918       MACsend(pkt, 0);
00919       overhead++;
00920 
00921 #ifdef DEBUG_RATE
00922       hdr_cmn *cmh = HDR_CMN(pkt);
00923       printf("DF node %d will send %s (%x, %x, %d) to %x\n",
00924              THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00925              (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00926 #endif
00927 
00928 }

Here is the call graph for this function:

Packet * DiffusionAgent::prepare_message unsigned int  dtype,
ns_addr_t  to_addr,
int  msg_type
[protected, inherited]
 

Definition at line 127 of file diffusion.cc.

References ns_addr_t::addr_, DiffusionAgent::create_packet(), hdr_cdiff::data_type, hdr_ip::dst_, hdr_cdiff::forward_agent_id, HDR_CDIFF, HDR_IP, Agent::here_, hdr_cdiff::mess_type, hdr_cdiff::next_nodes, NOW, hdr_cdiff::num_next, DiffusionAgent::pk_count, hdr_cdiff::pk_num, hdr_cdiff::sender_id, hdr_ip::src_, and hdr_cdiff::ts_.

Referenced by BcastNeg(), consider_new(), DataReqAll(), DiffusionProb::ForwardData(), DiffusionProb::GenPosReinf(), PosReinf(), DiffusionProb::ReTxData(), DiffusionProb::SendInhibit(), DiffusionProb::SendNegReinf(), and UcastNeg().

00129 {
00130   Packet *pkt;
00131   hdr_cdiff *dfh;
00132   hdr_ip *iph;
00133 
00134     pkt = create_packet();
00135     dfh = HDR_CDIFF(pkt);
00136     iph = HDR_IP(pkt);
00137     
00138     dfh->mess_type = msg_type;
00139     dfh->pk_num = pk_count;
00140     pk_count++;
00141     dfh->sender_id = here_;
00142     dfh->data_type = dtype;
00143     dfh->forward_agent_id = here_;
00144 
00145     dfh->ts_ = NOW;
00146     dfh->num_next = 1;
00147     dfh->next_nodes[0] = to_addr.addr_;
00148     
00149     iph->src_ = here_;
00150     iph->dst_ = to_addr;
00151 
00152     return pkt;
00153 }

Here is the call graph for this function:

void DiffusionRate::Print_IOlist  )  [protected, virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 952 of file diff_rate.cc.

References Diff_Routing_Entry::active, GRADIENT, IN_NEXT, NODE_ADDR, num_data_bcast_rcv, num_data_bcast_send, NUM_DATA_SEND, num_neg_bcast_rcv, num_neg_bcast_send, NUM_NEG_RECV, NUM_NEG_SEND, num_not_send_bcast_data, NUM_POS_RECV, NUM_POS_SEND, OUT_NEXT, DiffusionAgent::routing_table, THIS_NODE, TOTAL_NEW_ORG_RECV, TOTAL_NEW_SUB_RECV, and TOTAL_OLD_ORG_RECV.

00953 {
00954   Out_List *cur_out;
00955   In_List *cur_in;
00956   int     i;
00957 
00958   for (i=0; i<1; i++) {
00959     printf("Node %d DATA TYPE %d: send bcast data %d, not send  %d, rcv %d\n", 
00960            THIS_NODE, i, num_data_bcast_send, num_not_send_bcast_data,
00961            num_data_bcast_rcv);
00962     printf("Node %d neg bcast send %d, neg bcast rcv %d\n",
00963            THIS_NODE, num_neg_bcast_send, num_neg_bcast_rcv);
00964     for (cur_out = routing_table[i].active; cur_out != NULL; 
00965          cur_out = OUT_NEXT(cur_out) ) {
00966       printf("DF node %d has oif %d (%f,%d) send data %d recv neg %d pos %d\n", 
00967            THIS_NODE, NODE_ADDR(cur_out), GRADIENT(cur_out),
00968            routing_table[i].num_active, NUM_DATA_SEND(cur_out), 
00969            NUM_NEG_RECV(cur_out), NUM_POS_RECV(cur_out));
00970     }
00971 
00972     for (cur_in = routing_table[i].iif; cur_in != NULL;
00973          cur_in = IN_NEXT(cur_in) ) {
00974       printf("Diffusion node %d has iif for %d\n", 
00975              THIS_NODE, NODE_ADDR(cur_in));
00976       printf("Node %d recv new sub %d,new org %d,old org %d:send neg %d pos %d\n", 
00977              THIS_NODE, TOTAL_NEW_SUB_RECV(cur_in), TOTAL_NEW_ORG_RECV(cur_in),
00978              TOTAL_OLD_ORG_RECV(cur_in), NUM_NEG_SEND(cur_in), 
00979              NUM_POS_SEND(cur_in));
00980     }
00981 
00982   }
00983 }

void DiffusionRate::ProcessNegReinf Packet pkt  )  [protected]
 

Definition at line 741 of file diff_rate.cc.

References BcastNeg(), Diff_Routing_Entry::ClrAllNewOrg(), Diff_Routing_Entry::ClrAllOldOrg(), PrvCurPtr::cur, hdr_cdiff::data_type, DataReqAll(), Diff_Routing_Entry::ExistOriginalGradient(), hdr_cdiff::forward_agent_id, Packet::free(), GRADIENT, HDR_CDIFF, INTF_FIND, DiffusionAgent::NEG_REINF_, Diff_Routing_Entry::new_org_counter, DiffusionAgent::routing_table, Diff_Routing_Entry::sink, and SUB_SAMPLED.

Referenced by consider_new().

00742 {
00743   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00744   unsigned int dtype = dfh->data_type;
00745   Out_List *cur_out;
00746   PrvCurPtr RetVal;
00747 
00748   RetVal=INTF_FIND(routing_table[dtype].active, dfh->forward_agent_id);
00749 
00750   if (RetVal.cur == NULL) {
00751     Packet::free(pkt);
00752     return;
00753   }
00754 
00755   cur_out = (Out_List *)(RetVal.cur);
00756   if (GRADIENT(cur_out) == SUB_SAMPLED) {
00757       Packet::free(pkt);
00758       return;
00759   }
00760     
00761   GRADIENT(cur_out) = SUB_SAMPLED;
00762 
00763   if (routing_table[dtype].ExistOriginalGradient() == false && 
00764       routing_table[dtype].sink == NULL) {
00765 
00766     DataReqAll(dtype, SUB_SAMPLED);    
00767     
00768     if (NEG_REINF_ == true) {
00769       BcastNeg(dtype);
00770       routing_table[dtype].new_org_counter = 0;
00771       routing_table[dtype].ClrAllNewOrg();
00772       routing_table[dtype].ClrAllOldOrg();
00773     }
00774   }
00775 
00776   Packet::free(pkt);
00777 }

Here is the call graph for this function:

void DiffusionRate::ProcessPosReinf Packet pkt  )  [protected]
 

Definition at line 780 of file diff_rate.cc.

References ns_addr_t::addr_, AGT_ADDR, Diff_Routing_Entry::ClrNewSub(), Diff_Routing_Entry::CntPosSend(), PrvCurPtr::cur, hdr_cdiff::data_type, DataReqAll(), hdr_cdiff::forward_agent_id, Pkt_Hash_Entry::forwarder_id, Packet::free(), Pkt_Hash_Table::GetHash(), GRAD_TMOUT, GRADIENT, HDR_CDIFF, IN_NEXT, hdr_cdiff::info, INTEREST_TIMEOUT, INTF_FIND, INTF_INSERT, max, hdr_cdiff::mess_type, Diff_Routing_Entry::MostRecentIn(), MsgStr, NEW_SUB_RECV, NODE_ADDR, nsaddr_t, Diff_Routing_Entry::num_active, NUM_POS_RECV, ORIGINAL, DiffusionAgent::PktTable, POS_ALL, POS_HASH, POS_LAST, pos_type_, PosReinf(), hdr_cdiff::report_rate, DiffusionAgent::routing_table, extra_info::sender, extra_info::seq, THIS_NODE, and hdr_cdiff::ts_.

Referenced by consider_new().

00781 {
00782   hdr_cdiff *dfh= HDR_CDIFF(pkt);
00783   unsigned int dtype = dfh->data_type;
00784   Out_List *cur_out, *OutPtr;
00785   PrvCurPtr RetVal;
00786 
00787   RetVal=INTF_FIND(routing_table[dtype].active, dfh->forward_agent_id);
00788 
00789   if (RetVal.cur != NULL) {
00790     cur_out = (Out_List *)(RetVal.cur);
00791     GRADIENT(cur_out) = ORIGINAL;
00792     GRAD_TMOUT(RetVal.cur) = max(GRAD_TMOUT(RetVal.cur),
00793                                    dfh->ts_ + INTEREST_TIMEOUT);
00794     NUM_POS_RECV(cur_out)++;
00795   } else {
00796 
00797       OutPtr = new Out_List;
00798       AGT_ADDR(OutPtr) = dfh->forward_agent_id;
00799       GRADIENT(OutPtr) = dfh->report_rate;
00800       GRAD_TMOUT(OutPtr) = dfh->ts_ + INTEREST_TIMEOUT;
00801       INTF_INSERT(routing_table[dtype].active, OutPtr);
00802       routing_table[dtype].num_active ++;         
00803       NUM_POS_RECV(OutPtr)++;
00804   }
00805   
00806   DataReqAll(dtype, ORIGINAL);
00807 
00808 
00809   Pkt_Hash_Entry *hashPtr;
00810   nsaddr_t next_node;
00811   In_List *recent_in;
00812   In_List  *cur;
00813 
00814   switch(pos_type_) {
00815 
00816     case POS_HASH: 
00817       hashPtr=PktTable.GetHash(dfh->info.sender, dfh->info.seq);
00818       if (hashPtr == NULL) {
00819         perror("Hey! I've never seen that packet before.\n");
00820         Packet::free(pkt);
00821         exit(-1);
00822       }
00823 
00824       next_node = (hashPtr->forwarder_id).addr_;
00825       if (next_node == THIS_NODE) {
00826         Packet::free(pkt);
00827         return;
00828       }
00829 
00830       PosReinf(dtype, hashPtr->forwarder_id.addr_, dfh->info.sender,
00831                  dfh->info.seq);
00832       routing_table[dtype].CntPosSend(hashPtr->forwarder_id);
00833       routing_table[dtype].ClrNewSub(hashPtr->forwarder_id);
00834 
00835 #ifdef DEBUG_RATE
00836       printf("DF node %d will send %s to %x\n",
00837          THIS_NODE, MsgStr[dfh->mess_type], hashPtr->forwarder_id.addr_);
00838 #endif // DEBUG_RATE
00839 
00840       Packet::free(pkt);
00841       return;
00842 
00843 
00844   case POS_LAST:
00845     recent_in = routing_table[dtype].MostRecentIn();
00846     if (recent_in == NULL) {
00847       Packet::free(pkt);
00848       return;
00849     }
00850 
00851     next_node = NODE_ADDR(recent_in);
00852     if (next_node == THIS_NODE) {
00853       Packet::free(pkt);
00854       return;
00855     }
00856 
00857     PosReinf(dtype, NODE_ADDR(recent_in), dfh->info.sender, dfh->info.seq);
00858     routing_table[dtype].CntPosSend(AGT_ADDR(recent_in));
00859     routing_table[dtype].ClrNewSub(AGT_ADDR(recent_in));
00860 
00861 #ifdef DEBUG_RATE
00862     printf("DF node %d will send %s to %x\n",
00863          THIS_NODE, MsgStr[dfh->mess_type], NODE_ADDR(recent_in));
00864 #endif // DEBUG_RATE
00865 
00866     Packet::free(pkt);
00867     return;
00868 
00869 
00870   case POS_ALL:
00871     for (cur = routing_table[dtype].iif; cur!=NULL; cur = IN_NEXT(cur)) {
00872 
00873       if (NEW_SUB_RECV(cur) <= 0) {
00874         continue;
00875       }         
00876                
00877       next_node = NODE_ADDR(cur);
00878 
00879       if (next_node == THIS_NODE) {
00880         continue;
00881       }
00882 
00883       PosReinf(dtype, NODE_ADDR(cur), dfh->info.sender, dfh->info.seq);
00884       routing_table[dtype].CntPosSend(AGT_ADDR(cur));
00885       routing_table[dtype].ClrNewSub(AGT_ADDR(cur));
00886 
00887 #ifdef DEBUG_RATE
00888       printf("DF node %d will send %s to %x\n",
00889          THIS_NODE, MsgStr[dfh->mess_type], NODE_ADDR(cur));
00890 #endif // DEBUG_RATE
00891 
00892     }
00893     Packet::free(pkt);
00894     return;
00895 
00896   default: 
00897     Packet::free(pkt);
00898     return;
00899   }
00900 }

Here is the call graph for this function:

void NsObject::recv Packet p,
const char *  s
[virtual, inherited]
 

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:

void DiffusionRate::recv Packet ,
Handler
[virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 105 of file diff_rate.cc.

References hdr_cdiff::attr, consider_new(), consider_old(), DATA, DataTable, DUP_SUP_, Data_Hash_Table::GetHash(), Pkt_Hash_Table::GetHash(), HDR_CDIFF, hdr_cdiff::mess_type, MsgStr, hdr_cdiff::pk_num, DiffusionAgent::PktTable, Pkt_Hash_Table::put_in_hash(), Data_Hash_Table::PutInHash(), hdr_cdiff::sender_id, and THIS_NODE.

00106 {
00107   hdr_cdiff* dfh = HDR_CDIFF(packet);
00108 
00109   // Packet Hash Table is used to keep info about experienced pkts.
00110 
00111   Pkt_Hash_Entry *hashPtr= PktTable.GetHash(dfh->sender_id, dfh->pk_num);
00112 
00113 
00114 #ifdef DEBUG_RATE
00115      printf("DF node %x recv %s (%x, %x, %d)\n",
00116             THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00117             (dfh->sender_id).port_, dfh->pk_num);
00118 #endif
00119 
00120 
00121      // Received this packet before ?
00122 
00123      if (hashPtr != NULL) {
00124        consider_old(packet);
00125        return;
00126      }
00127 
00128      // Never receive it before ? Put in hash table.
00129 
00130      PktTable.put_in_hash(dfh);
00131 
00132      // Take action for a new pkt.
00133      // Check for dupplicate data at application
00134      
00135      if (DUP_SUP_ == true) {  
00136        
00137        if (dfh->mess_type == DATA) {
00138          if (DataTable.GetHash(dfh->attr) != NULL) {
00139            consider_old(packet);
00140            return;
00141          } else {
00142            DataTable.PutInHash(dfh->attr);
00143          }
00144          
00145        }
00146      } 
00147        
00148      consider_new(packet);     
00149 }

Here is the call graph for this function:

void Agent::recvBytes int  bytes  )  [protected, virtual, inherited]
 

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().

00355 {
00356         if (app_)
00357                 app_->recv(nbytes);     
00358 }

Here is the call graph for this function:

void Agent::recvOnly Packet  )  [inline, virtual, inherited]
 

Reimplemented from NsObject.

Definition at line 78 of file agent.h.

00078 {};

void DiffusionRate::reset  )  [protected, virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 945 of file diff_rate.cc.

References DataTable, Data_Hash_Table::reset(), and DiffusionAgent::reset().

00946 {
00947   DiffusionAgent::reset();
00948   DataTable.reset();
00949 }

Here is the call graph for this function:

virtual void Agent::send int  nbytes  )  [inline, virtual, inherited]
 

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:

virtual void Agent::send int  sz,
AppData data
[inline, virtual, inherited]
 

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:

void Agent::send Packet p,
Handler h
[inline, inherited]
 

Reimplemented from Connector.

Definition at line 80 of file agent.h.

References NsObject::recv(), and Connector::target_.

Referenced by TcpSink::ack(), QSTcpSink::ack(), SinkAgent::bcast_interest(), PingAgent::command(), MessageAgent::command(), mcastControlAgent::command(), LmsAgent::command(), LDPAgent::command(), SinkAgent::data_ready(), DSDV_Agent::forwardPacket(), FullTcpAgent::foutput(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), AbsTcpAgent::output(), AbsDelAckSink::recv(), AbsTcpSink::recv(), SRAgent::recv(), PingAgent::recv(), NatAgent::recv(), MIPBSAgent::recv(), Encapsulator::recv(), Decapsulator::recv(), MIPMHAgent::reg(), HttpInvalAgent::send(), GAFAgent::send_discovery(), RapAgent::SendAck(), SimpleTcpAgent::sendmsg(), PushbackAgent::sendMsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), TfrcSinkAgent::sendpkt(), SinkAgent::sendpkt(), IcmpAgent::sendredirect(), and AbsDelAckSink::timeout().

00080 { target_->recv(p, h); }

Here is the call graph for this function:

void DiffusionAgent::send_to_dmux Packet pkt,
Handler h
[inline, protected, inherited]
 

Definition at line 154 of file diffusion.h.

References DiffusionAgent::port_dmux, and NsObject::recv().

Referenced by consider_new(), DiffusionAgent::DataForSink(), and DataReqAll().

00154                                                     { 
00155     port_dmux->recv(pkt, h); 
00156   }

Here is the call graph for this function:

void DiffusionAgent::SendBufferCheck  )  [protected, inherited]
 

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:

void Agent::sendmsg int  nbytes,
const char *  flags = 0
[virtual, inherited]
 

Reimplemented in SA_Agent, RTPAgent, UdpAgent, LmsSender, SRMAgent, FullTcpAgent, TcpAgent, TfrcAgent, and SimpleTcpAgent.

Definition at line 415 of file agent.cc.

00416 {
00417 }

void Agent::sendmsg int  sz,
AppData ,
const char *  flags = 0
[virtual, inherited]
 

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:

virtual void Agent::sendto int  nbytes,
const char *  flags,
nsaddr_t  dst
[virtual, inherited]
 

void Agent::sendto int  sz,
AppData ,
const char *  flags,
nsaddr_t  dst
[virtual, inherited]
 

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:

void Agent::set_pkttype packet_t  pkttype  )  [inline, inherited]
 

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

virtual int& Agent::size  )  [inline, virtual, inherited]
 

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_; }

void DiffusionRate::Start  )  [protected, virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 931 of file diff_rate.cc.

References gradient_timer, GradientTimer, INTEREST_TIMEOUT, NEG_CHECK, DiffusionAgent::NEG_REINF_, neg_reinf_timer, NEG_TIMER, neg_win_type_, NegativeReinforceTimer, TimerHandler::resched(), and DiffusionAgent::Start().

00932 {
00933   DiffusionAgent::Start();
00934 
00935   gradient_timer = new GradientTimer(this);
00936   gradient_timer->resched(INTEREST_TIMEOUT);
00937 
00938   if ( neg_win_type_ == NEG_TIMER && NEG_REINF_ == true) {
00939     neg_reinf_timer = new NegativeReinforceTimer(this);
00940     neg_reinf_timer->resched(NEG_CHECK);
00941   }
00942 }

Here is the call graph for this function:

void DiffusionAgent::StickPacketInArpBuffer Packet pkt  )  [protected, inherited]
 

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:

void DiffusionAgent::StickPacketInSendBuffer Packet p  )  [protected, inherited]
 

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:

void DiffusionAgent::StopSource  )  [protected, inherited]
 

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 }

NsObject* Connector::target  )  [inline, inherited]
 

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_; }

void DiffusionAgent::Terminate  )  [protected, inherited]
 

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:

void Agent::timeout int  tno  )  [virtual, inherited]
 

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 }

void Agent::trace TracedVar *  v  )  [protected, virtual, inherited]
 

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:

void DiffusionAgent::trace char *  fmt,
... 
[protected, inherited]
 

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:

virtual void Agent::trace_event char *  eventtype  )  [inline, protected, virtual, inherited]
 

Reimplemented in TcpAgent.

Definition at line 146 of file agent.h.

00146 {}

void DiffusionRate::TriggerPosReinf Packet pkt,
ns_addr_t  forward_agent
[protected]
 

Definition at line 512 of file diff_rate.cc.

References ns_addr_t::addr_, Diff_Routing_Entry::ClrNewSub(), Diff_Routing_Entry::CntPosSend(), hdr_cdiff::data_type, DataReqAll(), END_POS, Diff_Routing_Entry::ExistOriginalGradient(), HDR_CDIFF, INTM_POS, nsaddr_t, ORIGINAL, hdr_cdiff::pk_num, pos_node_type_, PosReinf(), DiffusionAgent::routing_table, hdr_cdiff::sender_id, Diff_Routing_Entry::sink, and THIS_NODE.

Referenced by FwdData().

00513 {
00514   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00515   unsigned int dtype = dfh->data_type;
00516   nsaddr_t forwarder_node = forward_agent.addr_;
00517 
00518   if (pos_node_type_ == INTM_POS) {
00519     if (routing_table[dtype].sink != NULL ||
00520         routing_table[dtype].ExistOriginalGradient() == true) {
00521       DataReqAll(dtype, ORIGINAL);
00522       if (THIS_NODE != forwarder_node) {
00523        PosReinf(dtype, forwarder_node, dfh->sender_id,
00524                       dfh->pk_num);
00525        routing_table[dtype].CntPosSend(forward_agent);
00526        routing_table[dtype].ClrNewSub(forward_agent);
00527       } 
00528     }
00529     return;
00530   }
00531  
00532 
00533   if (pos_node_type_ == END_POS) {
00534     if (routing_table[dtype].sink != NULL) {
00535       DataReqAll(dtype, ORIGINAL);
00536       if (THIS_NODE != forwarder_node) {
00537        PosReinf(dtype, forwarder_node, dfh->sender_id,
00538                       dfh->pk_num);
00539        routing_table[dtype].CntPosSend(forward_agent);
00540        routing_table[dtype].ClrNewSub(forward_agent);
00541       } 
00542     }
00543 
00544     return;
00545   }
00546 }

Here is the call graph for this function:

void DiffusionRate::UcastNeg int  dtype,
ns_addr_t  to
[protected]
 

Definition at line 723 of file diff_rate.cc.

References ns_addr_t::addr_, HDR_CDIFF, HDR_CMN, DiffusionAgent::MACprepare(), DiffusionAgent::MACsend(), hdr_cdiff::mess_type, MsgStr, NEG_REINFORCE, hdr_cmn::next_hop(), NS_AF_INET, DiffusionAgent::overhead, hdr_cdiff::pk_num, DiffusionAgent::prepare_message(), hdr_cdiff::sender_id, and THIS_NODE.

Referenced by GenNeg().

00724 {
00725       Packet *pkt=prepare_message(dtype, to, NEG_REINFORCE);
00726       MACprepare(pkt, to.addr_, NS_AF_INET, 0);
00727       MACsend(pkt, 0);
00728       overhead++;
00729 
00730 #ifdef DEBUG_RATE
00731       hdr_cdiff *dfh = HDR_CDIFF(pkt);
00732       hdr_cmn *cmh = HDR_CMN(pkt);
00733       printf("DF node %d will send %s (%x, %x, %d) to %x\n",
00734              THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00735              (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00736 #endif
00737 
00738 }

Here is the call graph for this function:

void DiffusionAgent::xmitFailed Packet pkt  )  [protected, inherited]
 

Reimplemented in DiffusionProb.

Definition at line 446 of file diffusion.cc.

Referenced by DiffusionAgent::ArpBufferCheck(), and DiffusionAgent::StickPacketInArpBuffer().

00447 {
00448   // For future use, if needed.
00449 }


Friends And Related Function Documentation

friend class ArpBufferTimer [friend, inherited]
 

Definition at line 186 of file diffusion.h.

friend class GradientTimer [friend]
 

Definition at line 204 of file diff_rate.h.

Referenced by Start().

friend class NegativeReinforceTimer [friend]
 

Definition at line 205 of file diff_rate.h.

Referenced by Start().

friend class SendBufTimer [friend, inherited]
 

Definition at line 187 of file diffusion.h.

void XmitFailedCallback Packet pkt,
void *  data
[friend, inherited]
 

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 }


Member Data Documentation

Application* Agent::app_ [protected, inherited]
 

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().

ArpBufEntry DiffusionAgent::arp_buf[ARP_BUF_SIZE] [protected, inherited]
 

Definition at line 148 of file diffusion.h.

Referenced by DiffusionAgent::ArpBufferCheck(), DiffusionAgent::clear_arp_buf(), and DiffusionAgent::StickPacketInArpBuffer().

ArpBufferTimer DiffusionAgent::arp_buf_timer [protected, inherited]
 

Definition at line 147 of file diffusion.h.

Referenced by DiffusionAgent::Start().

ARPTable* DiffusionAgent::arp_table [protected, inherited]
 

Definition at line 145 of file diffusion.h.

Referenced by DiffusionAgent::ArpBufferCheck(), DiffusionAgent::command(), and DiffusionAgent::StickPacketInArpBuffer().

Tcl_Channel Agent::channel_ [protected, inherited]
 

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().

Data_Hash_Table DiffusionRate::DataTable [protected]
 

Definition at line 168 of file diff_rate.h.

Referenced by recv(), and reset().

int NsObject::debug_ [protected, inherited]
 

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().

int Agent::defttl_ [protected, inherited]
 

Definition at line 121 of file agent.h.

Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt().

NsObject* Connector::drop_ [protected, inherited]
 

Definition at line 57 of file connector.h.

Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv().

ns_addr_t Agent::dst_ [protected, inherited]
 

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().

bool DiffusionRate::DUP_SUP_ [protected]
 

Definition at line 158 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and recv().

EventTrace* Agent::et_ [protected, inherited]
 

Definition at line 145 of file agent.h.

Referenced by TcpAgent::command(), and TcpAgent::trace_event().

int Agent::fid_ [protected, inherited]
 

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().

int Agent::flags_ [protected, inherited]
 

Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent.

Definition at line 120 of file agent.h.

Referenced by Agent::delay_bind_dispatch().

GradientTimer* DiffusionRate::gradient_timer [protected]
 

Definition at line 170 of file diff_rate.h.

Referenced by GradientTimeOut(), and Start().

ns_addr_t Agent::here_ [protected, inherited]
 

Definition at line 114 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::addr(), SinkAgent::bcast_interest(), SinkAgent::data_ready(), OmniMcastAgent::DataForSink(), FloodingAgent::DataForSink(), DiffusionAgent::DataForSink(), Agent::delay_bind_dispatch(), Agent::deleteAgentTrace(), DiffusionProb::ForwardData(), DiffusionProb::ForwardTxFailed(), FwdOriginal(), DiffusionProb::FwdPosReinf(), FwdSubsample(), OmniMcastAgent::GodForwardData(), Agent::initpkt(), OmniMcastAgent::MACprepare(), FloodingAgent::MACprepare(), DiffusionAgent::MACprepare(), Agent::monitorAgentTrace(), Agent::port(), OmniMcastAgent::prepare_message(), FloodingAgent::prepare_message(), DiffusionAgent::prepare_message(), SSMSRMAgent::recv(), PingAgent::recv(), NatAgent::recv(), DumbAgent::recv(), SinkAgent::sendpkt(), SinkAgent::set_addr(), SinkAgent::Terminate(), and Agent::trace().

NsObject* DiffusionAgent::ll [protected, inherited]
 

Definition at line 143 of file diffusion.h.

neg_mxt DiffusionRate::neg_max_type_ [protected]
 

Definition at line 166 of file diff_rate.h.

Referenced by CheckNegCounter(), command(), and DiffusionRate().

bool DiffusionAgent::NEG_REINF_ [protected, inherited]
 

Definition at line 134 of file diffusion.h.

Referenced by CheckNegCounter(), DiffusionAgent::command(), consider_new(), DiffusionProb::consider_new(), DiffusionAgent::DiffusionAgent(), EnergyTimer::expire(), FwdData(), ProcessNegReinf(), and Start().

NegativeReinforceTimer* DiffusionRate::neg_reinf_timer [protected]
 

Definition at line 171 of file diff_rate.h.

Referenced by NegReinfTimeOut(), and Start().

neg_tht DiffusionRate::neg_thr_type_ [protected]
 

Definition at line 165 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and GenNeg().

neg_wint DiffusionRate::neg_win_type_ [protected]
 

Definition at line 164 of file diff_rate.h.

Referenced by command(), consider_new(), DiffusionRate(), and Start().

Node* DiffusionAgent::node [protected, inherited]
 

Definition at line 141 of file diffusion.h.

Referenced by DiffusionAgent::command(), DiffusionAgent::DiffusionAgent(), DiffusionProb::Start(), and DiffusionAgent::Terminate().

int DiffusionRate::num_data_bcast_rcv [protected]
 

Definition at line 175 of file diff_rate.h.

Referenced by consider_new(), consider_old(), DiffusionRate(), and Print_IOlist().

int DiffusionRate::num_data_bcast_send [protected]
 

Definition at line 174 of file diff_rate.h.

Referenced by DiffusionRate(), FwdSubsample(), and Print_IOlist().

int DiffusionRate::num_neg_bcast_rcv [protected]
 

Definition at line 177 of file diff_rate.h.

Referenced by consider_new(), consider_old(), DiffusionRate(), and Print_IOlist().

int DiffusionRate::num_neg_bcast_send [protected]
 

Definition at line 176 of file diff_rate.h.

Referenced by BcastNeg(), DiffusionRate(), and Print_IOlist().

int DiffusionRate::num_not_send_bcast_data [protected]
 

Definition at line 173 of file diff_rate.h.

Referenced by DiffusionRate(), FwdSubsample(), and Print_IOlist().

OldValue* Agent::oldValueList_ [protected, inherited]
 

Definition at line 132 of file agent.h.

Referenced by Agent::insertOldValue(), Agent::lookupOldValue(), and Agent::~Agent().

org_t DiffusionRate::org_type_ [protected]
 

Definition at line 161 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and FwdOriginal().

int DiffusionAgent::overhead [protected, inherited]
 

Definition at line 137 of file diffusion.h.

Referenced by BcastNeg(), DiffusionAgent::DiffusionAgent(), DiffusionProb::ForwardTxFailed(), DiffusionProb::FwdPosReinf(), DiffusionProb::GenPosReinf(), InterestHandle(), DiffusionProb::InterestPropagate(), PosReinf(), DiffusionProb::SendInhibit(), DiffusionProb::SendNegReinf(), DiffusionAgent::Terminate(), and UcastNeg().

int DiffusionAgent::pk_count [protected, inherited]
 

Definition at line 136 of file diffusion.h.

Referenced by DiffusionAgent::DiffusionAgent(), and DiffusionAgent::prepare_message().

Pkt_Hash_Table DiffusionAgent::PktTable [protected, inherited]
 

Definition at line 139 of file diffusion.h.

Referenced by DiffusionProb::consider_new(), DiffusionProb::consider_old(), DiffusionProb::ForwardTxFailed(), ProcessPosReinf(), DiffusionAgent::recv(), recv(), DiffusionProb::recv(), DiffusionAgent::reset(), and DiffusionProb::ReTxData().

NsObject* DiffusionAgent::port_dmux [protected, inherited]
 

Definition at line 144 of file diffusion.h.

Referenced by DiffusionAgent::command(), and DiffusionAgent::send_to_dmux().

pos_ndt DiffusionRate::pos_node_type_ [protected]
 

Definition at line 163 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and TriggerPosReinf().

bool DiffusionAgent::POS_REINF_ [protected, inherited]
 

Definition at line 133 of file diffusion.h.

Referenced by DiffusionAgent::command(), consider_new(), DiffusionProb::consider_new(), and DiffusionAgent::DiffusionAgent().

pos_t DiffusionRate::pos_type_ [protected]
 

Definition at line 162 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and ProcessPosReinf().

int Agent::prio_ [protected, inherited]
 

Definition at line 119 of file agent.h.

Referenced by Agent::delay_bind_dispatch(), and Agent::initpkt().

Diff_Routing_Entry DiffusionAgent::routing_table[MAX_DATA_TYPE] [inherited]
 

Definition at line 126 of file diffusion.h.

Referenced by DiffusionProb::add_outlist(), DiffusionProb::CalGradient(), CheckNegCounter(), consider_new(), DiffusionProb::consider_new(), consider_old(), DiffusionProb::CreateIOList(), DiffusionProb::data_request_all(), DiffusionAgent::DataForSink(), DataReqAll(), DiffusionProb::DecGradient(), DiffusionProb::ForwardData(), FwdData(), FwdOriginal(), DiffusionProb::FwdPosReinf(), FwdSubsample(), GenNeg(), DiffusionProb::GenPosReinf(), GradientTimeOut(), DiffusionProb::IncGradient(), InterestHandle(), DiffusionProb::InterestPropagate(), DiffusionProb::InterfaceDown(), NegReinfTimeOut(), Print_IOlist(), DiffusionProb::Print_IOlist(), ProcessNegReinf(), ProcessPosReinf(), DiffusionAgent::reset(), DiffusionProb::ReTxData(), DiffusionAgent::SendBufferCheck(), DiffusionAgent::StickPacketInSendBuffer(), DiffusionAgent::StopSource(), TriggerPosReinf(), and DiffusionProb::UpdateIOList().

SendBufferEntry DiffusionAgent::send_buf[SEND_BUF_SIZE] [protected, inherited]
 

Definition at line 150 of file diffusion.h.

Referenced by DiffusionAgent::clear_send_buf(), DiffusionAgent::SendBufferCheck(), and DiffusionAgent::StickPacketInSendBuffer().

SendBufTimer DiffusionAgent::send_buf_timer [protected, inherited]
 

Definition at line 149 of file diffusion.h.

Referenced by DiffusionAgent::Start().

int Agent::size_ [protected, inherited]
 

Reimplemented in SA_Agent, and AckRecons.

Definition at line 116 of file agent.h.

Referenced by AbsDelAckSink::AbsDelAckSink(), AbsTcpAgent::AbsTcpAgent(), AbsTcpRenoAckAgent::AbsTcpRenoAckAgent(), AbsTcpRenoDelAckAgent::AbsTcpRenoDelAckAgent(), AbsTcpSink::AbsTcpSink(), AbsTcpTahoeAckAgent::AbsTcpTahoeAckAgent(), AbsTcpTahoeDelAckAgent::AbsTcpTahoeDelAckAgent(), RTCPAgent::command(), LDPAgent::command(), SinkAgent::command(), IntTcpAgent::createTcpSession(), TfrcAgent::decrease_rate(), TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), FullTcpAgent::foutput(), DSRAgent::getRouteForPacket(), TfrcAgent::increase_rate(), TcpAgent::initial_window(), Agent::initpkt(), RapAgent::IpgTimeout(), IvsReceiver::IvsReceiver(), LmsAgent::LmsAgent(), LmsReceiver::LmsReceiver(), mcastControlAgent::mcastControlAgent(), MessageAgent::MessageAgent(), MIPBSAgent::MIPBSAgent(), MIPMHAgent::MIPMHAgent(), TfrcAgent::nextpkt(), IntTcpAgent::opencwnd(), PingAgent::PingAgent(), RapAgent::RapAgent(), TfrcAgent::recv(), TcpSessionAgent::recv(), NewRenoTcpAgent::recv(), TfrcAgent::reduce_rate_on_no_feedback(), RLM_Sender::RLM_Sender(), RTCPAgent::RTCPAgent(), RTPAgent::RTPAgent(), IntTcpAgent::rxmit_last(), LmsSender::send_lms_pkt(), TcpSessionAgent::send_much(), LmsReceiver::send_nak(), IntTcpAgent::send_one(), LmsReceiver::send_refresh(), UdpAgent::sendmsg(), TfrcAgent::sendmsg(), TcpAgent::sendmsg(), SRMAgent::sendmsg(), RTPAgent::sendmsg(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), rtProtoDV::sendpkt(), SinkAgent::sendpkt(), SinkAgent::SinkAgent(), Agent::size(), TfrcAgent::slowstart(), TfrcAgent::start(), TfrcAgent::TfrcAgent(), TfrcSinkAgent::TfrcSinkAgent(), RTPAgent::timeout(), RTCPAgent::timeout(), and UdpAgent::UdpAgent().

sub_t DiffusionRate::sub_type_ [protected]
 

Definition at line 160 of file diff_rate.h.

Referenced by command(), DiffusionRate(), and FwdSubsample().

NsObject* Connector::target_ [protected, inherited]
 

Definition at line 56 of file connector.h.

Referenced by SRAgent::command(), SA_Agent::command(), IvsReceiver::command(), MultiFieldFilter::command(), Filter::command(), Connector::command(), DiffusionAgent::DiffusionAgent(), DSRAgent::DSRAgent(), PromotionTimer::expire(), FloodingAgent::FloodingAgent(), toraAgent::forward(), AODV::forward(), LandmarkAgent::ForwardPacket(), DSDV_Agent::forwardPacket(), SensorQueryAgent::generate_query(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSRAgent::handlePacketReceipt(), DSDV_Agent::helper_callback(), AODV::initialized(), DSDV_Agent::lost_link(), OmniMcastAgent::OmniMcastAgent(), LandmarkAgent::periodic_callback(), LandmarkAgent::ProcessHierUpdate(), TCPTapAgent::processpkt(), IPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), CMUPriQueue::prq_resume(), DequeTrace::recv(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), TBF::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), SatDequeTrace::recv(), SAack_Agent::recv(), Queue< T >::recv(), PingResponder::recv(), MIPEncapsulator::recv(), LmsAgent::recv(), HackLossyLink::recv(), GAFPartner::recv(), FQ::recv(), FloodAgent::recv(), ErrorModel::recv(), DynamicLink::recv(), DumbAgent::recv(), DSRAgent::recv(), DelayModel::recv(), LinkDelay::recv(), CtrMcastDecap::recv(), CtrMcastEncap::recv(), CMUTrace::recv(), PriQueue::recvHighPriority(), Trace::recvOnly(), TapAgent::recvpkt(), Queue< T >::resume(), LinkDelay::send(), Connector::send(), Agent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), MFTPSndAgent::send_data(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), SSMSRMAgent::send_glb_sess(), LmsSender::send_lms_pkt(), SSMSRMAgent::send_loc_sess(), MFTPRcvAgent::send_nak(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), SSMSRMAgent::send_rep_sess(), SRMAgent::send_sess(), MIPMHAgent::send_sols(), LmsSender::send_spm(), MFTPSndAgent::send_status_request(), LmsAgent::send_upstream(), LandmarkAgent::SendChangedTagListUpdate(), AODV::sendError(), AODV::sendHello(), UdpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), LmsSender::sendmsg(), DSDV_Agent::sendOutBCastPkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), IvsSource::sendpkt(), AODV::sendReply(), AODV::sendRequest(), LmsSender::solicit_naks(), Connector::target(), TBF::timeout(), and toraAgent::tora_output().

char* Agent::traceName_ [protected, inherited]
 

Definition at line 131 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::command(), Agent::deleteAgentTrace(), Agent::flushAVar(), Agent::monitorAgentTrace(), and Agent::trace().

Trace* DiffusionAgent::tracetarget [protected, inherited]
 

Definition at line 142 of file diffusion.h.

Referenced by DiffusionAgent::command(), DiffusionAgent::DiffusionAgent(), and DiffusionAgent::trace().

packet_t Agent::type_ [protected, inherited]
 

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().

int Agent::uidcnt_ [static, protected, inherited]
 

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().


The documentation for this class was generated from the following files:
Generated on Tue Apr 20 12:39:05 2004 for NS2.26SourcesOriginal by doxygen 1.3.3