Hi,
I had no problems accessing the four different EDCA queues from the simulation script where I had actually added a Trace Source in wifi-mac-queue.cc:
.AddTraceSource ("QueueSize", "Assesing the queue size",
MakeTraceSourceAccessor (&WifiMacQueue::m_queueSize))
and then set the m_queueSize using the value of m_size
m_queueSize(m_size)
and I'm able to access from my simulation script via the Config Path:
- /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BE_EdcaTxopN/Queue
- /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/BK_EdcaTxopN/Queue
- /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VI_EdcaTxopN/Queue
- /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Mac/$ns3::RegularWifiMac/VO_EdcaTxopN/Queue
However, I am trying to access the current size of the EDCA queues, in a specific node, from within the library files (sta-wifi-mac.cc, wifi-mac-queue.cc and also ap-wifi-mac.cc).
This is because i need to know the status of the queue whether it is full or not to launch some algorithms.
What currently I am doing is that in WifiMacQueue::Enqueue, I'll check the header for the node address I want, then I'll peek the QosTag, and then print out the m_size so that I know which EDCA queue that I'm printing. For example:
QosTag qosTag;
if (packet->PeekPacketTag(qosTag)){
int currentTid = qosTag.GetTid(); // added by najwan 2.12.2014
}
if (currentTid==6 || currentTid==7){
m_size++;
std::cout << "Current VO Queue size is: " << m_size << std::endl;
}
Meanwhile to access the queue size in sta-wifi-mac.cc, I created a two functions (Setter and Getter function) for each of the EDCA queues. The value of the queue size (m_size) are passed from wifi-mac-queue.cc using a Setter function and can be accessed from sta-wifi-mac and ap-wifi-mac using the Getter function.
My question is, am I doing it right? Is there any simpler method to access the queue from within the library files?
I'm not sure whether the method of using Ptr<Node> and finally access the WifiMacQueue using the GetVOQueue() can be used in the library files.
This is because I'm not sure how to point the pointer to a specific nodes because the node declarations are all done in the simulation script, not in the library files.
Any insights are very much welcomed.
Many, many thanks.