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:

  1. [Nakrop Jinaporn:107936]

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

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

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

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

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

    ReplyDelete
  5. (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

    ReplyDelete
  6. 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

    ReplyDelete
  7. 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

    ReplyDelete