DiffusionRate Class Reference

#include <diff_rate.h>

Inheritance diagram for DiffusionRate:

DiffusionAgent Agent Connector NsObject TclObject Handler Collaboration diagram for DiffusionRate:

Collaboration graph
[legend]

Detailed Description

Definition at line 171 of file diff_rate.h.

Public Member Functions

nsaddr_taddr ()
virtual void attachApp (Application *app)
virtual void close ()
int command (int argc, const char *const *argv)
virtual void connect (nsaddr_t dst)
nsaddr_tdaddr ()
virtual void debug (const char *fmt,...)
 DiffusionRate ()
nsaddr_tdport ()
virtual void drop (Packet *p)
packet_t get_pkttype ()
int isdebug () const
virtual void listen ()
nsaddr_tport ()
virtual void recv (Packet *p, const char *s)
void recv (Packet *, Handler *)
void recvOnly (Packet *)
virtual void send (int nbytes)
virtual void send (int sz, AppData *data)
void send (Packet *p, Handler *h)
virtual void sendmsg (int nbytes, const char *flags=0)
virtual void sendmsg (int sz, AppData *, const char *flags=0)
virtual void sendto (int nbytes, const char *flags, ns_addr_t dst)
virtual void sendto (int nbytes, const char *flags, nsaddr_t dst)
virtual void sendto (int sz, AppData *, const char *flags, ns_addr_t dst)
virtual void sendto (int sz, AppData *, const char *flags, nsaddr_t dst)
void set_pkttype (packet_t pkttype)
void setDropTarget (NsObject *dt)
virtual int & size ()
void target (NsObject *target)
NsObjecttarget ()
virtual void timeout (int tno)

Data Fields

Diff_Routing_Entry routing_table [MAX_DATA_TYPE]

Protected Member Functions

void addAgentTrace (const char *name)
Packetallocpkt (int) const
Packetallocpkt () const
void ArpBufferCheck ()
void BcastNeg (int dtype)
void CheckNegCounter (int dtype)
void clear_arp_buf ()
void clear_send_buf ()
void consider_new (Packet *)
void consider_old (Packet *)
Packetcreate_packet ()
void DataForSink (Packet *)
void DataReqAll (unsigned int dtype, int report_rate)
virtual int delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer)
virtual void delay_bind_init_all ()
void deleteAgentTrace ()
virtual void drop (Packet *p, const char *s)
void dumpTracedVars ()
void FwdData (Packet *)
void FwdOriginal (Packet *pkt)
bool FwdSubsample (Packet *pkt)
void GenNeg (int dtype)
void GradientTimeOut ()
void handle (Event *)
virtual void idle ()
void initpkt (Packet *) const
void insertOldValue (TracedVar *v, const char *value)
void InterestHandle (Packet *pkt)
OldValuelookupOldValue (TracedVar *v)
void MACprepare (Packet *pkt, nsaddr_t next_hop, int type, bool lk_dtct)
void MACsend (Packet *pkt, Time delay=0)
void monitorAgentTrace ()
void NegReinfTimeOut ()
void PosReinf (int dtype, nsaddr_t to_node, ns_addr_t info_sender, unsigned int info_seq)
Packetprepare_message (unsigned int dtype, ns_addr_t to_addr, int msg_type)
void Print_IOlist ()
void ProcessNegReinf (Packet *pkt)
void ProcessPosReinf (Packet *pkt)
virtual void recvBytes (int bytes)
void reset ()
void send_to_dmux (Packet *pkt, Handler *h)
void SendBufferCheck ()
void Start ()
void StickPacketInArpBuffer (Packet *pkt)
void StickPacketInSendBuffer (Packet *p)
void StopSource ()
void Terminate ()
virtual void trace (TracedVar *v)
void trace (char *fmt,...)
virtual void trace_event (char *eventtype)
void TriggerPosReinf (Packet *pkt, ns_addr_t forward_agent)
void UcastNeg (int dtype, ns_addr_t to)
void xmitFailed (Packet *pkt)

Protected Attributes

Applicationapp_
ArpBufEntry arp_buf [ARP_BUF_SIZE]
ArpBufferTimer arp_buf_timer
ARPTablearp_table
Tcl_Channel channel_
Data_Hash_Table DataTable
int debug_
int defttl_
NsObjectdrop_
ns_addr_t dst_
bool DUP_SUP_
EventTraceet_
int fid_
int flags_
GradientTimergradient_timer
ns_addr_t here_
NsObjectll
neg_mxt neg_max_type_
bool NEG_REINF_
NegativeReinforceTimerneg_reinf_timer
neg_tht neg_thr_type_
neg_wint neg_win_type_
Nodenode
int num_data_bcast_rcv
int num_data_bcast_send
int num_neg_bcast_rcv
int num_neg_bcast_send
int num_not_send_bcast_data
OldValueoldValueList_
org_t org_type_
int overhead
int pk_count
Pkt_Hash_Table PktTable
NsObjectport_dmux
pos_ndt pos_node_type_
bool POS_REINF_
pos_t pos_type_
int prio_
SendBufferEntry send_buf [SEND_BUF_SIZE]
SendBufTimer send_buf_timer
int size_
sub_t sub_type_
NsObjecttarget_
char * traceName_
Tracetracetarget
packet_t type_

Static Protected Attributes

static int uidcnt_

Friends

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


Constructor & Destructor Documentation

DiffusionRate::DiffusionRate  ) 
 

Definition at line 106 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.

00106                              : DiffusionAgent()
00107 {
00108   DUP_SUP_ = true;
00109 
00110   sub_type_ = BCAST_SUB;
00111   org_type_ = UNICAST_ORG;
00112   pos_type_ = POS_ALL;
00113   pos_node_type_ = INTM_POS;
00114   neg_win_type_ = NEG_TIMER;
00115   neg_thr_type_ = NEG_ABSOLUTE;
00116   neg_max_type_ = NEG_FIXED_MAX;
00117 
00118   num_not_send_bcast_data = 0;
00119   num_data_bcast_send = 0;
00120   num_data_bcast_rcv = 0;
00121   num_neg_bcast_send = 0;
00122   num_neg_bcast_rcv = 0;
00123 }


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 99 of file agent.h.

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

Referenced by LandmarkAgent::assign_lmaddress(), WormApp::command(), SSMSRMAgent::command(), IntTcpAgent::createTcpSession(), DiffusionProb::DecGradient(), Agent::flushAVar(), SctpAgent::ForceSource(), LmsSender::handle_lms_pkt(), DiffusionProb::IncGradient(), SSMSRMAgent::is_active(), QSAgent::process(), TPAgent::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), QSAgent::recv(), MIPBSAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), SSMSRMAgent::recv_glb_sess(), SSMSRMAgent::recv_loc_sess(), SSMSRMAgent::recv_rep_sess(), SRMAgent::recv_sess(), 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(), SctpAgent::SetSource(), LmsSender::solicit_naks(), SRMAgent::start(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), SctpAgent::TraceAll(), MultipleFastRtxSctpAgent::TraceAll(), MfrTimestampSctpAgent::TraceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), and MfrTimestampSctpAgent::TraceVar().

00099 { return here_.addr_; }

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

Definition at line 528 of file agent.cc.

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

00529 {
00530         Packet* p = allocpkt();
00531 
00532     if (n > 0)
00533             p->allocdata(n);
00534 
00535     return(p);
00536 }

Here is the call graph for this function:

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

Definition at line 517 of file agent.cc.

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

Referenced by XcpSink::ack(), TcpSink::ack(), QSTcpSink::ack(), SctpAgent::AddDestination(), 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(), XcpAgent::output(), TcpAgent::output(), VegasTcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), AbsTcpAgent::output(), TCPTapAgent::processpkt(), AbsTcpSink::recv(), SAack_Agent::recv(), PingAgent::recv(), Encapsulator::recv(), MIPMHAgent::reg(), DSRAgent::returnSrcRouteToRequestor(), HttpInvalAgent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), GAFAgent::send_discovery(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), 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(), RapAgent::SendAck(), UdpAgent::sendmsg(), SimpleTcpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), PushbackAgent::sendMsg(), MessagePassingAgent::sendmsg(), LmsSender::sendmsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), SctpAgent::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(), TPAgent::sendto(), MessagePassingAgent::sendto(), LmsSender::solicit_naks(), and AbsDelAckSink::timeout().

00518 {
00519     Packet* p = Packet::alloc();
00520     initpkt(p);
00521     return (p);
00522 }

Here is the call graph for this function:

void DiffusionAgent::ArpBufferCheck  )  [protected, inherited]
 

Definition at line 517 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().

00518 {
00519   int c;
00520   ARPEntry *llinfo;
00521   hdr_cmn*  cmh;
00522 
00523   for (c = 0; c < ARP_BUF_SIZE; c++) {
00524     if (arp_buf[c].p == NULL)
00525       continue;
00526     
00527     cmh = HDR_CMN(arp_buf[c].p);
00528     llinfo= arp_table->arplookup(cmh->next_hop());
00529     if (llinfo != 0) {
00530       MACsend(arp_buf[c].p, 0);
00531       arp_buf[c].p = NULL;
00532       continue;}
00533     
00534     if (arp_buf[c].attempt > ARP_MAX_ATTEMPT) {
00535       // printf("ARP fails. Too many attempts.\n");
00536       xmitFailed(arp_buf[c].p);
00537       arp_buf[c].p = NULL;
00538       continue;
00539     }
00540 
00541     arp_table->arprequest(THIS_NODE, cmh->next_hop(), (LL *)ll);
00542     arp_buf[c].attempt ++;
00543   }
00544 }

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 WormApp::command(), HttpMInvalCache::command(), Application::command(), TcpApp::TcpApp(), and TcpApp::~TcpApp().

00373 {
00374     app_ = app;
00375 }

void DiffusionRate::BcastNeg int  dtype  )  [protected]
 

Definition at line 720 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().

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

Here is the call graph for this function:

void DiffusionRate::CheckNegCounter int  dtype  )  [protected]
 

Definition at line 318 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, PER_IIF, and DiffusionAgent::routing_table.

Referenced by consider_new().

00319 {
00320   if (neg_max_type_ == NEG_FIXED_MAX) {
00321       if (routing_table[dtype].new_org_counter >= MAX_NEG_COUNTER
00322           && NEG_REINF_ == true) {
00323         GenNeg(dtype);
00324         routing_table[dtype].new_org_counter = 0;
00325         routing_table[dtype].ClrAllNewOrg();
00326         routing_table[dtype].ClrAllOldOrg();
00327       }
00328       return;
00329   }
00330 
00331   if (neg_max_type_ == NEG_SCALE_MAX) {
00332       if (routing_table[dtype].new_org_counter >= 
00333           PER_IIF * routing_table[dtype].num_iif
00334           && NEG_REINF_ == true) {
00335         GenNeg(dtype);
00336         routing_table[dtype].new_org_counter = 0;
00337         routing_table[dtype].ClrAllNewOrg();
00338         routing_table[dtype].ClrAllOldOrg();
00339       }
00340       return;
00341   }
00342 }

Here is the call graph for this function:

void DiffusionAgent::clear_arp_buf  )  [protected, inherited]
 

Definition at line 648 of file diffusion.cc.

References DiffusionAgent::arp_buf, ARP_BUF_SIZE, ArpBufEntry::attempt, Packet::free(), and ArpBufEntry::p.

00649 {
00650   for (int i=0; i<ARP_BUF_SIZE; i++) {
00651     arp_buf[i].t = 0;
00652     arp_buf[i].attempt = 0;
00653     if (arp_buf[i].p != NULL) 
00654       Packet::free(arp_buf[i].p);
00655     arp_buf[i].p = NULL;
00656   }
00657 }

Here is the call graph for this function:

void DiffusionAgent::clear_send_buf  )  [protected, inherited]
 

Definition at line 659 of file diffusion.cc.

References Packet::free(), SendBufferEntry::p, DiffusionAgent::send_buf, and SEND_BUF_SIZE.

00660 {
00661   for (int i=0; i<SEND_BUF_SIZE; i++) {
00662     send_buf[i].t = 0;
00663     if (send_buf[i].p != NULL)
00664       Packet::free(send_buf[i].p);
00665     send_buf[i].p = NULL;
00666   }
00667 }

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 1007 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_.

01008 {
01009   if (argc == 2) {
01010     if (strcasecmp(argv[1], "enable-suppression") == 0) {
01011       DUP_SUP_ = true;
01012       return TCL_OK;
01013     }
01014 
01015     if (strcasecmp(argv[1], "disable-suppression") == 0) {
01016       DUP_SUP_ = false;
01017       return TCL_OK;
01018     }
01019 
01020   }
01021 
01022   else if (argc == 3) {
01023     
01024     if (strcasecmp(argv[1], "set-sub-tx-type") == 0 ) {
01025       sub_type_ = ParseSubType(argv[2]);
01026       return TCL_OK;
01027     }
01028 
01029     if (strcasecmp(argv[1], "set-org-tx-type") == 0 ) {
01030       org_type_ = ParseOrgType(argv[2]);
01031       return TCL_OK;
01032     }
01033 
01034     if (strcasecmp(argv[1], "set-pos-type") == 0 ) {
01035       pos_type_ = ParsePosType(argv[2]);
01036       return TCL_OK;
01037     }
01038 
01039     if (strcasecmp(argv[1], "set-pos-node-type") == 0 ) {
01040       pos_node_type_ = ParsePosNodeType(argv[2]);
01041       return TCL_OK;
01042     }
01043 
01044     if (strcasecmp(argv[1], "set-neg-win-type") == 0 ) {
01045       neg_win_type_ = ParseNegWinType(argv[2]);
01046       return TCL_OK;
01047     }
01048 
01049     if (strcasecmp(argv[1], "set-neg-thr-type") == 0 ) {
01050       neg_thr_type_ = ParseNegThrType(argv[2]);
01051       return TCL_OK;
01052     }
01053     
01054     if (strcasecmp(argv[1], "set-neg-max-type") == 0 ) {
01055       neg_max_type_ = ParseNegMaxType(argv[2]);
01056       return TCL_OK;
01057     }
01058   }
01059 
01060 
01061   return DiffusionAgent::command(argc, argv);
01062 }

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 210 of file diff_rate.cc.

References 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_, 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::source, and SUB_SAMPLED.

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

Here is the call graph for this function:

void DiffusionRate::consider_old Packet  )  [protected]
 

Reimplemented from DiffusionAgent.

Definition at line 173 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_, num_data_bcast_rcv, num_neg_bcast_rcv, ORIGINAL, hdr_cdiff::report_rate, and DiffusionAgent::routing_table.

Referenced by recv().

00174 {
00175   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00176   hdr_cmn* cmh = HDR_CMN(pkt);
00177   unsigned char msg_type = dfh->mess_type;
00178   unsigned int dtype = dfh->data_type;
00179 
00180   switch (msg_type) {
00181     case INTEREST :
00182       InterestHandle(pkt);
00183       return;
00184 
00185     case DATA: 
00186 
00187       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00188     num_data_bcast_rcv++;
00189       }
00190 
00191       if (dfh->report_rate == ORIGINAL) {
00192       routing_table[dtype].CntOldOrg(dfh->forward_agent_id);
00193       }
00194       Packet::free(pkt);
00195       return;
00196     
00197     case NEG_REINFORCE:
00198       if (cmh->next_hop_ == (nsaddr_t)MAC_BROADCAST) {
00199     num_neg_bcast_rcv++;
00200       }
00201       break;
00202       
00203     default : 
00204       Packet::free(pkt);        
00205       break;
00206   }
00207 }

Here is the call graph for this function:

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

Definition at line 386 of file diffusion.cc.

References Agent::allocpkt(), HDR_CDIFF, HDR_CMN, NOW, hdr_cmn::size(), and hdr_cdiff::ts_.

Referenced by DiffusionAgent::prepare_message().

00387 {
00388   Packet *pkt = allocpkt();
00389 
00390   if (pkt==NULL) return NULL;
00391 
00392   hdr_cmn*  cmh = HDR_CMN(pkt);
00393   cmh->size() = 36;
00394 
00395   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00396   dfh->ts_ = NOW;
00397   return pkt;
00398 }

Here is the call graph for this function:

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

Definition at line 101 of file agent.h.

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

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

00101 { return dst_.addr_; }

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

Definition at line 121 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().

00122 {
00123   hdr_cdiff     *dfh  = HDR_CDIFF(pkt);
00124   unsigned int dtype = dfh->data_type;
00125   Agent_List   *cur_agent;
00126   Packet       *cur_pkt;
00127   hdr_cdiff     *cur_dfh;
00128   hdr_ip       *cur_iph;
00129 
00130 
00131   // Give it to sink agents on this node. Don't care if wireless.
00132 
00133   for (cur_agent= (routing_table[dtype]).sink; cur_agent != NULL; 
00134        cur_agent= AGENT_NEXT(cur_agent) ) {
00135 
00136       cur_pkt       = pkt->copy();
00137       cur_iph       = HDR_IP(cur_pkt);
00138       cur_iph->dst_ = AGT_ADDR(cur_agent);
00139 
00140       cur_dfh       = HDR_CDIFF(cur_pkt);
00141       cur_dfh->forward_agent_id = here_;
00142       cur_dfh->num_next = 1;
00143       cur_dfh->next_nodes[0] = NODE_ADDR(cur_agent);
00144 
00145       send_to_dmux(cur_pkt, 0);
00146   }
00147 }

Here is the call graph for this function:

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

Definition at line 675 of file diff_rate.cc.

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

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

00676 {
00677   Agent_List *cur_agent;
00678   Packet *pkt;
00679   hdr_cdiff *dfh;
00680 
00681   for (cur_agent=routing_table[dtype].source; cur_agent != NULL; 
00682        cur_agent = AGENT_NEXT(cur_agent) ) {
00683     pkt = prepare_message(dtype, AGT_ADDR(cur_agent), DATA_REQUEST);
00684     dfh = HDR_CDIFF(pkt);
00685     dfh->report_rate = report_rate;
00686     send_to_dmux(pkt, 0);
00687   }
00688 }

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, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink.

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 XcpSink::delay_bind_dispatch(), TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), SctpAgent::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, HbAfterRtoSctpAgent, MfrHbAfterRtoSctpAgent, MfrTimestampSctpAgent, MultipleFastRtxSctpAgent, NewRenoSctpAgent, TimestampSctpAgent, SctpAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, VegasTcpAgent, XcpAgent, and XcpSink.

Definition at line 78 of file agent.cc.

References NsObject::delay_bind_init_all().

Referenced by XcpSink::delay_bind_init_all(), TcpAgent::delay_bind_init_all(), TcpSink::delay_bind_init_all(), SctpAgent::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 102 of file agent.h.

References Agent::dst_, and ns_addr_t::port_.

Referenced by SctpAgent::AddDestination(), DSDV_Agent::lost_link(), CtrMcastEncap::recv(), AODV::recvAODV(), toraAgent::recvTORA(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), rtProtoDV::sendpkt(), SctpAgent::SetDestination(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), and MfrTimestampSctpAgent::TraceVar().

00102 { 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]
 

Reimplemented in XCPQueue.

Definition at line 106 of file connector.cc.

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

Referenced by ARPTable::arpresolve(), XCPQueue::drop(), 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(), DSDV_Agent::forwardPacket(), DSRAgent::getRouteForPacket(), HDLC::goBackNMode(), Snoop::handle(), DSRAgent::handleFlowForwarding(), DSRAgent::handleForwarding(), HDLC::handleRR(), DSDV_Agent::lost_link(), TCPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), rtqueue::purge(), SessionTTLChecker::recv(), TTLChecker::recv(), FullTcpAgent::recv(), BayFullTcpAgent::recv(), SatLL::recv(), LL::recv(), GAFPartner::recv(), Filter::recv(), DynamicLink::recv(), AODV::recvError(), PriQueue::recvHighPriority(), HDLC::recvIncoming(), toraAgent::reset(), HDLC::reset(), Queue< T >::reset(), LinkDelay::reset(), AODV::rt_ll_failed(), AODV::rt_purge(), toraAgent::rtRoutePacket(), HDLC::selectiveRepeatMode(), AODV::sendRequest(), SatLL::sendUp(), LL::sendUp(), DropTail::shrink_queue(), 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 630 of file diff_rate.cc.

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

Referenced by consider_new().

00631 {
00632   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00633   unsigned int dtype = dfh->data_type;
00634   nsaddr_t forwarder_node;
00635   ns_addr_t forward_agent;
00636   bool forward_flag;
00637 
00638   forwarder_node = (dfh->forward_agent_id).addr_;
00639   forward_agent = dfh->forward_agent_id;
00640 
00641   if (dfh->report_rate == SUB_SAMPLED) {
00642     forward_flag = FwdSubsample(pkt);
00643     TriggerPosReinf(pkt, forward_agent);
00644 
00645     if (forward_flag == false) {
00646       Packet::free(pkt);
00647     }
00648     return;
00649   } 
00650 
00651   // Then, report rate is ORIGINAL here.
00652 
00653   if (routing_table[dtype].ExistOriginalGradient() == false
00654       && routing_table[dtype].sink == NULL) {
00655     
00656     if (THIS_NODE != forwarder_node && NEG_REINF_ == true) {
00657       BcastNeg(dtype);
00658       routing_table[dtype].new_org_counter = 0;
00659       routing_table[dtype].ClrAllNewOrg();
00660       routing_table[dtype].ClrAllOldOrg();
00661    }
00662     Packet::free(pkt);
00663     return;
00664   }
00665 
00666   if (routing_table[dtype].ExistOriginalGradient() == false) {
00667     Packet::free(pkt);
00668     return;
00669   }
00670 
00671   FwdOriginal(pkt);
00672 }

Here is the call graph for this function:

void DiffusionRate::FwdOriginal Packet pkt  )  [protected]
 

Definition at line 570 of file diff_rate.cc.

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

00571 {
00572   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00573   unsigned int dtype = dfh->data_type;
00574   Out_List *cur_out;
00575   Packet   *cur_pkt;
00576   hdr_cdiff *cur_dfh;
00577   hdr_ip   *cur_iph;
00578  
00579   if (org_type_ == BCAST_ORG) {
00580     MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00581     MACsend(pkt, JITTER*Random::uniform(1.0));
00582 
00583 #ifdef DEBUG_RATE 
00584     hdr_cmn *cmh = HDR_CMN(pkt);
00585     printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00586        THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00587        (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00588 #endif  // DEBUG_RATE
00589 
00590     return;
00591   }
00592 
00593   if (org_type_ == UNICAST_ORG) {
00594     for (cur_out = routing_table[dtype].active; cur_out!= NULL; 
00595        cur_out = OUT_NEXT(cur_out)) {
00596       if (GRADIENT(cur_out) == ORIGINAL) {
00597 
00598     cur_pkt       = pkt->copy();
00599     cur_iph       = HDR_IP(cur_pkt);
00600     cur_iph->dst_ = AGT_ADDR(cur_out);
00601 
00602     cur_dfh       = HDR_CDIFF(cur_pkt);
00603     cur_dfh->forward_agent_id = here_;
00604     cur_dfh->num_next = 1;
00605     cur_dfh->next_nodes[0] = NODE_ADDR(cur_out);
00606 
00607     cur_out->num_data_send++;
00608 
00609     MACprepare(cur_pkt, NODE_ADDR(cur_out), NS_AF_INET, 
00610          MAC_RETRY_);
00611     MACsend(cur_pkt, 0);      
00612  
00613 #ifdef DEBUG_RATE
00614     cur_cmh = HDR_CMN(cur_pkt);
00615     printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00616          THIS_NODE, MsgStr[cur_dfh->mess_type], 
00617          (cur_dfh->sender_id).addr_, (cur_dfh->sender_id).port_, 
00618          cur_dfh->pk_num, cur_cmh->next_hop());
00619 #endif // DEBUG_RATE
00620 
00621       } // endif
00622     }   // endfor
00623 
00624     Packet::free(pkt);
00625     return; 
00626   }    // endif unicast original
00627 }

Here is the call graph for this function:

bool DiffusionRate::FwdSubsample Packet pkt  )  [protected]
 

Definition at line 467 of file diff_rate.cc.

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

00468 {
00469   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00470   Out_List *cur_out;
00471   Packet   *cur_pkt;
00472   hdr_cdiff *cur_dfh;
00473   hdr_ip   *cur_iph;
00474   unsigned int dtype = dfh->data_type;
00475 
00476     if (routing_table[dtype].num_active <= 0) {   // Won't forward
00477       num_not_send_bcast_data++;
00478       return false;
00479     } 
00480 
00481     // Will forward
00482       
00483     num_data_bcast_send++;
00484 
00485     if (sub_type_ == BCAST_SUB) {
00486     MACprepare(pkt, MAC_BROADCAST, NS_AF_ILINK, 0);
00487     MACsend(pkt, JITTER*Random::uniform(1.0));
00488 
00489 #ifdef DEBUG_RATE 
00490     hdr_cmn *cmh = HDR_CMN(pkt);
00491     printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00492        THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00493        (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00494 #endif // DEBUG_RATE
00495 
00496     return true;
00497     }
00498 
00499     if (sub_type_ == UNICAST_SUB) {
00500     for (cur_out = routing_table[dtype].active; cur_out!= NULL; 
00501        cur_out = OUT_NEXT(cur_out)) {
00502 
00503       cur_pkt       = pkt->copy();
00504       cur_iph       = HDR_IP(cur_pkt);
00505       cur_iph->dst_ = AGT_ADDR(cur_out);
00506 
00507       cur_dfh       = HDR_CDIFF(cur_pkt);
00508       cur_dfh->forward_agent_id = here_;
00509       cur_dfh->num_next = 1;
00510       cur_dfh->next_nodes[0] = NODE_ADDR(cur_out);
00511 
00512       MACprepare(cur_pkt, NODE_ADDR(cur_out), NS_AF_INET, 
00513          MAC_RETRY_);
00514       MACsend(cur_pkt, 0);      
00515 
00516 #ifdef DEBUG_RATE
00517       cur_cmh = HDR_CMN(cur_pkt);
00518       printf("DF node %x will send %s (%x, %x, %d) to %x\n",
00519          THIS_NODE, MsgStr[cur_dfh->mess_type], 
00520          (cur_dfh->sender_id).addr_, (cur_dfh->sender_id).port_, 
00521          cur_dfh->pk_num, cur_cmh->next_hop());
00522 #endif // DEBUG_RATE
00523 
00524     } // endfor
00525     
00526     return true;
00527     }   // endif unicast sub
00528 
00529     return false;
00530 }

Here is the call graph for this function:

void DiffusionRate::GenNeg int  dtype  )  [protected]
 

Definition at line 691 of file diff_rate.cc.

References AGT_ADDR, IN_NEXT, MAX_DUP_DATA, NEG_ABSOLUTE, neg_thr_type_, NEW_ORG_RECV, OLD_ORG_RECV, DiffusionAgent::routing_table, and UcastNeg().

Referenced by CheckNegCounter(), and NegReinfTimeOut().

00692 {
00693   In_List *cur;
00694 
00695   if (neg_thr_type_ == NEG_ABSOLUTE) {
00696     for (cur= routing_table[dtype].iif; cur != NULL; cur= IN_NEXT(cur)) {
00697       if (NEW_ORG_RECV(cur) <= 0 && OLD_ORG_RECV(cur) > MAX_DUP_DATA) {
00698     UcastNeg(dtype, AGT_ADDR(cur));
00699     cur->num_neg_send++;
00700       }
00701     }
00702     return;
00703   }
00704 
00705   if (neg_thr_type_ == NEG_RELATIVE) {
00706     int most= routing_table[dtype].MostRecvOrg();
00707 
00708     for (cur= routing_table[dtype].iif; cur != NULL; cur= IN_NEXT(cur)) {
00709       if (OLD_ORG_RECV(cur) > MAX_DUP_DATA &&
00710       NEW_ORG_RECV(cur) <= NEG_MIN_RATIO*most) {
00711     UcastNeg(dtype, AGT_ADDR(cur));
00712     cur->num_neg_send++;
00713       }
00714     }
00715     return;
00716   }
00717 }

Here is the call graph for this function:

packet_t Agent::get_pkttype  )  [inline, inherited]
 

Definition at line 104 of file agent.h.

References Agent::type_.

00104 { return type_; }

void DiffusionRate::GradientTimeOut  )  [protected]
 

Definition at line 440 of file diff_rate.cc.

References GRAD_TMOUT, INTF_REMOVE, MAX_DATA_TYPE, NOW, Diff_Routing_Entry::num_active, and DiffusionAgent::routing_table.

Referenced by GradientTimer::expire().

00441 {
00442   int i;
00443   Agent_List *cur_out, **prv_out;
00444  
00445   for (i=0; i<MAX_DATA_TYPE; i++) {
00446     for (cur_out = routing_table[i].active, 
00447      prv_out = (Agent_List **)&routing_table[i].active; 
00448      cur_out != NULL; ) {
00449       
00450       if (NOW > GRAD_TMOUT(cur_out)) {
00451     INTF_REMOVE(prv_out, cur_out);
00452     routing_table[i].num_active -- ;
00453     cur_out = *prv_out;
00454       }
00455       else {
00456     prv_out = &(cur_out->next);
00457     cur_out = cur_out->next;
00458       }
00459       
00460     }
00461   }
00462   
00463   gradient_timer->resched(INTEREST_TIMEOUT);
00464 }

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(), XcpAgent::output(), TcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), UdpAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), TPAgent::sendto(), and MessagePassingAgent::sendto().

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 456 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(), hdr_flags::qs_, NixVec::Reset(), hdr_ip::saddr(), hdr_cmn::size(), Agent::size_, hdr_ip::sport(), hdr_cmn::timestamp(), hdr_ip::ttl(), Agent::type_, hdr_cmn::uid(), Agent::uidcnt_, UNKN_IFACE, and iface_literal::value().

Referenced by Agent::allocpkt(), and PingResponder::recv().

00457 {
00458     hdr_cmn* ch = hdr_cmn::access(p);
00459     ch->uid() = uidcnt_++;
00460     ch->ptype() = type_;
00461     ch->size() = size_;
00462     ch->timestamp() = Scheduler::instance().clock();
00463     ch->iface() = UNKN_IFACE.value(); // from packet.h (agent is local)
00464     ch->direction() = hdr_cmn::NONE;
00465 
00466     ch->error() = 0;    /* pkt not corrupt to start with */
00467 
00468     hdr_ip* iph = hdr_ip::access(p);
00469     iph->saddr() = here_.addr_;
00470     iph->sport() = here_.port_;
00471     iph->daddr() = dst_.addr_;
00472     iph->dport() = dst_.port_;
00473     
00474     //DEBUG
00475     //if (dst_ != -1)
00476     //  printf("pl break\n");
00477     
00478     iph->flowid() = fid_;
00479     iph->prio() = prio_;
00480     iph->ttl() = defttl_;
00481 
00482     hdr_flags* hf = hdr_flags::access(p);
00483     hf->ecn_capable_ = 0;
00484     hf->ecn_ = 0;
00485     hf->eln_ = 0;
00486     hf->ecn_to_echo_ = 0;
00487     hf->fs_ = 0;
00488     hf->no_ts_ = 0;
00489     hf->pri_ = 0;
00490     hf->cong_action_ = 0;
00491     hf->qs_ = 0;
00492 #ifdef HAVE_STL
00493 
00494     hdr_nv* nv = hdr_nv::access(p);
00495     if (0)
00496         printf("Off hdr_nv %d, ip_hdr %d myaddr %d\n",
00497                hdr_nv::offset(), hdr_ip::offset(), here_.addr_);
00498     NixNode* pNixNode = NixNode::GetNodeObject(here_.addr_);
00499     if (0)
00500         printf("Node Object %p\n", pNixNode);
00501     if (pNixNode) { 
00502         // If we get non-null, indicates nixvector routing in use
00503         // Delete any left over nv in the packet
00504         // Get a nixvector to the target (may create new)
00505         NixVec* pNv = pNixNode->GetNixVector(dst_.addr_);
00506         pNv->Reset();
00507         nv->nv() = pNv; // And set the nixvec in the packet
00508         nv->h_used = 0; // And reset used portion to 0
00509     }
00510 #endif //HAVE_STL
00511 }

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

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

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

00403 {
00404   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00405   hdr_cmn* cmh = HDR_CMN(pkt);
00406   hdr_ip*  iph = HDR_IP(pkt);
00407 
00408   dfh->forward_agent_id = here_; 
00409   if (type == (int) NS_AF_ILINK && next_hop == (nsaddr_t) MAC_BROADCAST) {
00410       cmh->xmit_failure_ = 0;
00411       cmh->next_hop() = MAC_BROADCAST;
00412       cmh->addr_type() = NS_AF_ILINK;
00413       cmh->direction() = hdr_cmn::DOWN;
00414 
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 
00423       return;     
00424   }  
00425 
00426   if (lk_dtct != 0) {
00427     cmh->xmit_failure_ = XmitFailedCallback;
00428     cmh->xmit_failure_data_ = (void *) this;
00429   }
00430   else {
00431     cmh->xmit_failure_ = 0;
00432   }
00433 
00434   cmh->direction() = hdr_cmn::DOWN;
00435 
00436   cmh->next_hop() = next_hop;
00437   cmh->addr_type() = type;  
00438 
00439   iph->src_ = here_;
00440   iph->dst_.addr_ = next_hop;
00441   iph->dst_.port_ = ROUTING_PORT;
00442   
00443   dfh->num_next = 1;
00444   dfh->next_nodes[0] = next_hop;
00445 }

Here is the call graph for this function:

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

Definition at line 448 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(), and UcastNeg().

00449 {
00450   hdr_cmn*  cmh = HDR_CMN(pkt);
00451   hdr_cdiff* dfh = HDR_CDIFF(pkt);
00452 
00453   if (dfh->mess_type == DATA)
00454     cmh->size() = (God::instance()->data_pkt_size) + 4*(dfh->num_next - 1);
00455   else
00456     cmh->size() = 36 + 4*(dfh->num_next -1);
00457 
00458   Scheduler::instance().schedule(ll, pkt, delay);
00459 }

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 427 of file diff_rate.cc.

References Diff_Routing_Entry::ClrAllNewOrg(), Diff_Routing_Entry::ClrAllOldOrg(), GenNeg(), MAX_DATA_TYPE, Diff_Routing_Entry::new_org_counter, and DiffusionAgent::routing_table.

Referenced by NegativeReinforceTimer::expire().

00428 {
00429   for (int i=0; i<MAX_DATA_TYPE; i++) {
00430     GenNeg(i);
00431     routing_table[i].new_org_counter = 0;
00432     routing_table[i].ClrAllNewOrg();
00433     routing_table[i].ClrAllOldOrg();
00434   }
00435   
00436   neg_reinf_timer->resched(NEG_CHECK);
00437 }

Here is the call graph for this function:

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

Definition at line 100 of file agent.h.

References Agent::here_, and ns_addr_t::port_.

Referenced by SctpAgent::ForceSource(), LmsAgent::pkt2agent(), MIPBSAgent::recv(), HttpInvalAgent::recv(), CtrMcastEncap::recv(), IntTcpAgent::rxmit_last(), IntTcpAgent::send_one(), LmsReceiver::send_refresh(), IcmpAgent::sendredirect(), SctpAgent::SetSource(), TcpAgent::trace_event(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), SctpAgent::TraceAll(), MultipleFastRtxSctpAgent::TraceAll(), MfrTimestampSctpAgent::TraceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), and MfrTimestampSctpAgent::TraceVar().

00100 { 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 924 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().

00926 {
00927   ns_addr_t to_agent_addr;
00928   to_agent_addr.addr_ = to_node;
00929   to_agent_addr.port_ = ROUTING_PORT;
00930 
00931   Packet *pkt=prepare_message(dtype, to_agent_addr, POS_REINFORCE);
00932   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00933 
00934       dfh->report_rate = ORIGINAL;
00935       dfh->info.sender = info_sender;
00936       dfh->info.seq = info_seq;
00937       
00938       MACprepare(pkt, to_node, NS_AF_INET, 1);
00939       MACsend(pkt, 0);
00940       overhead++;
00941 
00942 #ifdef DEBUG_RATE
00943       hdr_cmn *cmh = HDR_CMN(pkt);
00944       printf("DF node %d will send %s (%x, %x, %d) to %x\n",
00945          THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_,
00946          (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00947 #endif
00948 
00949 }

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 150 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::GenPosReinf(), PosReinf(), DiffusionProb::ReTxData(), DiffusionProb::SendInhibit(), DiffusionProb::SendNegReinf(), and UcastNeg().

00152 {
00153   Packet *pkt;
00154   hdr_cdiff *dfh;
00155   hdr_ip *iph;
00156 
00157     pkt = create_packet();
00158     dfh = HDR_CDIFF(pkt);
00159     iph = HDR_IP(pkt);
00160     
00161     dfh->mess_type = msg_type;
00162     dfh->pk_num = pk_count;
00163     pk_count++;
00164     dfh->sender_id = here_;
00165     dfh->data_type = dtype;
00166     dfh->forward_agent_id = here_;
00167 
00168     dfh->ts_ = NOW;
00169     dfh->num_next = 1;
00170     dfh->next_nodes[0] = to_addr.addr_;
00171     
00172     iph->src_ = here_;
00173     iph->dst_ = to_addr;
00174 
00175     return pkt;
00176 }

Here is the call graph for this function:

void DiffusionRate::Print_IOlist  )  [protected, virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 973 of file diff_rate.cc.

References GRADIENT, 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_not_send_bcast_data, NUM_POS_RECV, OUT_NEXT, DiffusionAgent::routing_table, and THIS_NODE.

00974 {
00975   Out_List *cur_out;
00976   In_List *cur_in;
00977   int     i;
00978 
00979   for (i=0; i<1; i++) {
00980     printf("Node %d DATA TYPE %d: send bcast data %d, not send  %d, rcv %d\n", 
00981        THIS_NODE, i, num_data_bcast_send, num_not_send_bcast_data,
00982        num_data_bcast_rcv);
00983     printf("Node %d neg bcast send %d, neg bcast rcv %d\n",
00984        THIS_NODE, num_neg_bcast_send, num_neg_bcast_rcv);
00985     for (cur_out = routing_table[i].active; cur_out != NULL; 
00986      cur_out = OUT_NEXT(cur_out) ) {
00987       printf("DF node %d has oif %d (%f,%d) send data %d recv neg %d pos %d\n", 
00988            THIS_NODE, NODE_ADDR(cur_out), GRADIENT(cur_out),
00989            routing_table[i].num_active, NUM_DATA_SEND(cur_out), 
00990        NUM_NEG_RECV(cur_out), NUM_POS_RECV(cur_out));
00991     }
00992 
00993     for (cur_in = routing_table[i].iif; cur_in != NULL;
00994      cur_in = IN_NEXT(cur_in) ) {
00995       printf("Diffusion node %d has iif for %d\n", 
00996          THIS_NODE, NODE_ADDR(cur_in));
00997       printf("Node %d recv new sub %d,new org %d,old org %d:send neg %d pos %d\n", 
00998          THIS_NODE, TOTAL_NEW_SUB_RECV(cur_in), TOTAL_NEW_ORG_RECV(cur_in),
00999          TOTAL_OLD_ORG_RECV(cur_in), NUM_NEG_SEND(cur_in), 
01000          NUM_POS_SEND(cur_in));
01001     }
01002 
01003   }
01004 }

void DiffusionRate::ProcessNegReinf Packet pkt  )  [protected]
 

Definition at line 762 of file diff_rate.cc.

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

Referenced by consider_new().

00763 {
00764   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00765   unsigned int dtype = dfh->data_type;
00766   Out_List *cur_out;
00767   PrvCurPtr RetVal;
00768 
00769   RetVal=INTF_FIND(routing_table[dtype].active, dfh->forward_agent_id);
00770 
00771   if (RetVal.cur == NULL) {
00772     Packet::free(pkt);
00773     return;
00774   }
00775 
00776   cur_out = (Out_List *)(RetVal.cur);
00777   if (GRADIENT(cur_out) == SUB_SAMPLED) {
00778       Packet::free(pkt);
00779       return;
00780   }
00781     
00782   GRADIENT(cur_out) = SUB_SAMPLED;
00783 
00784   if (routing_table[dtype].ExistOriginalGradient() == false && 
00785       routing_table[dtype].sink == NULL) {
00786 
00787     DataReqAll(dtype, SUB_SAMPLED);    
00788     
00789     if (NEG_REINF_ == true) {
00790       BcastNeg(dtype);
00791       routing_table[dtype].new_org_counter = 0;
00792       routing_table[dtype].ClrAllNewOrg();
00793       routing_table[dtype].ClrAllOldOrg();
00794     }
00795   }
00796 
00797   Packet::free(pkt);
00798 }

Here is the call graph for this function:

void DiffusionRate::ProcessPosReinf Packet pkt  )  [protected]
 

Definition at line 801 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, 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().

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

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 126 of file diff_rate.cc.

References hdr_cdiff::attr, 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.

00127 {
00128   hdr_cdiff* dfh = HDR_CDIFF(packet);
00129 
00130   // Packet Hash Table is used to keep info about experienced pkts.
00131 
00132   Pkt_Hash_Entry *hashPtr= PktTable.GetHash(dfh->sender_id, dfh->pk_num);
00133 
00134 
00135 #ifdef DEBUG_RATE
00136      printf("DF node %x recv %s (%x, %x, %d)\n",
00137         THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00138         (dfh->sender_id).port_, dfh->pk_num);
00139 #endif
00140 
00141 
00142      // Received this packet before ?
00143 
00144      if (hashPtr != NULL) {
00145        consider_old(packet);
00146        return;
00147      }
00148 
00149      // Never receive it before ? Put in hash table.
00150 
00151      PktTable.put_in_hash(dfh);
00152 
00153      // Take action for a new pkt.
00154      // Check for dupplicate data at application
00155      
00156      if (DUP_SUP_ == true) {  
00157        
00158        if (dfh->mess_type == DATA) {
00159      if (DataTable.GetHash(dfh->attr) != NULL) {
00160        consider_old(packet);
00161        return;
00162      } else {
00163        DataTable.PutInHash(dfh->attr);
00164      }
00165      
00166        }
00167      } 
00168        
00169      consider_new(packet);     
00170 }

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 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 966 of file diff_rate.cc.

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

00967 {
00968   DiffusionAgent::reset();
00969   DataTable.reset();
00970 }

Here is the call graph for this function:

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

Reimplemented in SRMAgent.

Definition at line 91 of file agent.h.

References Agent::sendmsg().

00091 { 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 XcpSink::ack(), SinkAgent::bcast_interest(), PingAgent::command(), MessageAgent::command(), mcastControlAgent::command(), LmsAgent::command(), LDPAgent::command(), SinkAgent::data_ready(), DSDV_Agent::forwardPacket(), FullTcpAgent::foutput(), XcpAgent::output(), TcpAgent::output(), RFC793eduTcpAgent::output(), QSNewRenoTcpAgent::output(), IntTcpAgent::output(), BayFullTcpAgent::output(), AbsTcpAgent::output(), AbsTcpSink::recv(), SRAgent::recv(), PingAgent::recv(), NatAgent::recv(), MIPBSAgent::recv(), Encapsulator::recv(), Decapsulator::recv(), MIPMHAgent::reg(), SctpAgent::RouteCalcDelayTimerExpiration(), HttpInvalAgent::send(), GAFAgent::send_discovery(), RapAgent::SendAck(), SimpleTcpAgent::sendmsg(), PushbackAgent::sendMsg(), FullTcpAgent::sendpacket(), BayFullTcpAgent::sendpacket(), SctpAgent::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 175 of file diffusion.h.

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

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

00175                                                     { 
00176     port_dmux->recv(pkt, h); 
00177   }

Here is the call graph for this function:

void DiffusionAgent::SendBufferCheck  )  [protected, inherited]
 

Definition at line 586 of file diffusion.cc.

References 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, and SEND_TIMEOUT.

Referenced by SendBufTimer::expire().

00587 {
00588   int c;
00589   hdr_cdiff *dfh;
00590   hdr_cmn  *cmh;
00591   hdr_ip   *iph;
00592   int dtype;
00593   PrvCurPtr RetVal;
00594 
00595   for (c = 0; c < SEND_BUF_SIZE; c++) {
00596     if (send_buf[c].p == NULL)
00597       continue;
00598     
00599     dfh = HDR_CDIFF(send_buf[c].p);
00600     cmh = HDR_CMN(send_buf[c].p);
00601     iph = HDR_IP(send_buf[c].p);
00602     dtype = dfh->data_type;
00603 
00604     RetVal = INTF_FIND(routing_table[dtype].active, iph->dst_);
00605 
00606     if (RetVal.cur != NULL) {
00607       MACsend(send_buf[c].p, 0);
00608       send_buf[c].p = NULL;
00609       continue;
00610     }
00611     
00612     if (Scheduler::instance().clock() - send_buf[c].t > SEND_TIMEOUT) {
00613       Packet::free(send_buf[c].p);
00614       send_buf[c].p = NULL;
00615       continue;
00616     }
00617 
00618   }
00619 }

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, MessagePassingAgent, LmsSender, SRMAgent, SctpAgent, FullTcpAgent, TcpAgent, TfrcAgent, and SimpleTcpAgent.

Definition at line 407 of file agent.cc.

00408 {
00409 }

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

Reimplemented in UdpAgent, and MessagePassingAgent.

Definition at line 400 of file agent.cc.

References abort().

Referenced by Agent::command(), Application::send(), Agent::send(), TrafficTrace::timeout(), TelnetApp::timeout(), SctpApp1::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,
ns_addr_t  dst
[virtual, inherited]
 

Reimplemented in MessagePassingAgent.

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

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

Reimplemented in MessagePassingAgent.

Definition at line 420 of file agent.cc.

00422 {
00423 }

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

Definition at line 411 of file agent.cc.

References abort().

Referenced by Agent::command(), AnWormApp::probe(), and DnhWormApp::send_probe().

00413 {
00414     fprintf(stderr, 
00415     "Agent::sendmsg(int, AppData*, const char*) not implemented\n");
00416     abort();
00417 }

Here is the call graph for this function:

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

Definition at line 103 of file agent.h.

References Agent::type_.

Referenced by Agent::command(), RA_Traffic::init(), POO_Traffic::init(), EXPOO_Traffic::init(), and CBR_PP_Traffic::init().

00103 { type_ = pkttype; }

void Connector::setDropTarget NsObject dt  )  [inline, inherited]
 

Definition at line 51 of file connector.h.

References Connector::drop_.

Referenced by XCPWrapQ::command().

00051 {drop_ = dt; } 

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

Reimplemented in FullTcpAgent.

Definition at line 98 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(), TelnetApp::timeout(), and SctpApp1::timeout().

00098 { return size_; }

void DiffusionRate::Start  )  [protected, virtual]
 

Reimplemented from DiffusionAgent.

Definition at line 952 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().

00953 {
00954   DiffusionAgent::Start();
00955 
00956   gradient_timer = new GradientTimer(this);
00957   gradient_timer->resched(INTEREST_TIMEOUT);
00958 
00959   if ( neg_win_type_ == NEG_TIMER && NEG_REINF_ == true) {
00960     neg_reinf_timer = new NegativeReinforceTimer(this);
00961     neg_reinf_timer->resched(NEG_CHECK);
00962   }
00963 }

Here is the call graph for this function:

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

Definition at line 475 of file diffusion.cc.

References DiffusionAgent::arp_buf, ARP_BUF_SIZE, ArpBufEntry::attempt, min, NOW, and ArpBufEntry::p.

00476 {
00477   Time min = DBL_MAX;
00478   int  min_index = 0;
00479   int  c;
00480 
00481   for (c=0; c < ARP_BUF_SIZE; c++) {
00482     if (arp_buf[c].p == NULL) {
00483       arp_buf[c].t = NOW;
00484       arp_buf[c].attempt = 1;
00485       arp_buf[c].p = pkt;
00486       return;
00487     }
00488     else if (arp_buf[c].t < min) {
00489       min = arp_buf[c].t;
00490       min_index = c;
00491     }
00492   }
00493 
00494   // Before killing somebody, let him get a last chance to send.
00495 
00496   ARPEntry *llinfo;
00497   hdr_cmn*  cmh = HDR_CMN(arp_buf[min_index].p);
00498 
00499   llinfo= arp_table->arplookup(cmh->next_hop());
00500 
00501   if (llinfo == 0) {
00502     // printf("ARP fails. And must give up slot.\n");
00503       xmitFailed(arp_buf[min_index].p);
00504   }
00505   else
00506       MACsend(arp_buf[min_index].p, 0);
00507 
00508 
00509   // The new packet is taking over the slot of the dead guy.
00510 
00511   arp_buf[min_index].t = NOW;
00512   arp_buf[min_index].attempt = 1;
00513   arp_buf[min_index].p = pkt;
00514 }

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

Definition at line 547 of file diffusion.cc.

References min, NOW, SendBufferEntry::p, DiffusionAgent::send_buf, and SEND_BUF_SIZE.

00548 {
00549   Time min = DBL_MAX;
00550   int min_index = 0;
00551   int c;
00552 
00553   for (c = 0 ; c < SEND_BUF_SIZE ; c ++)
00554     if (send_buf[c].p  == NULL)
00555       {
00556     send_buf[c].t = NOW;
00557     send_buf[c].p = p;
00558     return;
00559       }
00560     else if (send_buf[c].t < min)
00561       {
00562     min = send_buf[c].t;
00563     min_index = c;
00564       }
00565   
00566   // Before killing somebody, you'd better give him the last chance.
00567 
00568   hdr_cdiff  *dfh = HDR_CDIFF(send_buf[min_index].p);
00569   hdr_ip    *iph = HDR_IP(send_buf[min_index].p);
00570   int dtype = dfh->data_type;
00571 
00572   PrvCurPtr RetVal = INTF_FIND(routing_table[dtype].active, iph->dst_);
00573 
00574   if (RetVal.cur != NULL)   
00575       MACsend(send_buf[min_index].p, 0);
00576   else
00577       Packet::free(send_buf[min_index].p);
00578 
00579   // A new packet is taking over the slot.
00580 
00581   send_buf[min_index].t = Scheduler::instance().clock();
00582   send_buf[min_index].p = p;
00583 }

void DiffusionAgent::StopSource  )  [protected, inherited]
 

Definition at line 374 of file diffusion.cc.

References AGENT_NEXT, AGT_ADDR, DATA_STOP, MAX_DATA_TYPE, DiffusionAgent::routing_table, and SEND_MESSAGE.

Referenced by DiffusionAgent::command().

00375 {
00376   Agent_List *cur;
00377 
00378   for (int i=0; i<MAX_DATA_TYPE; i++) {
00379     for (cur=routing_table[i].source; cur!=NULL; cur=AGENT_NEXT(cur) ) {
00380       SEND_MESSAGE(i, AGT_ADDR(cur), DATA_STOP);
00381     }
00382   }
00383 }

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

Definition at line 49 of file connector.h.

References Connector::target(), and Connector::target_.

00049 { target_ = target; }

Here is the call graph for this function:

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

Definition at line 48 of file connector.h.

References Connector::target_.

Referenced by JoBS::assignRateDropsADC(), FQ::deque(), MIPMHAgent::reg(), MIPBSAgent::send_ads(), and Connector::target().

00048 { return target_; }

void DiffusionAgent::Terminate  )  [protected, inherited]
 

Definition at line 231 of file diffusion.cc.

References DiffusionAgent::overhead, DiffusionAgent::Print_IOlist(), and THIS_NODE.

Referenced by DiffusionAgent::command().

00232 {
00233 #ifdef DEBUG_OUTPUT
00234     printf("Diffusion node %d : terminates (overhead %d)\n", 
00235            THIS_NODE, overhead);  
00236     printf("node %d: remaining energy %f, initial energy %f\n", THIS_NODE, 
00237            node->energy_model()->energy(), 
00238            node->energy_model()->initialenergy() );
00239     Print_IOlist();
00240 #endif
00241 }

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 SctpAgent, and 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 622 of file diffusion.cc.

References BaseTrace::buffer(), BaseTrace::dump(), Trace::pt_, and DiffusionAgent::tracetarget.

00623 {
00624   va_list ap;
00625 
00626   if (!tracetarget)
00627     return;
00628 
00629   va_start (ap, fmt);
00630   vsprintf (tracetarget->pt_->buffer (), fmt, ap);
00631   tracetarget->pt_->dump ();
00632   va_end (ap);
00633 }

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 149 of file agent.h.

00149 {}

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

Definition at line 533 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, HDR_CDIFF, INTM_POS, ORIGINAL, hdr_cdiff::pk_num, pos_node_type_, PosReinf(), DiffusionAgent::routing_table, hdr_cdiff::sender_id, and THIS_NODE.

Referenced by FwdData().

00534 {
00535   hdr_cdiff *dfh = HDR_CDIFF(pkt);
00536   unsigned int dtype = dfh->data_type;
00537   nsaddr_t forwarder_node = forward_agent.addr_;
00538 
00539   if (pos_node_type_ == INTM_POS) {
00540     if (routing_table[dtype].sink != NULL ||
00541     routing_table[dtype].ExistOriginalGradient() == true) {
00542       DataReqAll(dtype, ORIGINAL);
00543       if (THIS_NODE != forwarder_node) {
00544        PosReinf(dtype, forwarder_node, dfh->sender_id,
00545               dfh->pk_num);
00546        routing_table[dtype].CntPosSend(forward_agent);
00547        routing_table[dtype].ClrNewSub(forward_agent);
00548       } 
00549     }
00550     return;
00551   }
00552  
00553 
00554   if (pos_node_type_ == END_POS) {
00555     if (routing_table[dtype].sink != NULL) {
00556       DataReqAll(dtype, ORIGINAL);
00557       if (THIS_NODE != forwarder_node) {
00558        PosReinf(dtype, forwarder_node, dfh->sender_id,
00559               dfh->pk_num);
00560        routing_table[dtype].CntPosSend(forward_agent);
00561        routing_table[dtype].ClrNewSub(forward_agent);
00562       } 
00563     }
00564 
00565     return;
00566   }
00567 }

Here is the call graph for this function:

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

Definition at line 744 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().

00745 {
00746       Packet *pkt=prepare_message(dtype, to, NEG_REINFORCE);
00747       MACprepare(pkt, to.addr_, NS_AF_INET, 0);
00748       MACsend(pkt, 0);
00749       overhead++;
00750 
00751 #ifdef DEBUG_RATE
00752       hdr_cdiff *dfh = HDR_CDIFF(pkt);
00753       hdr_cmn *cmh = HDR_CMN(pkt);
00754       printf("DF node %d will send %s (%x, %x, %d) to %x\n",
00755          THIS_NODE, MsgStr[dfh->mess_type], (dfh->sender_id).addr_, 
00756          (dfh->sender_id).port_, dfh->pk_num, cmh->next_hop());
00757 #endif
00758 
00759 }

Here is the call graph for this function:

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

Reimplemented in DiffusionProb.

Definition at line 469 of file diffusion.cc.

Referenced by DiffusionAgent::ArpBufferCheck().

00470 {
00471   // For future use, if needed.
00472 }


Friends And Related Function Documentation

friend class ArpBufferTimer [friend, inherited]
 

Definition at line 207 of file diffusion.h.

friend class GradientTimer [friend]
 

Definition at line 225 of file diff_rate.h.

Referenced by Start().

friend class NegativeReinforceTimer [friend]
 

Definition at line 226 of file diff_rate.h.

Referenced by Start().

friend class SendBufTimer [friend, inherited]
 

Definition at line 208 of file diffusion.h.

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

Definition at line 462 of file diffusion.cc.

Referenced by DiffusionAgent::MACprepare().

00463 {
00464   DiffusionAgent *agent = (DiffusionAgent *)data;  // cast of trust
00465   agent->xmitFailed(pkt);
00466 }


Field Documentation

Application* Agent::app_ [protected, inherited]
 

Reimplemented in BayFullTcpAgent.

Definition at line 137 of file agent.h.

Referenced by Agent::attachApp(), Agent::idle(), RapAgent::IpgTimeout(), UdpAgent::recv(), TPAgent::recv(), SimpleTcpAgent::recv(), RapAgent::recv(), MessagePassingAgent::recv(), HttpInvalAgent::recv(), Agent::recv(), and Agent::recvBytes().

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

Definition at line 169 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 168 of file diffusion.h.

Referenced by DiffusionAgent::Start().

ARPTable* DiffusionAgent::arp_table [protected, inherited]
 

Definition at line 166 of file diffusion.h.

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

Tcl_Channel Agent::channel_ [protected, inherited]
 

Definition at line 133 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::command(), Agent::flushAVar(), Agent::monitorAgentTrace(), XcpAgent::output(), XcpAgent::recv_newack_helper(), Agent::trace(), TcpAgent::traceAll(), TcpAsymAgent::traceAll(), SctpAgent::TraceAll(), MultipleFastRtxSctpAgent::TraceAll(), MfrTimestampSctpAgent::TraceAll(), TcpAgent::traceVar(), TcpSessionAgent::traceVar(), TcpAsymAgent::traceVar(), SctpAgent::TraceVar(), MultipleFastRtxSctpAgent::TraceVar(), and MfrTimestampSctpAgent::TraceVar().

Data_Hash_Table DiffusionRate::DataTable [protected]
 

Definition at line 189 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(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), SctpAgent::Reset(), REDQueue::reset(), DropTail::shrink_queue(), and Delayer::try_send().

int Agent::defttl_ [protected, inherited]
 

Definition at line 124 of file agent.h.

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

NsObject* Connector::drop_ [protected, inherited]
 

Definition at line 59 of file connector.h.

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

ns_addr_t Agent::dst_ [protected, inherited]
 

Reimplemented in AckRecons.

Definition at line 118 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 179 of file diff_rate.h.

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

EventTrace* Agent::et_ [protected, inherited]
 

Definition at line 148 of file agent.h.

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

int Agent::fid_ [protected, inherited]
 

Definition at line 121 of file agent.h.

Referenced by Agent::delay_bind_dispatch(), AbsTcpAgent::flowid(), Agent::initpkt(), CtrMcastEncap::recv(), Sack1TcpAgent::timeout(), and TcpAgent::trace_event().

int Agent::flags_ [protected, inherited]
 

Reimplemented in BayFullTcpAgent, RapAgent, and FullTcpAgent.

Definition at line 123 of file agent.h.

Referenced by Agent::delay_bind_dispatch().

GradientTimer* DiffusionRate::gradient_timer [protected]
 

Definition at line 191 of file diff_rate.h.

Referenced by Start().

ns_addr_t Agent::here_ [protected, inherited]
 

Definition at line 117 of file agent.h.

Referenced by Agent::addAgentTrace(), Agent::addr(), SinkAgent::bcast_interest(), MessagePassingAgent::command(), SinkAgent::data_ready(), OmniMcastAgent::DataForSink(), FloodingAgent::DataForSink(), DiffusionAgent::DataForSink(), Agent::delay_bind_dispatch(), Agent::deleteAgentTrace(), AODV::forward(), 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(), SinkAgent::sendpkt(), SinkAgent::set_addr(), SinkAgent::Terminate(), and Agent::trace().

NsObject* DiffusionAgent::ll [protected, inherited]
 

Definition at line 164 of file diffusion.h.

neg_mxt DiffusionRate::neg_max_type_ [protected]
 

Definition at line 187 of file diff_rate.h.

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

bool DiffusionAgent::NEG_REINF_ [protected, inherited]
 

Definition at line 155 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 192 of file diff_rate.h.

Referenced by Start().

neg_tht DiffusionRate::neg_thr_type_ [protected]
 

Definition at line 186 of file diff_rate.h.

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

neg_wint DiffusionRate::neg_win_type_ [protected]
 

Definition at line 185 of file diff_rate.h.

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

Node* DiffusionAgent::node [protected, inherited]
 

Definition at line 162 of file diffusion.h.

int DiffusionRate::num_data_bcast_rcv [protected]
 

Definition at line 196 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 195 of file diff_rate.h.

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

int DiffusionRate::num_neg_bcast_rcv [protected]
 

Definition at line 198 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 197 of file diff_rate.h.

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

int DiffusionRate::num_not_send_bcast_data [protected]
 

Definition at line 194 of file diff_rate.h.

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

OldValue* Agent::oldValueList_ [protected, inherited]
 

Definition at line 135 of file agent.h.

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

org_t DiffusionRate::org_type_ [protected]
 

Definition at line 182 of file diff_rate.h.

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

int DiffusionAgent::overhead [protected, inherited]
 

Definition at line 158 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 157 of file diffusion.h.

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

Pkt_Hash_Table DiffusionAgent::PktTable [protected, inherited]
 

Definition at line 160 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 165 of file diffusion.h.

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

pos_ndt DiffusionRate::pos_node_type_ [protected]
 

Definition at line 184 of file diff_rate.h.

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

bool DiffusionAgent::POS_REINF_ [protected, inherited]
 

Definition at line 154 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 183 of file diff_rate.h.

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

int Agent::prio_ [protected, inherited]
 

Definition at line 122 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 147 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::StopSource(), TriggerPosReinf(), and DiffusionProb::UpdateIOList().

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

Definition at line 171 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 170 of file diffusion.h.

Referenced by DiffusionAgent::Start().

int Agent::size_ [protected, inherited]
 

Reimplemented in SA_Agent, and AckRecons.

Definition at line 119 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(), TfrcAgent::decrease_rate(), XcpSink::delay_bind_dispatch(), TcpAgent::delay_bind_dispatch(), TcpSink::delay_bind_dispatch(), FullTcpAgent::foutput(), DSRAgent::getRouteForPacket(), TfrcAgent::increase_rate(), TfrcAgent::initial_rate(), TcpAgent::initial_window(), Agent::initpkt(), RapAgent::IpgTimeout(), IvsReceiver::IvsReceiver(), LmsAgent::LmsAgent(), LmsReceiver::LmsReceiver(), mcastControlAgent::mcastControlAgent(), MessageAgent::MessageAgent(), MessagePassingAgent::MessagePassingAgent(), MIPBSAgent::MIPBSAgent(), MIPMHAgent::MIPMHAgent(), TfrcAgent::nextpkt(), IntTcpAgent::opencwnd(), XcpAgent::output(), TcpAgent::output(), PingAgent::PingAgent(), TcpAgent::processQuickStart(), RapAgent::RapAgent(), TfrcAgent::recv(), TcpSessionAgent::recv(), NewRenoTcpAgent::recv(), TfrcAgent::reduce_rate_on_no_feedback(), SctpAgent::Reset(), 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(), LmsSender::send_spm(), UdpAgent::sendmsg(), TfrcAgent::sendmsg(), TcpAgent::sendmsg(), SRMAgent::sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), RapAgent::SendPacket(), TfrcAgent::sendpkt(), rtProtoDV::sendpkt(), SinkAgent::sendpkt(), TPAgent::sendto(), MessagePassingAgent::sendto(), SinkAgent::SinkAgent(), Agent::size(), TfrcAgent::slowstart(), LmsSender::solicit_naks(), TfrcAgent::start(), TfrcAgent::TfrcAgent(), TfrcSinkAgent::TfrcSinkAgent(), RTPAgent::timeout(), RTCPAgent::timeout(), TPAgent::TPAgent(), UdpAgent::UdpAgent(), and TfrcSinkAgent::weighted_average1().

sub_t DiffusionRate::sub_type_ [protected]
 

Definition at line 181 of file diff_rate.h.

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

NsObject* Connector::target_ [protected, inherited]
 

Definition at line 58 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(), SctpAgent::ForceSource(), toraAgent::forward(), AODV::forward(), DSDV_Agent::forwardPacket(), SensorQueryAgent::generate_query(), DSDVTriggerHandler::handle(), AckRecons::handle(), DSDV_Agent::helper_callback(), DSDV_Agent::lost_link(), OmniMcastAgent::OmniMcastAgent(), LandmarkAgent::periodic_callback(), TCPTapAgent::processpkt(), IPTapAgent::processpkt(), CMUPriQueue::prq_enqueue(), CMUPriQueue::prq_resume(), Trace::recv(), TraceIpMac::recv(), TraceIp::recv(), SRMAgent::recv(), SSMSRMAgent::recv(), SAack_Agent::recv(), Queue< T >::recv(), PingResponder::recv(), MIPEncapsulator::recv(), LmsAgent::recv(), HackLossyLink::recv(), FQ::recv(), ErrorModel::recv(), DynamicLink::recv(), DSRAgent::recv(), DelayModel::recv(), LinkDelay::recv(), CtrMcastDecap::recv(), CtrMcastEncap::recv(), CMUTrace::recv(), Trace::recvOnly(), Queue< T >::resume(), LinkDelay::send(), Connector::send(), Agent::send(), MIPBSAgent::send_ads(), SRMAgent::send_ctrl(), SSMSRMAgent::send_ctrl(), LmsSender::send_dmcast(), LmsReceiver::send_dmcast(), LmsAgent::send_downstream(), LmsSender::send_lms_pkt(), LmsReceiver::send_nak(), LmsReceiver::send_refresh(), MIPMHAgent::send_sols(), LmsSender::send_spm(), LmsAgent::send_upstream(), LandmarkAgent::SendChangedTagListUpdate(), AODV::sendError(), AODV::sendHello(), UdpAgent::sendmsg(), SRMAgent::sendmsg(), SA_Agent::sendmsg(), RTPAgent::sendmsg(), MessagePassingAgent::sendmsg(), LmsSender::sendmsg(), DSDV_Agent::sendOutBCastPkt(), SA_Agent::sendpkt(), rtProtoDV::sendpkt(), RTPAgent::sendpkt(), RTCPAgent::sendpkt(), IvsSource::sendpkt(), AODV::sendReply(), AODV::sendRequest(), TPAgent::sendto(), MessagePassingAgent::sendto(), SctpAgent::SetSource(), LmsSender::solicit_naks(), Connector::target(), toraAgent::tora_output(), and Delayer::try_send().

char* Agent::traceName_ [protected, inherited]
 

Definition at line 134 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 163 of file diffusion.h.

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

packet_t Agent::type_ [protected, inherited]
 

Definition at line 120 of file agent.h.

Referenced by Agent::get_pkttype(), Agent::initpkt(), FullTcpAgent::listen(), BayFullTcpAgent::listen(), RapAgent::SendAck(), SRMAgent::sendmsg(), RapAgent::SendPacket(), Agent::set_pkttype(), and XcpAgent::XcpAgent().

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

Definition at line 131 of file agent.h.

Referenced by imepAgent::handlerControlTimer(), Agent::initpkt(), imepAgent::sendAck(), imepAgent::sendBeacon(), toraAgent::sendCLR(), imepAgent::sendHello(), toraAgent::sendQRY(), and toraAgent::sendUPD().


The documentation for this class was generated from the following files:
Generated on Tue Mar 6 17:06:01 2007 for ns2 Network Simulator 2.29 by  doxygen 1.4.6