How to get Queue Size?

986 views
Skip to first unread message

Zin Win

unread,
Jan 8, 2015, 1:06:27 AM1/8/15
to ns-3-...@googlegroups.com
Hello, every one,

I create four type of traffic such as two multicast and two unicast traffic in WLAN topology. I create four queue for them at a router to AP. I want to get queue size of all queues at router at every time. Although I change various data rates, I get only two queue size of queue1 and queue3. What is wrong in my script? Please, Could you suggest my problem and trace it? I attached my script as below.

Moreover, If I would like to get queue sizes using WiFiMacQueue in AP at every time. I knew that wifimac create automatically queues and just need to create flows due to Sir Kostantinos Katsaros. How could I do or where could I study for that? I saw it in old post,

http://ns-3-users.narkive.com/cghYg9tu/mesh-queue
However, I could not get exact instruction for that. I would like to get sample for that. Thanks in advance.
queueSizeTest.cc

Tommaso Pecorella

unread,
Jan 8, 2015, 2:47:30 AM1/8/15
to ns-3-...@googlegroups.com
Hi,

it's not the time or place to teach you how to measure stuff. However your problem is exactly that one: you don't know how to measure things. Mind, it's not a matter of how to do it in ns-3, it's a matter of how to do it in general.
Think to what you did (periodic check of a queue) and if this is a logical method to use when the queue is mostly empty, i.e., zero for most of the time, and one for an extremely short time period.

About the other question, since you asked Kostas I'll not even try to answer.

Have fun,

T.

Zin Win

unread,
Jan 8, 2015, 10:33:51 PM1/8/15
to ns-3-...@googlegroups.com
Dear sir, Tommaso Pecorella

You means that queue size will be zero in a short time period. I tried to test ti with various simulation time. But the result is the same for queue 2 size and queue 4 size. From my view, it is not possible that these queue size is always zero. I think something is wrong here.  Therefore, I would like to know that is there a problem in my idea or in mixed traffic such as two multicast and two unicast? because I need all queue sizes to implement my later work. If my idea is wrong, please may I know where it is in my script.

I also would like to get answer for my previous question about wifimacqueue because
I would also like to get queue sizes using WiFiMacQueue in AP at every time, How could I do or where could I study for that? I would like to get sample for that.

I am very appreciate answers and suggestions from everybody in ns3 group. At the moment, I try to studying and testing about ns3 to implement my thesis. My thesis is now in important period. I am warmly welcome any suggestions and answers because of I have not known exactly about ns3 yet. If you are ok, I would like to contact you from your email later.  Thanks in advance.

best reg.

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To post to this group, send email to ns-3-...@googlegroups.com.
Visit this group at http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.

Zin Win

unread,
Jan 13, 2015, 12:30:56 AM1/13/15
to ns-3-...@googlegroups.com
Dear sir, Tommaso Pecorella

Please I would like to get your reply. I do not understand clearly your reply. You means that queue size will be zero in a short time period. If so, I tried to test it with various simulation time. But the result is the same for queue 2 size and queue 4 size.
From my view, it is not possible that these queue size is always zero. I think something is wrong here.  Therefore, I would like to know that is there a problem in my idea or in mixed traffic such as two multicast and two unicast?
because I need all queue sizes to implement my later work. If my idea is wrong, please may I know where it is in my script.

I also would like to get answer for my previous question about WiFiMacQueue because
I would also like to get queue sizes using WiFiMacQueue in AP at every time, How could I do or where could I study for that? I would like to get sample for that.

I am very appreciate answers and suggestions from everybody in ns3 group especially you and Kostas. At the moment, I try to studying and testing about ns3 to implement my thesis. My thesis is now in important period. I am warmly welcome any suggestions and answers because of I have not known exactly about ns3 yet. If you are ok, I would like to contact you from your email later.  Thanks in advance.

best reg.

Tommaso Pecorella

unread,
Jan 13, 2015, 2:56:03 AM1/13/15
to ns-3-...@googlegroups.com
Hi,

about WifiMacQueues, please check again the group, I believe there is something.

About the queue sizes, that is the most critical point of your work.

First and foremost, check Little's Law. It talks about average number of users (or packets in our case). However one should first question: how do I measure the queue size.

Second point (also crucial). How many packets do you expect to have in the queue ?
The system may be congested (queues growing) or non-congested (queues mostly empty). We don't care about congested state (there is no average queue length if the queue is growing).

In the normal state you have to measure when the queue changes its status (enqueue or dequeue) and average its size considering the time it spent with a given number of items.
If you try to poke the queue and see its size, and then average over the number of observed queue size, then your sampling period should be higher than the one set by the Nyquist–Shannon sampling theorem.
Since calculating the harmonic principals of the queue / dequeue process is a bit hard (and the queue size changes is a step function anyway), a rule of thumb is: at least 10 samples for each "change" in the queue size.
How much a packet stay in the queue normally? Well, a minimum time is the Tx time for the packet. Do your math, but I'd set the sampling period to at least 1 microsecond. Higher than 20 microsecond, and you risk to not see anything.
You did set your to 10000 microseconds. Enough said.

Now, why I didn't answer you immediately ?
Well, because the answer (this answer) is trivial.

T.

Zin Win

unread,
Jan 13, 2015, 4:26:18 AM1/13/15
to ns-3-...@googlegroups.com
Thanks sir,Tommaso Pecorella very much for your details explanation and good suggestions.
I set maximum queue size for all queues. But I do not get any packets in that two queues although I try to change various simulation time. So, I am not sure that my idea is wrong because of mixed traffic or queue are mostly empty. Now, I see it.
As you said, I do not care congestion. Thanks you sir, I will try and study more to implement my thesis with your guideline. At the moment, my condition is " try and error roundly ".

best reg..


JoseSaenz

unread,
Aug 12, 2015, 2:10:39 PM8/12/15
to ns-3-users
Hello Zin, 
I am trying as well to check a queue size for my work.
Did you manage to find a solution,? if you did could you share it.
I saw your code,  and would like to ask if you just want to check the queue size at a specific time or you want to keep checking it continuously. 
I think is the first option (at a specific time) since you use "Simulator::ScheduleNow (&CheckQueuePriority, queue1, queue2, queue3, queue4);" and not a Callback function. 


Best Regards. 
Reply all
Reply to author
Forward
Message has been deleted
0 new messages