#include <delay.h>
Inheritance diagram for LinkDelay:


Public Member Functions | |
| LinkDelay () | |
| void | recv (Packet *p, Handler *) |
| void | send (Packet *p, Handler *) |
| void | handle (Event *e) |
| double | delay () |
| double | txtime (Packet *p) |
| double | bandwidth () const |
| void | pktintran (int src, int group) |
| NsObject * | target () |
| virtual void | drop (Packet *p) |
| virtual void | recv (Packet *p, const char *s) |
| virtual void | recvOnly (Packet *) |
| virtual void | delay_bind_init_all () |
| virtual int | delay_bind_dispatch (const char *varName, const char *localName, TclObject *tracer) |
| int | isdebug () const |
| virtual void | debug (const char *fmt,...) |
Protected Member Functions | |
| int | command (int argc, const char *const *argv) |
| void | reset () |
| virtual void | drop (Packet *p, const char *s) |
Protected Attributes | |
| double | bandwidth_ |
| double | delay_ |
| Event | intr_ |
| int | dynamic_ |
| PacketQueue * | itq_ |
| int | total_ [4] |
| NsObject * | target_ |
| NsObject * | drop_ |
| int | debug_ |
|
|
Definition at line 52 of file delay.cc. References bandwidth_, and delay_.
|
|
|
Definition at line 57 of file delay.h. References bandwidth_. Referenced by REMQueue::command(), REDQueue::command(), JoBS::deque(), JoBS::enforceWC(), PushbackQueue::getBW(), CBQueue::insert_class(), CBQClass::newallot(), QSAgent::recv(), REMQueue::reset(), REDQueue::reset(), dsREDQueue::reset(), PushbackQueue::timeout(), and JoBS::updateStats().
00057 { return bandwidth_; }
|
|
||||||||||||
|
Reimplemented from Connector. Reimplemented in ARPTable, LL, and SatLL. Definition at line 58 of file delay.cc. References Connector::command(), dynamic_, itq_, pktintran(), and total_. Referenced by LL::command(), and ARPTable::command().
00059 {
00060 if (argc == 2) {
00061 if (strcmp(argv[1], "isDynamic") == 0) {
00062 dynamic_ = 1;
00063 itq_ = new PacketQueue();
00064 return TCL_OK;
00065 }
00066 } else if (argc == 6) {
00067 if (strcmp(argv[1], "pktintran") == 0) {
00068 int src = atoi(argv[2]);
00069 int grp = atoi(argv[3]);
00070 int from = atoi(argv[4]);
00071 int to = atoi(argv[5]);
00072 pktintran (src, grp);
00073 Tcl::instance().evalf("%s puttrace %d %d %d %d %d %d %d %d", name(), total_[0], total_[1], total_[2], total_[3], src, grp, from, to);
00074 return TCL_OK;
00075 }
00076 }
00077
00078 return Connector::command(argc, argv);
00079 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 102 of file object.cc. References NsObject::debug_.
00103 {
00104 if (!debug_)
00105 return;
00106 va_list ap;
00107 va_start(ap, fmt);
00108 vprintf(fmt, ap);
00109 }
|
|
|
Definition at line 53 of file delay.h. References delay_. Referenced by REDQueue::command(), and Snoop::handle().
00053 { return delay_; }
|
|
||||||||||||||||
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 63 of file object.cc. References NsObject::debug_. Referenced by MPLSAddressClassifier::delay_bind_dispatch(), and Agent::delay_bind_dispatch().
00064 {
00065 if (delay_bind_bool(varName, localName, "debug_", &debug_, tracer))
00066 return TCL_OK;
00067 return TclObject::delay_bind_dispatch(varName, localName, tracer);
00068 }
|
|
|
Reimplemented in BayFullTcpAgent, Agent, MPLSAddressClassifier, LDPAgent, FullTcpAgent, SackFullTcpAgent, RFC793eduTcpAgent, TcpSink, TcpAgent, and VegasTcpAgent. Definition at line 57 of file object.cc. Referenced by MPLSAddressClassifier::delay_bind_init_all(), and Agent::delay_bind_init_all().
00058 {
00059 delay_bind_init_one("debug_");
00060 }
|
|
||||||||||||
|
Definition at line 114 of file connector.cc. References Connector::drop_, Packet::free(), and NsObject::recv().
00115 {
00116 if (drop_ != 0)
00117 drop_->recv(p, s);
00118 else
00119 Packet::free(p);
00120 }
|
Here is the call graph for this function:

|
Here is the call graph for this function:

|
|
Reimplemented from NsObject. Reimplemented in LL. Definition at line 115 of file delay.cc. References PacketQueue::deque(), itq_, send(), and Event::time_.
|
Here is the call graph for this function:

|
|
Definition at line 61 of file object.h. References NsObject::debug_.
00061 { return debug_; }
|
|
||||||||||||
|
Definition at line 122 of file delay.cc. References hdr_CtrMcast::access(), hdr_ip::access(), hdr_ip::daddr(), dynamic_, hdr_ip::flowid(), hdr_CtrMcast::group(), itq_, len, PacketQueue::length(), PacketQueue::lookup(), hdr_ip::saddr(), hdr_CtrMcast::src(), and total_. Referenced by command().
00123 {
00124 int reg = 1;
00125 int prune = 30;
00126 int graft = 31;
00127 int data = 0;
00128 for (int i=0; i<4; i++) {
00129 total_[i] = 0;
00130 }
00131
00132 if (! dynamic_)
00133 return;
00134
00135 int len = itq_->length();
00136 while (len) {
00137 len--;
00138 Packet* p = itq_->lookup(len);
00139 hdr_ip* iph = hdr_ip::access(p);
00140 if (iph->flowid() == prune) {
00141 if (iph->saddr() == src && iph->daddr() == group) {
00142 total_[0]++;
00143 }
00144 } else if (iph->flowid() == graft) {
00145 if (iph->saddr() == src && iph->daddr() == group) {
00146 total_[1]++;
00147 }
00148 } else if (iph->flowid() == reg) {
00149 hdr_CtrMcast* ch = hdr_CtrMcast::access(p);
00150 if (ch->src() == src+1 && ch->group() == group) {
00151 total_[2]++;
00152 }
00153 } else if (iph->flowid() == data) {
00154 if (iph->saddr() == src+1 && iph->daddr() == group) {
00155 total_[3]++;
00156 }
00157 }
00158 }
00159 //printf ("%f %d %d %d %d\n", Scheduler::instance().clock(), total_[0], total_[1], total_[2],total_[3]);
00160 }
|
Here is the call graph for this function:

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

|
||||||||||||
|
Reimplemented from Connector. Reimplemented in LL, SatLL, and LLSnoop. Definition at line 81 of file delay.cc. References delay_, dynamic_, PacketQueue::enque(), Scheduler::instance(), intr_, itq_, Scheduler::schedule(), Connector::target_, Event::time_, and txtime().
00082 {
00083 double txt = txtime(p);
00084 Scheduler& s = Scheduler::instance();
00085 if (dynamic_) {
00086 Event* e = (Event*)p;
00087 e->time_= txt + delay_;
00088 itq_->enque(p); // for convinience, use a queue to store packets in transit
00089 s.schedule(this, p, txt + delay_);
00090 } else {
00091 s.schedule(target_, p, txt + delay_);
00092 }
00093 s.schedule(h, &intr_, txt);
00094 }
|
Here is the call graph for this function:

|
|
Reimplemented in Agent, and Trace. Definition at line 56 of file object.h. Referenced by Trace::recvOnly().
00056 {};
|
|
|
Reimplemented from NsObject. Definition at line 101 of file delay.cc. References Scheduler::cancel(), PacketQueue::deque(), Connector::drop(), Scheduler::instance(), itq_, and PacketQueue::length().
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented from Connector. Definition at line 96 of file delay.cc. References NsObject::recv(), and Connector::target_. Referenced by handle().
|
Here is the call graph for this function:

|
|
Definition at line 48 of file connector.h. References Connector::target_. Referenced by JoBS::assignRateDropsADC(), FQ::deque(), QSAgent::recv(), and MIPMHAgent::reg().
00048 { return target_; }
|
|
|
Definition at line 54 of file delay.h. References hdr_cmn::access(), bandwidth_, and hdr_cmn::size(). Referenced by recv(), and CBQClass::update().
00054 {
00055 return (8. * hdr_cmn::access(p)->size() / bandwidth_);
00056 }
|
Here is the call graph for this function:

|
|
Definition at line 62 of file delay.h. Referenced by bandwidth(), LinkDelay(), and txtime(). |
|
|
Reimplemented in FECModel, FloodAgent, and LandmarkAgent. Definition at line 66 of file object.h. Referenced by REDQueue::command(), RedPDQueue::command(), PushbackQueue::command(), NsObject::debug(), NsObject::delay_bind_dispatch(), RedPDQueue::enque(), PushbackQueue::enque(), NsObject::isdebug(), NsObject::NsObject(), TfrcAgent::recv(), PushbackQueue::reportDrop(), and REDQueue::reset(). |
|
|
Definition at line 63 of file delay.h. Referenced by ARPTable::arpinput(), ARPTable::arprequest(), delay(), LinkDelay(), recv(), SatLL::sendDown(), LL::sendDown(), SatLL::sendUp(), and LL::sendUp(). |
|
|
Definition at line 57 of file connector.h. Referenced by Connector::command(), Connector::drop(), and ErrorModel::recv(). |
|
|
Definition at line 65 of file delay.h. Referenced by command(), pktintran(), and recv(). |
|
|
Definition at line 64 of file delay.h. Referenced by LLSnoop::recv(), and recv(). |
|
|
Definition at line 67 of file delay.h. Referenced by command(), handle(), pktintran(), recv(), and reset(). |
|
|
|
Definition at line 68 of file delay.h. Referenced by command(), and pktintran(). |
1.3.3