[Ns-bugs] [Bug 138] Point-to-point netdevice queues aren't configurable from higher layers
bugzilla-daemon@nsnam-www.ece.gatech.edu
bugzilla-daemon at nsnam-www.ece.gatech.edu
Wed Feb 13 06:02:10 PST 2008
http://www.nsnam.org/bugzilla/show_bug.cgi?id=138
gjcarneiro at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gjcarneiro at gmail.com
------- Comment #1 from gjcarneiro at gmail.com 2008-02-13 09:02 -------
(In reply to comment #0)
> Summary from off-list/off-tracker emails:
> Changing the queue sizes on a per queue basis should be like:
> PointToPointTopology::GetNetDevice
> (n1,channel1)->GetQueue()->SetMaxPackets(25);
>
> But there are two issues that prevent this from working:
>
> 1. The GetQueue method of the NetDevice is private.
> 2. SetMaxPackets (or indeed any Queue API related to resizing/setting
> limits) isn't a Queue base class API, but is in DropTailQueue.
>
> -----------------------------
> Tom's Reply:
> I can tell you the historical reason for #2, which is that Mathieu argued that
> SetMaxPackets is semantically vague when you start talking about certain types
> of 802.11 queues (such as 802.11e) and therefore he opposed putting this method
> into the Queue base class.
SetMaxPackets should work for any kind of Queue, even 802.11e. In some queue
types, like 802.11e, it may happen that a "queue" will be actually composed of
several "sub-queues", one for each class of service. In this case we could
just define SetMaxPackets as calling SetMaxPackets for each of the sub-queues,
with the same value for all (so SetMaxPackets(N) in the queue will end up
potentially accepting between N and N*M packets, depending on the distribution
of packets per class of service, K being the number of subqueues).
>
> However, Mathieu ended up not even using the queue base class (he implemented
> 802.11-specific queues for his wifi net device) so it may be a moot point now.
>
> I do not know the rationale for #1. I think that adding a public GetQueue() to
> PointToPointNetDevice would be fine.
>
> Another possibility would be to aggregate a Queue to a PointToPointNetDevice
> and then GetObject<Queue> would be publicly available. This would allow you to
> do "safe downcasts" in the future (such as GetObject<REDQueue> to see if it has
> a RED interface).
I'm not sure GetObject is appropriate; GetObject (formerly QueryInterface) is
for obtaining functionality from an object that is optionally implemented. A
GetQueue () method is better IMHO because a Queue is supposed to be always
available in a NetDevice, so an explicit geter method is clearer and more
compile-time safe. For downcast it is always easy to do:
Ptr<RedQueue> = dynamic_cast<RedQueue*> (PeekPointer (p2p.GetQueue ()));
Well, I know, the downcast could be easier, perhaps. Maybe we could add a
downcast helper function to the ptr.h header?
template <typename BASE_TYPE, typename SUBTYPE>
Ptr<SUBTYPE> DynamicCast<SUBTYPE> (Ptr<BASE_TYPE> obj)
{
return Ptr<SUBTYPE> (dynamic_cast<SUBTYPE*> (PeekPointer (obj)));
}
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Ns-bugs
mailing list