count the number of outstanding packets in the wifi queue and calculating queuing delay

642 views
Skip to first unread message

ns3...@gmail.com

unread,
Jun 17, 2014, 9:02:57 PM6/17/14
to ns-3-...@googlegroups.com
Hi all,
How to count the number of outstanding packets in the wifi queue? secondly how to calculate queuing delay in NS3? thanks in advance for your time and help.

Best regards,

Nat P

unread,
Jun 19, 2014, 6:20:37 AM6/19/14
to ns-3-...@googlegroups.com
Make an event which fires on x seconds, which has a argument the queue you want to measure. Then, see how many packets there are and save it somewhere.
To calculate queuing delay, simply use the packet count and the link bandwidth to calculate the time which takes to send all packets in the queue. 

ns3 geek

unread,
Jun 19, 2014, 8:18:54 PM6/19/14
to ns-3-...@googlegroups.com
thanks for your reply and time.I really appreciated that.
According to my understanding (Kindly please correct me if I am wrong);
Normally in order to dequeue the packet from mac queue we just pass on the mac pointer of the node and the function returns the pointer to the packet. From that it looks like simulator has one instance of the mac queue and it stores packets from each node into that queue. Using this information, If I use the queue function uint32_t ns3::Queue::GetTotalReceivedPackets then it will return the total number of received packet by queue form higher layer of all nodes.

In simple words, my question is that Does ns3 simulator create one queue instance for all nodes or create one instance for each node?

For the delay I am planning to add a packet tag before enqueuing and in that tag i can store the current simulator time of queuing the packet. On dequeuing I can extract the tag value and using current simulator time i can calculate the queuing delay experienced by that packet. what are your comments about this method? thanks

best regards,




--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/j0XgwBpMlLI/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Nat P

unread,
Jun 26, 2014, 1:02:00 PM6/26/14
to ns-3-...@googlegroups.com
Il giorno venerdì 20 giugno 2014 02:18:54 UTC+2, ns3 geek ha scritto:
Normally in order to dequeue the packet from mac queue we just pass on the mac pointer of the node and the function returns the pointer to the packet. From that it looks like simulator has one instance of the mac queue and it stores packets from each node into that queue. Using this information, If I use the queue function uint32_t ns3::Queue::GetTotalReceivedPackets then it will return the total number of received packet by queue form higher layer of all nodes.

In simple words, my question is that Does ns3 simulator create one queue instance for all nodes or create one instance for each node?

You can see through the ns-3 code (it is open source after all), I don't know in depth the wifi module. In documentation, I see that Queue is used in AlohaNoackNetDevice, and I suppose (but you should check) that each instance of AlohaNoackNetDevice has its own queue. 
 

For the delay I am planning to add a packet tag before enqueuing and in that tag i can store the current simulator time of queuing the packet. On dequeuing I can extract the tag value and using current simulator time i can calculate the queuing delay experienced by that packet. what are your comments about this method? thanks


It depends on what are you interested in, but I do not see any counterindication on what you're saying (assumption: you want to know, for each packet, its exact queuing delay).

Have a nice day 

ns3 geek

unread,
Jun 27, 2014, 6:39:15 PM6/27/14
to ns-3-...@googlegroups.com
thanks alot for your reply and your time.Its really helpful.

best regards,



--

John Abraham

unread,
Jun 28, 2014, 7:14:22 PM6/28/14
to ns-3-...@googlegroups.com
Hi,
As a small aid during debugging, I added a some custom counters within AnimationInterface, to track things like num of queueing, dequeueing and queue drop events, .... ipv4 rx, tx , drop counters.

Code snippet 

  AnimationInterface anim ("myredtests.xml");

  anim.EnableQueueCounters (Seconds (0), Seconds (sink_stop_time));

  anim.EnableIpv4L3ProtocolCounters (Seconds (0), Seconds (sink_stop_time));


Sample charts by using NetAnim's Stats tab/Counter tables



its available via

hg clone http://code.nsnam.org/ns-3-dev

hg clone http://code.nsnam.org/netanim





--
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.
Screen Shot 2014-06-28 at 4.09.10 PM.png
Screen Shot 2014-06-28 at 4.09.24 PM.png
Screen Shot 2014-06-28 at 4.09.41 PM.png

ns3 geek

unread,
Jul 13, 2014, 8:24:54 PM7/13/14
to ns-3-...@googlegroups.com
thanks john for sharing.

Best regards,
Reply all
Reply to author
Forward
0 new messages