#include <semantic-packetqueue.h>
Inheritance diagram for SemanticPacketQueue:


|
|
Definition at line 52 of file semantic-packetqueue.cc. References acksfirst_, filteracks_, priority_drop_, random_drop_, random_ecn_, reconsAcks_, and replace_head_.
00052 : ack_count(0), data_count(0), 00053 acks_to_send(0), marked_count_(0), unmarked_count_(0) 00054 { 00055 bind_bool("acksfirst_", &acksfirst_); 00056 bind_bool("filteracks_", &filteracks_); 00057 bind_bool("reconsAcks_", &reconsAcks_); 00058 bind_bool("replace_head_", &replace_head_); 00059 bind_bool("priority_drop_", &priority_drop_); 00060 bind_bool("random_drop_", &random_drop_); 00061 bind_bool("random_ecn_", &random_ecn_); 00062 } |
|
|
Definition at line 49 of file queue.h. References PacketQueue::bytes_. Referenced by REDQueue::bcount_(), Queue< T >::byteLength(), PIQueue::calculate_p(), REDQueue::deque(), PIQueue::deque(), DropTail::deque(), REDQueue::drop_early(), RIOQueue::enque(), REDQueue::enque(), RedPDQueue::enque(), PushbackQueue::enque(), PIQueue::enque(), and DropTail::enque().
00049 { return (bytes_); }
|
|
||||||||||||
|
Definition at line 65 of file semantic-packetqueue.cc. References reconsAcks_, reconsCtrl_, and AckReconsController::spq_.
00066 {
00067 if (argc == 3) {
00068 if (strcmp(argv[1], "ackrecons") == 0) {
00069 if ((reconsCtrl_ = (AckReconsController *)
00070 TclObject::lookup(argv[2]))) {
00071 reconsCtrl_->spq_ = this;
00072 reconsAcks_ = 1;
00073 }
00074 }
00075 return (TCL_OK);
00076 }
00077 return (TclObject::command(argc, argv));
00078 }
|
|
||||||||||||
|
Definition at line 62 of file semantic-packetqueue.h. References hdr_ip::daddr(), hdr_ip::dport(), hdr_ip::saddr(), and hdr_ip::sport(). Referenced by filterAcks().
|
Here is the call graph for this function:

|
|
Reimplemented from PacketQueue. Definition at line 292 of file semantic-packetqueue.cc. References hdr_cmn::access(), ack_count, acksfirst_, data_count, PacketQueue::deque(), deque_acksfirst(), isMarked(), marked_count_, PT_ACK, hdr_cmn::ptype_, and unmarked_count_.
00293 {
00294 Packet *pkt;
00295
00296 if (acksfirst_)
00297 pkt = deque_acksfirst();
00298 else
00299 pkt = PacketQueue::deque();
00300
00301 if (pkt) {
00302 if (hdr_cmn::access(pkt)->ptype_ == PT_ACK)
00303 ack_count--;
00304 else
00305 data_count--;
00306 if (isMarked(pkt))
00307 marked_count_--;
00308 else
00309 unmarked_count_--;
00310 }
00311 return pkt;
00312 }
|
Here is the call graph for this function:

|
|
Definition at line 84 of file semantic-packetqueue.cc. References hdr_cmn::access(), ack_count, PacketQueue::deque(), PacketQueue::head_, PacketQueue::length(), Packet::next_, packet_t, PT_ACK, hdr_cmn::ptype_, and PacketQueue::remove(). Referenced by deque().
00084 {
00085 Packet* p = head_;
00086 Packet* pp = NULL;
00087 packet_t type;
00088
00089 if (ack_count > 0) {
00090 while (p) {
00091 type = hdr_cmn::access(p)->ptype_;
00092 if (type == PT_ACK)
00093 break;
00094 pp = p;
00095 p = p->next_;
00096 }
00097 if (!p)
00098 fprintf(stderr, "In deque_acksfirst(): ack_count: %d but no acks in queue, length = %d\n", ack_count, length());
00099 PacketQueue::remove(p, pp);
00100 } else {
00101 p = PacketQueue::deque();
00102 }
00103 return p;
00104 }
|
Here is the call graph for this function:

|
|
Reimplemented from PacketQueue. Definition at line 269 of file semantic-packetqueue.cc. References hdr_cmn::access(), ack_count, data_count, PacketQueue::enque(), filterAcks(), filteracks_, isMarked(), marked_count_, PT_ACK, hdr_cmn::ptype_, reconsAcks_, reconsCtrl_, AckReconsController::recv(), replace_head_, and unmarked_count_. Referenced by AckRecons::recv().
00270 {
00271 if (reconsAcks_&&(hdr_cmn::access(pkt)->ptype_==PT_ACK)) {
00272 reconsCtrl_->recv(pkt);
00273 return NULL;
00274 }
00275 if (hdr_cmn::access(pkt)->ptype_ == PT_ACK)
00276 ack_count++;
00277 else
00278 data_count++;
00279 if (isMarked(pkt))
00280 marked_count_++;
00281 else
00282 unmarked_count_++;
00283
00284 Packet* pt = PacketQueue::enque(pkt); /* actually enque the packet */
00285
00286 if (filteracks_ && (hdr_cmn::access(pkt)->ptype_==PT_ACK))
00287 filterAcks(pkt, replace_head_);
00288 return pt;
00289 }
|
Here is the call graph for this function:

|
|
Definition at line 115 of file semantic-packetqueue.h. References PacketQueue::enque(), PacketQueue::head_, PacketQueue::len_, and Packet::next_.
|
Here is the call graph for this function:

|
|
Definition at line 85 of file queue.h. References hdr_cmn::access(), PacketQueue::bytes_, PacketQueue::head_, PacketQueue::len_, Packet::next_, hdr_cmn::size(), and PacketQueue::tail_. Referenced by imepAgent::aggregateObjectBlock(), PushbackQueue::enque(), and PriQueue::recvHighPriority().
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 114 of file semantic-packetqueue.cc. References hdr_cmn::access(), hdr_ip::access(), hdr_tcp::access(), ack_count, Scheduler::cancel(), compareFlows(), Packet::free(), head(), Scheduler::instance(), Scheduler::lookup(), Packet::next_, PT_ACK, hdr_cmn::ptype_, PacketQueue::remove(), and hdr_tcp::seqno(). Referenced by enque().
00115 {
00116 int done_replacement = 0;
00117
00118 Packet *p, *pp, *new_p;
00119 hdr_tcp *tcph = hdr_tcp::access(pkt);
00120 int &ack = tcph->seqno();
00121
00122 hdr_ip *iph = hdr_ip::access(pkt);
00123 for (p = head(), pp = p; p != 0; ) {
00124 /*
00125 * Check if packet in the queue belongs to the
00126 * same connection as the most recent ack
00127 */
00128 if (compareFlows(hdr_ip::access(p), iph)) {
00129 /* check if queued packet is an ack */
00130 if (hdr_cmn::access(p)->ptype_==PT_ACK) {
00131 hdr_tcp *th = hdr_tcp::access(p);
00132 /* is this ack older than the current one? */
00133 if ((th->seqno() < ack) ||
00134 (replace_head && th->seqno() == ack)) {
00135 /*
00136 * If we haven't yet replaced the ack
00137 * closest to the head with the most
00138 * recent ack, do so now.
00139 */
00140 if (replace_head && pkt != p &&
00141 !done_replacement) {
00142 PacketQueue::remove(pkt);
00143 ack_count--; /* XXX */
00144 pkt->next_ = p;
00145 if (pp)
00146 pp->next_ = pkt;
00147 pp = pkt;
00148 done_replacement = 1;
00149 continue;
00150 } else if (done_replacement||pkt != p){
00151 new_p = p->next_;
00152 /*
00153 * If p is in scheduler queue,
00154 * cancel the event. Also,
00155 * print out a warning because
00156 * this should never happen.
00157 */
00158 Scheduler &s = Scheduler::instance();
00159 if (s.lookup(p->uid_)) {
00160 s.cancel(p);
00161 fprintf(stderr, "Warning: In filterAcks(): packet being dropped from queue is in scheduler queue\n");
00162 }
00163 PacketQueue::remove(p, pp);
00164 /* XXX should drop, but we
00165 don't have access to q */
00166 Packet::free(p);
00167 ack_count--;
00168 p = new_p;
00169 continue;
00170 }
00171 if (ack_count <= 0)
00172 fprintf(stderr,
00173 "oops! ackcount %d\n",
00174 ack_count);
00175 }
00176 }
00177 }
00178 pp = p;
00179 p = p->next_;
00180 }
00181 }
|
Here is the call graph for this function:

|
|
Definition at line 93 of file queue.h. References PacketQueue::iter, and Packet::next_.
|
|
|
Reimplemented from PacketQueue. Definition at line 92 of file semantic-packetqueue.h. References PacketQueue::head_. Referenced by filterAcks().
00092 { return head_; }
|
|
|
Definition at line 185 of file semantic-packetqueue.cc. References hdr_flags::access(), and hdr_flags::fs_. Referenced by deque(), enque(), lookup(), and remove().
00186 {
00187 return (hdr_flags::access(p)->fs_);
00188 }
|
Here is the call graph for this function:

|
|
|
Definition at line 71 of file queue.h. References PacketQueue::head_, and Packet::next_. Referenced by DRR::deque(), PriQueue::filter(), pickPacketForECN(), pickPacketToDrop(), REDQueue::pickPacketToDrop(), PIQueue::pickPacketToDrop(), LinkDelay::pktintran(), and PriQueue::recvHighPriority().
|
|
||||||||||||
|
Definition at line 193 of file semantic-packetqueue.cc. References PacketQueue::head_, isMarked(), and Packet::next_. Referenced by pickPacketToDrop().
00194 {
00195 if (index < 0) {
00196 fprintf(stderr, "In SemanticPacketQueue::lookup(): index = %d\n", index);
00197 return (NULL);
00198 }
00199 for (Packet* p = head_; p != 0; p = p->next_) {
00200 if (isMarked(p) == markedFlag)
00201 if (--index < 0)
00202 return (p);
00203 }
00204 return (NULL);
00205 }
|
Here is the call graph for this function:

|
|
Definition at line 213 of file semantic-packetqueue.cc. References Random::integer(), PacketQueue::length(), PacketQueue::lookup(), and random_ecn_.
00214 {
00215 Packet *victim;
00216 int victimIndex;
00217
00218 if (random_ecn_) {
00219 victimIndex = Random::integer(length()+1);
00220 if (victimIndex == length())
00221 victim = pkt;
00222 else
00223 victim = PacketQueue::lookup(victimIndex);
00224 }
00225 else
00226 victim = pkt;
00227 return (victim);
00228 }
|
Here is the call graph for this function:

|
|
Definition at line 237 of file semantic-packetqueue.cc. References Random::integer(), PacketQueue::length(), lookup(), PacketQueue::lookup(), marked_count_, priority_drop_, random_drop_, and unmarked_count_.
00238 {
00239 Packet *victim;
00240 int victimIndex, victimMarked;
00241
00242 if (!priority_drop_) {
00243 if (random_drop_)
00244 victim=PacketQueue::lookup(Random::integer(length()));
00245 else
00246 victim = PacketQueue::lookup(length() - 1);
00247 } else {
00248 /* if there are marked (low priority) packets */
00249 if (marked_count_) {
00250 victimMarked = 1;
00251 if (!random_drop_)
00252 victimIndex = marked_count_ - 1;
00253 else
00254 victimIndex = Random::integer(marked_count_);
00255 }
00256 else {
00257 victimMarked = 0;
00258 if (!random_drop_)
00259 victimIndex = unmarked_count_ - 1;
00260 else
00261 victimIndex = Random::integer(unmarked_count_);
00262 }
00263 victim = lookup(victimIndex, victimMarked);
00264 }
00265 return (victim);
00266 }
|
Here is the call graph for this function:

|
|
Reimplemented from PacketQueue. Definition at line 315 of file semantic-packetqueue.cc. References hdr_cmn::access(), ack_count, data_count, isMarked(), marked_count_, PT_ACK, hdr_cmn::ptype_, PacketQueue::remove(), and unmarked_count_.
00316 {
00317 PacketQueue::remove(pkt);
00318 if (pkt) {
00319 if (hdr_cmn::access(pkt)->ptype_ == PT_ACK)
00320 ack_count--;
00321 else
00322 data_count--;
00323 if (isMarked(pkt))
00324 marked_count_--;
00325 else
00326 unmarked_count_--;
00327 }
00328 }
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented from PacketQueue. |
|
|
Definition at line 92 of file queue.h. References PacketQueue::head_, and PacketQueue::iter.
00092 {iter = head_;}
|
|
|
Definition at line 83 of file queue.h. References PacketQueue::tail_.
00083 { return tail_; }
|
|
|
Definition at line 95 of file semantic-packetqueue.h. Referenced by deque(), deque_acksfirst(), enque(), filterAcks(), and remove(). |
|
|
Definition at line 97 of file semantic-packetqueue.h. |
|
|
Definition at line 105 of file semantic-packetqueue.h. Referenced by deque(), and SemanticPacketQueue(). |
|
|
Definition at line 103 of file queue.h. Referenced by PacketQueue::byteLength(), PacketQueue::deque(), PacketQueue::enque(), PacketQueue::enqueHead(), PacketQueue::PacketQueue(), and PacketQueue::remove(). |
|
|
Definition at line 96 of file semantic-packetqueue.h. |
|
|
Definition at line 106 of file semantic-packetqueue.h. Referenced by enque(), and SemanticPacketQueue(). |
|
|
Definition at line 100 of file queue.h. Referenced by PacketQueue::deque(), deque_acksfirst(), PacketQueue::enque(), enque_head(), PacketQueue::enqueHead(), head(), PacketQueue::head(), lookup(), PacketQueue::lookup(), PacketQueue::PacketQueue(), PacketQueue::remove(), and PacketQueue::resetIterator(). |
|
|
Definition at line 102 of file queue.h. Referenced by PacketQueue::deque(), PacketQueue::enque(), enque_head(), PacketQueue::enqueHead(), PacketQueue::length(), PacketQueue::PacketQueue(), and PacketQueue::remove(). |
|
|
Definition at line 98 of file semantic-packetqueue.h. Referenced by deque(), enque(), pickPacketToDrop(), and remove(). |
|
|
Definition at line 110 of file semantic-packetqueue.h. Referenced by pickPacketToDrop(), and SemanticPacketQueue(). |
|
|
Definition at line 111 of file semantic-packetqueue.h. Referenced by pickPacketToDrop(), and SemanticPacketQueue(). |
|
|
Definition at line 112 of file semantic-packetqueue.h. Referenced by pickPacketForECN(), and SemanticPacketQueue(). |
|
|
Definition at line 107 of file semantic-packetqueue.h. Referenced by command(), enque(), AckRecons::handle(), AckRecons::recv(), and SemanticPacketQueue(). |
|
|
Definition at line 125 of file semantic-packetqueue.h. |
|
|
Definition at line 108 of file semantic-packetqueue.h. Referenced by enque(), and SemanticPacketQueue(). |
|
|
Definition at line 101 of file queue.h. Referenced by PacketQueue::deque(), PacketQueue::enque(), PacketQueue::enqueHead(), PacketQueue::PacketQueue(), PacketQueue::remove(), and PacketQueue::tail(). |
|
|
Definition at line 99 of file semantic-packetqueue.h. Referenced by deque(), enque(), pickPacketToDrop(), and remove(). |
1.3.3