[ndnSIM] Print Queue length

Ilya Moiseenko iliamo at ucla.edu
Thu Dec 5 10:59:16 PST 2013


Hi Amin

1) m_maxPackets is indeed private.
However, you can access this value by attribute named “MaxPackets"
See http://www.nsnam.org/docs/release/3.18/doxygen/classns3_1_1_drop_tail_queue.html for details

2) Technically you can do this in NS3. And in real life routers can have different queue sizes. 


Ilya

On Dec 4, 2013, at 2:35 AM, Amin Karami <amin at ac.upc.edu> wrote:

> Hi Alex,
> I am going to print Queue length in a specific interface of a router. I wrote below function:
> 
> void PeriodicStatsPrinter (Ptr<Node> node, Time next)
> Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
> Ptr<Channel> CH = node->GetDevice(2)->GetChannel(); \\ 2nd interface of the node
> Ptr<NetDevice> toDev = CH->GetDevice (1); \\ access to its queue
> PointerValue txQueue;
> toDev->GetAttribute ("TxQueue", txQueue);
> std::cout << Simulator::Now ().ToDouble (Time::S) << "\t"
> << Names::FindName (node) << "\t"
> << "Max Packets of Queue: " << txQueue.Get<DropTailQueue> ()->m_maxPackets << "\n";
> 
> 1- But, i faced with this error:
> ../scratch/RTT/RTT.cc: In function ‘void PeriodicStatsPrinter(ns3::Ptr<ns3::Node>, ns3::Time)’:
> ../scratch/RTT/RTT.cc:44:6: error: expected primary-expression before ‘<<’ token
> ./ns3/drop-tail-queue.h:68:12: error: ‘uint32_t ns3::DropTailQueue::m_maxPackets’ is private
> ../scratch/RTT/RTT.cc:44:58: error: within this context
> 
> 2- Could i define two Queue lengths for a specific interface in routers? from inside and outside of a link. Or both should be equal?
> 
> 
> /Amin
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim





More information about the ndnSIM mailing list