Hi Tom,
I'm not familiar with the Wifi NetDevice in detail, but I suggest that
you start by looking at two existing trace points:
.AddTraceSource ("Tx", "Send payload to the MAC layer.",
MakeTraceSourceAccessor (&WifiNetDevice::m_txLogger))
.AddTraceSource ("Tx", "Packet transmission is starting.",
MakeTraceSourceAccessor (&WifiPhy::m_txTrace))
If these two trace points bound the points in the model across which you
are trying to measure latency, then you could hook trace sinks to get
the packets, and print out tuples such as (timestamp, packet id) for
each one, and then later post-process by lining up packet ids from the
later phy trace with the mac trace. There are probably more
sophisticated ways to do the above latency estimation directly without
post-processing steps, but hopefully you get the idea.
If the above are not the right trace points for you, you could clone one
of the above and put it at the place where you want to trace.
- Tom
indeed :)
See examples/wifi-ap.cc:
void
DevTxTrace (std::string context, Ptr<const Packet> p, Mac48Address
address)
{
std::cout << " TX to=" << address << " p: " << *p << std::endl;
}
void
DevRxTrace (std::string context, Ptr<const Packet> p, Mac48Address
address)
{
std::cout << " RX from=" << address << " p: " << *p << std::endl;
}
Config::Connect ("/NodeList/*/DeviceList/*/Tx", MakeCallback
(&DevTxTrace));
Config::Connect ("/NodeList/*/DeviceList/*/Rx", MakeCallback
(&DevRxTrace));
Mathieu