Dear all,
I am struggling with configuring a DropTailQueue of a certain size in
a CsmaNetDevice, and would appreciate any help. I have tried different
methods:
1- Config::SetDefault ("ns3::DropTailQueue::MaxPackets", UintegerValue
(50));
CsmaHelper csma;
NetDeviceContainer devices = csma.Install (nodes);
Expecting that by default a DropTailQueue of 50 packets would be
installed in the devices. However, the previous does not work.
2- I tried with the SetQueue method of the CsmaHelper class.
CsmaHelper csma;
csma.SetQueue(std::string("DropTailQueue"),std::string("MaxPackets"),IntegerValue(50));
NetDeviceContainer devices = csma.Install (nodes);
However, the previous does not work either, I get compilation errors
complaining about an incorrect TypeID, basically I do not seem to be
able to pass the correct parameters to the method SetQueue() and I
have not found any example in the existing code.
3- I try to set the queues manually:
NetDeviceContainer devices = csma.Install (nodes);
Ptr<CsmaNetDevice> csma_device_aux = devices.Get(0)-
>GetObject<CsmaNetDevice> ();
csma_device_aux->SetQueue (CreateObject<DropTailQueue> ());
Ptr<DropTailQueue> dtq = csma_device_aux->GetQueue()-
>GetObject<DropTailQueue> ();
dtq->SetAttribute("MaxPackets", UintegerValue (60));
The previous does compile, but when I run my experiment I see that the
queue is not yet limited to 50 packets. Actually, th experiment I run
seems to have unbounded queues (?).
The way I capture the queue size is by tracing the Enqueue and Dequeue
events defined in the Queue class:
QueueMonitor QMon;
Ptr<CsmaNetDevice> csma_device = devices.Get(0)-
>GetObject<CsmaNetDevice> ();
csma_device->GetQueue()->TraceConnectWithoutContext ("Enqueue",
MakeCallback(&QueueMonitor::TraceEnqueue, &QMon));
csma_device->GetQueue()->TraceConnectWithoutContext ("Dequeue",
MakeCallback(&QueueMonitor::TraceDequeue, &QMon));
It could also be that I am making a mistake there.
Thanks in advance for your advice!
Best Regadrs
Daniel
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to
ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to
ns-3-users+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/ns-3-users?hl=en.