Monday, July 20, 2009

[AIT09] Queue

This question is from Thein Tun:

How do you get the length of the queue ? Can you give examples of different types of queue?

[From Teerawat: Do not give more than one example per person]

7 comments:

Anonymous said...

[Nakrop Jinaporn:107936]

Drop-tail objects:
Drop-tail objects are a subclass of Queue objects that implement simple FIFO queue.

Unknown said...

Another Example of the Queue is LIFO last in first out.

Teerawat Issariyakul said...

What are the C++ and OTcl classes for those queues?

Unknown said...

1)functions limit() and length() return the queue
size and current buffer occupancy, respectively.

int limit() { return qlim_; }
int length() { return pq_->length();

Unknown said...

(Hasanain/106000)
see ~ns-2/queue/queue.h
To get the lenght of a queue class Queue uses

class Queue : public Connector {
public:
........
int length() { return pq_->length(); }/* number of pkts currently in
* underlying packet queue */
........
};
and different types of queue used in NS2 are priqueue, rtqueue, REDQueue

Unknown said...

well sir , i told u the general type of queue, in NS2 I found priqueue, rtqueue, REDQueue etc in Cygwin:

path-->C:\cygwin\usr\local\
ns-allinone-2.33\ns-allinone-2.33\
ns-2.33\queue

The class herarchy of Priqueue is:

PriQueue-->DropTail-->Queue-->
Connector-->NsObject-->TclObject and Handler

Unknown said...

limit() and length() functions give you current buffer occupancy of source nodes only . At least in my case , it is giving current buffer occupancy of source nodes only. How can we get buffer occupancy of intermediate nodes while routing?????
Please suggest me some alternatives to write a code for this in ns2 backend files such as aodv.cc