Hi
I am working on QoS in tiny buffer networks. As a part of my work I have
made changes in the drop tail queue management so as to give some
dedicated buffer size to real time traffic but even after changing the
drop tail queue management I get the same results.
Here is the changes made
void DropTail::enque(Packet* p)
{
if (summarystats) {
Queue::updateStats(qib_?q_->byteLength():q_->length());
}
int qlimBytes = qlim_ * mean_pktsize_;
int limit_udp=LIMIT_UDP*qlim_; //**
int limit_tcp=LIMIT_TCP*qlim_; //**
packet_t type;
type=hdr_cmn::access(p)->ptype_;
int tcp_count=0;
int udp_count=0;
for(int i=0;i < q_->length();i++)
{
Packet *pkt=q_->lookup(i);
if(hdr_cmn::access(pkt)->ptype_==PT_TCP)
tcp_count++;
if(hdr_cmn::access(pkt)->ptype_==PT_EXP)
udp_count++;
}
tcp_count=tcp_count/100;
udp_count=udp_count/100;
if(type==PT_TCP)
{
if (((!qib_ && (q_->length() + 1) >= qlim_) ||(qib_ &&
(q_->byteLength() + hdr_cmn::access(p)->size()) >=
qlimBytes))&&(!(tcp_count<=PT_TCP))) {
// if the queue would overflow if we added this packet...
if (drop_front_) { // remove from head of queue
q_->enque(p);
Packet *pp = q_->deque();
drop(pp);
} else {
drop(p);
}
} else {
q_->enque(p);
}
}
if(type==PT_EXP)
{
if (((!qib_ && (q_->length() + 1) >= qlim_) ||(qib_ &&
(q_->byteLength() + hdr_cmn::access(p)->size()) >=
qlimBytes))&&(!(udp_count<=PT_EXP))) {
// if the queue would overflow if we added this packet...
if (drop_front_) { // remove from head of queue
q_->enque(p);
Packet *pp = q_->deque();
drop(pp);
} else {
drop(p);
}
} else {
q_->enque(p);
}
}
//Original Code
/*if ((!qib_ && (q_->length() + 1) >= qlim_) ||
(qib_ && (q_->byteLength() + hdr_cmn::access(p)->size()) >= qlimBytes)){
// if the queue would overflow if we added this packet...
if (drop_front_) { // remove from head of queue
q_->enque(p);
Packet *pp = q_->deque();
drop(pp);
} else {
drop(p);
}
} else {
q_->enque(p);
}*/
}
the file drop-tail.c can be found at following location
ns-allinone-2.30/ns-2.30/queue
Any help wud be appreciated
Ashish